From 5eec89c0cc01f709c460521f326e09f06a3095da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Mon, 10 Feb 2025 22:45:18 +0100 Subject: [PATCH] Sync from SUSE:ALP:Source:Standard:1.0 cloud-regionsrv-client revision 7b117510ef355c4a9d107446625e9bf8 --- cloud-regionsrv-client-10.2.0.tar.bz2 | 3 - cloud-regionsrv-client-10.3.11.tar.bz2 | 3 + cloud-regionsrv-client.changes | 84 ++++++++++++++++ cloud-regionsrv-client.spec | 132 +++++++++++++++++++------ fix-for-sles12-disable-ipv6.patch | 8 +- fix-for-sles12-disable-registry.patch | 72 ++++++++++++++ fix-for-sles12-no-trans_update.patch | 13 +++ 7 files changed, 278 insertions(+), 37 deletions(-) delete mode 100644 cloud-regionsrv-client-10.2.0.tar.bz2 create mode 100644 cloud-regionsrv-client-10.3.11.tar.bz2 create mode 100644 fix-for-sles12-disable-registry.patch create mode 100644 fix-for-sles12-no-trans_update.patch diff --git a/cloud-regionsrv-client-10.2.0.tar.bz2 b/cloud-regionsrv-client-10.2.0.tar.bz2 deleted file mode 100644 index 40910cd..0000000 --- a/cloud-regionsrv-client-10.2.0.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d008e5da8782a29402410d32c95b232ad4b7f5cd10f65b594ef8c4ca0be98162 -size 31077 diff --git a/cloud-regionsrv-client-10.3.11.tar.bz2 b/cloud-regionsrv-client-10.3.11.tar.bz2 new file mode 100644 index 0000000..9575c96 --- /dev/null +++ b/cloud-regionsrv-client-10.3.11.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eb001464e8f9d2b475d955e33e5950a928cf97dee2769519e714da5e3793e71c +size 39942 diff --git a/cloud-regionsrv-client.changes b/cloud-regionsrv-client.changes index fc2ee47..284cd77 100644 --- a/cloud-regionsrv-client.changes +++ b/cloud-regionsrv-client.changes @@ -1,3 +1,87 @@ +------------------------------------------------------------------- +Tue Dec 3 17:21:52 UTC 2024 - Jesús Bermúdez Velázquez + +- Update to 10.3.11 (bsc#1234050) + + Send registration code for the extensions, not only base product + +------------------------------------------------------------------- +Wed Nov 18 16:12:23 UTC 2024 - Marcus Schäfer + +- Update to 10.3.8 (bsc#1233333) + + Fix the package requirements for cloud-regionsrv-client + + Follow changes to suseconnect error reporting from stdout to stderr + +------------------------------------------------------------------- +Tue Nov 5 13:58:12 UTC 2024 - Robert Schweikert + +- Update to 10.3.7 (bsc#1232770) + + Fix the product triplet for LTSS, it is always SLES-LTSS, not + $BASEPRODUCT-LTSS + +------------------------------------------------------------------- +Tue Oct 29 13:44:21 UTC 2024 - Robert Schweikert + +- 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 + +- 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 + +- 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 + +- 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 + +- 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 diff --git a/cloud-regionsrv-client.spec b/cloud-regionsrv-client.spec index 897de66..d619972 100644 --- a/cloud-regionsrv-client.spec +++ b/cloud-regionsrv-client.spec @@ -1,7 +1,7 @@ # # 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 # remain the property of their copyright owners, unless otherwise agreed @@ -15,8 +15,14 @@ # 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.11 Name: cloud-regionsrv-client Version: %{base_version} Release: 0 @@ -27,6 +33,10 @@ URL: http://www.github.com/SUSE-Enceladus/cloud-regionsrv-client Source0: %{name}-%{version}.tar.bz2 # PATCH-FIX-SLES12 bsc#1203382 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: ca-certificates Requires: cloud-regionsrv-client-config @@ -35,15 +45,29 @@ Requires: dmidecode %endif Requires: pciutils Requires: procps -Requires: python3 -Requires: python3-M2Crypto -Requires: python3-lxml -Requires: python3-requests -Requires: python3-urllib3 -Requires: python3-zypp-plugin +Requires: %{pythons} +Requires: %{pythons}-PyYAML +Requires: %{pythons}-M2Crypto +Requires: %{pythons}-lxml +Requires: %{pythons}-requests +Requires: %{pythons}-urllib3 +Requires: %{pythons}-zypp-plugin +%if 0%{?suse_version} > 1315 +Requires: %{pythons}-toml +# Add requirement for libcontainers-common to make sure all +# podman related config files gets pulled in. We modify +# /etc/containers/registries.conf +Requires: libcontainers-common +# Add requirement for docker to make sure all docker related +# config files gets pulled in. We modify +# /etc/docker/daemon.json +Requires: docker +%endif Requires: regionsrv-certs +Requires: sudo Requires: zypper BuildRequires: systemd +BuildRequires: findutils Conflicts: container-suseconnect %if 0%{?suse_version} == 1315 %{?systemd_requires} @@ -51,14 +75,23 @@ Conflicts: container-suseconnect %{?systemd_ordering} %endif BuildRequires: python-rpm-macros -BuildRequires: python3-M2Crypto -BuildRequires: python3-lxml -BuildRequires: python3-requests -BuildRequires: python3-setuptools -BuildRequires: python3-zypp-plugin +BuildRequires: %{pythons}-PyYAML +BuildRequires: %{pythons}-M2Crypto +BuildRequires: %{pythons}-devel +BuildRequires: %{pythons}-lxml +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 BuildRoot: %{_tmppath}/%{name}-%{version}-build - BuildArch: noarch %description @@ -87,16 +120,18 @@ Requires: cloud-regionsrv-client >= 6.0.0 %description plugin-gce Guest registration plugin for images intended for Google Compute Engine +providing information to get the appropriate data form the region server. %package plugin-ec2 -Version: 1.0.4 +Version: 1.0.5 Release: 0 Summary: Cloud Environment Guest Registration Plugin for Amazon EC2 Group: Productivity/Networking/Web/Servers Requires: cloud-regionsrv-client >= 6.0.0 %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 Version: 2.0.0 @@ -107,7 +142,8 @@ Requires: cloud-regionsrv-client >= 6.0.0 Requires: python3-dnspython %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 Version: 1.0.5 @@ -117,22 +153,42 @@ Group: Productivity/Networking/Web/Servers Requires: cloud-regionsrv-client >= 9.0.0 Requires: cloud-regionsrv-client-plugin-azure +BuildArch: noarch + %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 %setup -q %if 0%{?suse_version} == 1315 -%patch0 +%patch -P 0 -p1 +%patch -P 1 -p1 +%patch -P 2 -p1 + +# %patch macro does not support to call patch such that it +# does not create .orig files. Under certain conditions patch +# creates them and this will break the build for files found +# but not packaged +find . -name *.orig -delete + %endif %build -python3 setup.py build +%if 0%{?suse_version} >= 1600 +%pyproject_wheel +%else +%{pythons} setup.py build +%endif %install cp -r etc %{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 mkdir -p %{buildroot}/usr/lib/regionService/certs # The directory for the cache data @@ -141,6 +197,11 @@ install -d -m 755 %{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.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/* %pre @@ -188,7 +249,9 @@ fi %{_mandir}/man*/* # Do not expect the user that needs containers to have root access # on the system +%if 0%{?suse_version} > 1315 %{_bindir}/cloudguestregistryauth +%endif %{_sbindir}/cloudguest-repo-service %{_sbindir}/containerbuild-regionsrv %{_sbindir}/createregioninfo @@ -196,15 +259,22 @@ fi %{_sbindir}/registercloudguest %{_sbindir}/updatesmtcache %{_usr}/lib/zypp/plugins/urlresolver/susecloud -%{python3_sitelib}/cloudregister/__* -%{python3_sitelib}/cloudregister/reg* -%{python3_sitelib}/cloudregister/smt* -%{python3_sitelib}/cloudregister/VERSION +%if 0%{?suse_version} > 1315 +%config %{_sysconfdir}/sudoers.d/* +%endif %{_unitdir}/guestregister.service %{_unitdir}/containerbuild-regionsrv.service -%dir %{python3_sitelib}/cloudregister-%{base_version}-py%{py3_ver}.egg-info -%dir %{python3_sitelib}/cloudregister/ -%{python3_sitelib}/cloudregister-%{base_version}-py%{py3_ver}.egg-info/* +%exclude %{_sitelibdir}/cloudregister/google* +%exclude %{_sitelibdir}/cloudregister/amazon* +%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 %defattr(-,root,root,-) @@ -215,15 +285,15 @@ fi %files plugin-gce %defattr(-,root,root,-) -%{python3_sitelib}/cloudregister/google* +%{_sitelibdir}/cloudregister/google* %files plugin-ec2 %defattr(-,root,root,-) -%{python3_sitelib}/cloudregister/amazon* +%{_sitelibdir}/cloudregister/amazon* %files plugin-azure %defattr(-,root,root,-) -%{python3_sitelib}/cloudregister/msft* +%{_sitelibdir}/cloudregister/msft* %files addon-azure %defattr(-,root,root,-) diff --git a/fix-for-sles12-disable-ipv6.patch b/fix-for-sles12-disable-ipv6.patch index 397fd86..9ae3d26 100644 --- a/fix-for-sles12-disable-ipv6.patch +++ b/fix-for-sles12-disable-ipv6.patch @@ -1,6 +1,8 @@ ---- lib/cloudregister/smt.py.orig -+++ lib/cloudregister/smt.py -@@ -109,6 +109,7 @@ class SMT: +diff --git a/lib/cloudregister/smt.py b/lib/cloudregister/smt.py +index 62c461a..19c7ebd 100644 +--- a/lib/cloudregister/smt.py ++++ b/lib/cloudregister/smt.py +@@ -128,6 +128,7 @@ class SMT: # -------------------------------------------------------------------- def get_ipv6(self): """Return the IP address""" diff --git a/fix-for-sles12-disable-registry.patch b/fix-for-sles12-disable-registry.patch new file mode 100644 index 0000000..f795831 --- /dev/null +++ b/fix-for-sles12-disable-registry.patch @@ -0,0 +1,72 @@ +diff --git a/lib/cloudregister/registerutils.py b/lib/cloudregister/registerutils.py +index 7825ff0..5a712b0 100644 +--- a/lib/cloudregister/registerutils.py ++++ b/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_registry_fqdn): + # ---------------------------------------------------------------------------- + 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: +diff --git a/usr/sbin/registercloudguest b/usr/sbin/registercloudguest +index d32f036..c5f40d3 100755 +--- a/usr/sbin/registercloudguest ++++ b/usr/sbin/registercloudguest +@@ -139,6 +139,8 @@ def setup_registry(registration_target, clean='registry'): + 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) + ) diff --git a/fix-for-sles12-no-trans_update.patch b/fix-for-sles12-no-trans_update.patch new file mode 100644 index 0000000..0b0912d --- /dev/null +++ b/fix-for-sles12-no-trans_update.patch @@ -0,0 +1,13 @@ +diff --git a/lib/cloudregister/registerutils.py b/lib/cloudregister/registerutils.py +index 7825ff0..6770e23 100644 +--- a/lib/cloudregister/registerutils.py ++++ b/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/']: