Sync from SUSE:SLFO:Main cloud-regionsrv-client revision f908506f8fdf8af2815b640630328c38

This commit is contained in:
Adrian Schröter 2024-11-04 17:26:46 +01:00
parent 49a04784ef
commit 118d8f15ab
6 changed files with 231 additions and 34 deletions

BIN
cloud-regionsrv-client-10.2.0.tar.bz2 (Stored with Git LFS)

Binary file not shown.

BIN
cloud-regionsrv-client-10.3.6.tar.bz2 (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -1,3 +1,67 @@
-------------------------------------------------------------------
Tue Oct 29 13:44:21 UTC 2024 - Robert Schweikert <rjschwei@suse.com>
- Update to 10.3.6 (jsc#PCT-471, bsc#1230615)
+ Fix sudo setup
~ permissions cloudguestregistryauth
~ directory ownership /etc/sudoers.d
+ spec file
~ Remove traces of registry related entries on SLE 12
+ Forward port
~ fix-for-sles12-disable-registry.patch
~ fix-for-sles12-no-trans_update.patch
+ Deregister non free extensions at registercloudguest --clean
+ Fix registry cleanup at registercloudguest --clean, don't remove files
+ Prevent duplicate search entries in registry setup
- Update EC2 plugin to 1.0.5
+ Switch to using the region endpoint from IMDS to determine the region
instead of deriving the data from the availability zone
-------------------------------------------------------------------
Wed Sep 11 13:20:32 UTC 2024 - Robert Schweikert <rjschwei@suse.com>
- Update to 10.3.5
+ Update spec file to build in all code streams,
SLE 12, SLE 15, ALP, and SLFO and have proper dependencies
-------------------------------------------------------------------
Wed Aug 28 20:17:24 UTC 2024 - Robert Schweikert <rjschwei@suse.com>
- Update to 10.3.4
+ Modify the message when network access over a specific IP version does
not work. This is an informational message and should not look like
an error
+ Inform the user that LTSS registration takes a little longer
+ Add fix-for-sles12-no-trans_update.patch
+ SLE 12 family has no products with transactional-update we do not
need to look for this condition
- From 10.3.3 (bsc#1229472)
+ Handle changes in process structure to properly identify the running
zypper parent process and only check for 1 PID
- From 10.3.2
+ Remove rgnsrv-clnt-fix-docker-setup.patch included upstream
- From 10.3.1 (jsc#PCT-400)
+ Add support for LTSS registration
+ Add fix-for-sles12-disable-registry.patch
~ No container support in SLE 12
-------------------------------------------------------------------
Thu Aug 15 13:07:06 UTC 2024 - Robert Schweikert <rjschwei@suse.com>
- Add rgnsrv-clnt-fix-docker-setup.patch (bsc#1229137)
+ The entry for the update infrastructure registry mirror was written
incorrectly causing docker daemon startup to fail.
-------------------------------------------------------------------
Tue Jul 2 18:24:38 UTC 2024 - Jesús Bermúdez Velázquez <jesus.bv@suse.com>
- Update to version 10.3.0 (bsc#1227308, bsc#1222985)
+ Add support for sidecar registry
Podman and rootless Docker support to set up the necessary
configuration for the container engines to run as defined
+ Add running command as root through sudoers file
------------------------------------------------------------------- -------------------------------------------------------------------
Thu May 9 17:32:38 UTC 2024 - Robert Schweikert <rjschwei@suse.com> Thu May 9 17:32:38 UTC 2024 - Robert Schweikert <rjschwei@suse.com>

View File

@ -1,7 +1,7 @@
# #
# spec file for package cloud-regionsrv-client # spec file for package cloud-regionsrv-client
# #
# Copyright (c) 2022 SUSE LLC # Copyright (c) 2024 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -15,8 +15,14 @@
# Please submit bugfixes or comments via https://bugs.opensuse.org/ # Please submit bugfixes or comments via https://bugs.opensuse.org/
# #
%if 0%{?suse_version} >= 1600
%define pythons %{primary_python}
%else
%define pythons python3
%endif
%global _sitelibdir %{%{pythons}_sitelib}
%define base_version 10.2.0 %define base_version 10.3.6
Name: cloud-regionsrv-client Name: cloud-regionsrv-client
Version: %{base_version} Version: %{base_version}
Release: 0 Release: 0
@ -27,6 +33,10 @@ URL: http://www.github.com/SUSE-Enceladus/cloud-regionsrv-client
Source0: %{name}-%{version}.tar.bz2 Source0: %{name}-%{version}.tar.bz2
# PATCH-FIX-SLES12 bsc#1203382 fix-for-sles12-disable-ipv6.patch # PATCH-FIX-SLES12 bsc#1203382 fix-for-sles12-disable-ipv6.patch
Patch0: fix-for-sles12-disable-ipv6.patch Patch0: fix-for-sles12-disable-ipv6.patch
# PATCH-FIX-SLES12 fix-for-sles12-disable-registry.patch
Patch1: fix-for-sles12-disable-registry.patch
# PATCH-FIX-SLES12 fix-for-sles12-no-trans_update.patch
Patch2: fix-for-sles12-no-trans_update.patch
Requires: SUSEConnect > 0.3.31 Requires: SUSEConnect > 0.3.31
Requires: ca-certificates Requires: ca-certificates
Requires: cloud-regionsrv-client-config Requires: cloud-regionsrv-client-config
@ -35,13 +45,18 @@ Requires: dmidecode
%endif %endif
Requires: pciutils Requires: pciutils
Requires: procps Requires: procps
Requires: python3 Requires: %{pythons}
Requires: python3-M2Crypto Requires: %{pythons}-PyYAML
Requires: python3-lxml Requires: %{pythons}-M2Crypto
Requires: python3-requests Requires: %{pythons}-lxml
Requires: python3-urllib3 Requires: %{pythons}-requests
Requires: python3-zypp-plugin Requires: %{pythons}-urllib3
Requires: %{pythons}-zypp-plugin
%if 0%{?suse_version} > 1315
Requires: %{pythons}-toml
%endif
Requires: regionsrv-certs Requires: regionsrv-certs
Requires: sudo
Requires: zypper Requires: zypper
BuildRequires: systemd BuildRequires: systemd
Conflicts: container-suseconnect Conflicts: container-suseconnect
@ -51,14 +66,23 @@ Conflicts: container-suseconnect
%{?systemd_ordering} %{?systemd_ordering}
%endif %endif
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
BuildRequires: python3-M2Crypto BuildRequires: %{pythons}-PyYAML
BuildRequires: python3-lxml BuildRequires: %{pythons}-M2Crypto
BuildRequires: python3-requests BuildRequires: %{pythons}-devel
BuildRequires: python3-setuptools BuildRequires: %{pythons}-lxml
BuildRequires: python3-zypp-plugin BuildRequires: %{pythons}-requests
BuildRequires: %{pythons}-setuptools
BuildRequires: %{pythons}-zypp-plugin
%if 0%{?suse_version} >= 1600
BuildRequires: %{pythons}-pip
BuildRequires: %{pythons}-wheel
%endif
%if 0%{?suse_version} > 1315
BuildRequires: %{pythons}-toml
%endif
BuildRequires: sudo
BuildRequires: systemd-rpm-macros BuildRequires: systemd-rpm-macros
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch BuildArch: noarch
%description %description
@ -87,16 +111,18 @@ Requires: cloud-regionsrv-client >= 6.0.0
%description plugin-gce %description plugin-gce
Guest registration plugin for images intended for Google Compute Engine Guest registration plugin for images intended for Google Compute Engine
providing information to get the appropriate data form the region server.
%package plugin-ec2 %package plugin-ec2
Version: 1.0.4 Version: 1.0.5
Release: 0 Release: 0
Summary: Cloud Environment Guest Registration Plugin for Amazon EC2 Summary: Cloud Environment Guest Registration Plugin for Amazon EC2
Group: Productivity/Networking/Web/Servers Group: Productivity/Networking/Web/Servers
Requires: cloud-regionsrv-client >= 6.0.0 Requires: cloud-regionsrv-client >= 6.0.0
%description plugin-ec2 %description plugin-ec2
Guest registration plugin for images intended for Amazon EC2 Guest registration plugin for images intended for Amazon EC2 providing
information to get the appropriate data form the region server.
%package plugin-azure %package plugin-azure
Version: 2.0.0 Version: 2.0.0
@ -107,7 +133,8 @@ Requires: cloud-regionsrv-client >= 6.0.0
Requires: python3-dnspython Requires: python3-dnspython
%description plugin-azure %description plugin-azure
Guest registration plugin for images intended for Microsoft Azure Guest registration plugin for images intended for Microsoft Azure providing
information to get the appropriate data form the region server.
%package addon-azure %package addon-azure
Version: 1.0.5 Version: 1.0.5
@ -117,22 +144,35 @@ Group: Productivity/Networking/Web/Servers
Requires: cloud-regionsrv-client >= 9.0.0 Requires: cloud-regionsrv-client >= 9.0.0
Requires: cloud-regionsrv-client-plugin-azure Requires: cloud-regionsrv-client-plugin-azure
BuildArch: noarch
%description addon-azure %description addon-azure
Enable/Disable Guest Registration for Microsoft Azure Enable/Disable Guest Registration for Microsoft Azure when changes in the
instance status are detected for PAYG vs. BYOS
%prep %prep
%setup -q %setup -q
%if 0%{?suse_version} == 1315 %if 0%{?suse_version} == 1315
%patch0 %patch -P 0
%patch -P 1
%patch -P 2
%endif %endif
%build %build
python3 setup.py build %if 0%{?suse_version} >= 1600
%pyproject_wheel
%else
%{pythons} setup.py build
%endif
%install %install
cp -r etc %{buildroot} cp -r etc %{buildroot}
cp -r usr %{buildroot} cp -r usr %{buildroot}
python3 setup.py install --prefix=%{_prefix} --root=%{buildroot} %if 0%{?suse_version} >= 1600
%pyproject_install
%else
%{pythons} setup.py install --prefix=%{_prefix} --root=%{buildroot}
%endif
# The location of the regionserver certs # The location of the regionserver certs
mkdir -p %{buildroot}/usr/lib/regionService/certs mkdir -p %{buildroot}/usr/lib/regionService/certs
# The directory for the cache data # The directory for the cache data
@ -141,6 +181,11 @@ install -d -m 755 %{buildroot}/%{_mandir}/man1
install -m 644 man/man1/* %{buildroot}/%{_mandir}/man1 install -m 644 man/man1/* %{buildroot}/%{_mandir}/man1
install -m 644 usr/lib/systemd/system/regionsrv-enabler-azure.service %{buildroot}%{_unitdir} install -m 644 usr/lib/systemd/system/regionsrv-enabler-azure.service %{buildroot}%{_unitdir}
install -m 644 usr/lib/systemd/system/regionsrv-enabler-azure.timer %{buildroot}%{_unitdir} install -m 644 usr/lib/systemd/system/regionsrv-enabler-azure.timer %{buildroot}%{_unitdir}
install -m 440 etc/sudoers.d/cloudguestregistryauth %{buildroot}%{_sysconfdir}/sudoers.d/cloudguestregistryauth
%if 0%{?suse_version} == 1315
rm -rf %{buildroot}%{_sysconfdir}/sudoers.d/cloudguestregistryauth
rm -rf %{buildroot}%{_bindir}/cloudguestregistryauth
%endif
gzip %{buildroot}/%{_mandir}/man1/* gzip %{buildroot}/%{_mandir}/man1/*
%pre %pre
@ -188,7 +233,9 @@ fi
%{_mandir}/man*/* %{_mandir}/man*/*
# Do not expect the user that needs containers to have root access # Do not expect the user that needs containers to have root access
# on the system # on the system
%if 0%{?suse_version} > 1315
%{_bindir}/cloudguestregistryauth %{_bindir}/cloudguestregistryauth
%endif
%{_sbindir}/cloudguest-repo-service %{_sbindir}/cloudguest-repo-service
%{_sbindir}/containerbuild-regionsrv %{_sbindir}/containerbuild-regionsrv
%{_sbindir}/createregioninfo %{_sbindir}/createregioninfo
@ -196,15 +243,22 @@ fi
%{_sbindir}/registercloudguest %{_sbindir}/registercloudguest
%{_sbindir}/updatesmtcache %{_sbindir}/updatesmtcache
%{_usr}/lib/zypp/plugins/urlresolver/susecloud %{_usr}/lib/zypp/plugins/urlresolver/susecloud
%{python3_sitelib}/cloudregister/__* %if 0%{?suse_version} > 1315
%{python3_sitelib}/cloudregister/reg* %config %{_sysconfdir}/sudoers.d/*
%{python3_sitelib}/cloudregister/smt* %endif
%{python3_sitelib}/cloudregister/VERSION
%{_unitdir}/guestregister.service %{_unitdir}/guestregister.service
%{_unitdir}/containerbuild-regionsrv.service %{_unitdir}/containerbuild-regionsrv.service
%dir %{python3_sitelib}/cloudregister-%{base_version}-py%{py3_ver}.egg-info %exclude %{_sitelibdir}/cloudregister/google*
%dir %{python3_sitelib}/cloudregister/ %exclude %{_sitelibdir}/cloudregister/amazon*
%{python3_sitelib}/cloudregister-%{base_version}-py%{py3_ver}.egg-info/* %exclude %{_sitelibdir}/cloudregister/msft*
%{_sitelibdir}/cloudregister/
%if 0%{?suse_version} >= 1600
%{_sitelibdir}/cloudregister-*.dist-info/
%else
%dir %{_sitelibdir}/cloudregister-%{base_version}-py%{py3_ver}.egg-info
%dir %{_sitelibdir}/cloudregister/
%{_sitelibdir}/cloudregister-%{base_version}-py%{py3_ver}.egg-info/*
%endif
%files generic-config %files generic-config
%defattr(-,root,root,-) %defattr(-,root,root,-)
@ -215,15 +269,15 @@ fi
%files plugin-gce %files plugin-gce
%defattr(-,root,root,-) %defattr(-,root,root,-)
%{python3_sitelib}/cloudregister/google* %{_sitelibdir}/cloudregister/google*
%files plugin-ec2 %files plugin-ec2
%defattr(-,root,root,-) %defattr(-,root,root,-)
%{python3_sitelib}/cloudregister/amazon* %{_sitelibdir}/cloudregister/amazon*
%files plugin-azure %files plugin-azure
%defattr(-,root,root,-) %defattr(-,root,root,-)
%{python3_sitelib}/cloudregister/msft* %{_sitelibdir}/cloudregister/msft*
%files addon-azure %files addon-azure
%defattr(-,root,root,-) %defattr(-,root,root,-)

View File

@ -0,0 +1,68 @@
--- lib/cloudregister/registerutils.py.orig
+++ lib/cloudregister/registerutils.py
@@ -30,7 +30,8 @@ import stat
import subprocess
import sys
import time
-import toml
+# Disabled on SLE12
+#import toml
import yaml
from collections import namedtuple
@@ -75,11 +76,12 @@ def add_hosts_entry(smt_server):
smt_server.get_FQDN(),
smt_server.get_name()
)
- if smt_server.get_registry_FQDN():
- entry += '%s\t%s\n' % (
- smt_ip,
- smt_server.get_registry_FQDN()
- )
+ # Disabled on SLE12
+ # if smt_server.get_registry_FQDN():
+ # entry += '%s\t%s\n' % (
+ # smt_ip,
+ # smt_server.get_registry_FQDN()
+ # )
with open('/etc/hosts', 'a') as hosts_file:
hosts_file.write(smt_hosts_entry_comment)
@@ -877,6 +879,8 @@ def set_registries_conf(registry_fqdn):
# ----------------------------------------------------------------------------
def get_registry_conf_file(container_path, container):
+ # Disabled on SLE12
+ return None
registries_conf = {}
try:
with open(container_path, 'r') as registries_conf_file:
@@ -923,6 +927,8 @@ def update_bashrc(content, mode):
# ----------------------------------------------------------------------------
def clean_registry_setup():
"""Remove the data previously set to make the registry work."""
+ # Disabled on SLE12
+ return None
smt = get_smt_from_store(__get_registered_smt_file_path())
private_registry_fqdn = smt.get_registry_FQDN() if smt else ''
clean_registry_auth(private_registry_fqdn)
@@ -1193,6 +1199,8 @@ def clean_registries_conf_docker(private
# ----------------------------------------------------------------------------
def write_registries_conf(registries_conf, container_path, container_name):
"""Write registries_conf content to container_path."""
+ # Disabled on SLE12
+ return None
try:
if container_name == 'podman':
with open(container_path, 'w') as registries_conf_file:
--- usr/sbin/registercloudguest.orig
+++ usr/sbin/registercloudguest
@@ -134,6 +134,8 @@ def setup_registry(registration_target,
clean == all -> cleans repository and registry setup
clean == registry -> clean only registry artifacts
"""
+ # Disabled on SLE12
+ return None
user, password = utils.get_credentials(
utils.get_credentials_file(registration_target)
)

View File

@ -0,0 +1,11 @@
--- lib/cloudregister/registerutils.py
+++ lib/cloudregister/registerutils.py
@@ -339,6 +339,8 @@ def get_register_cmd():
"""Determine which command we need to use to register the system"""
register_cmd = '/usr/sbin/SUSEConnect'
+ # Return early on SLE12
+ return register_cmd
if is_transactional_system():
cmd_name = 'transactional-update'
for path in ['/sbin/', '/usr/sbin/']: