diff --git a/ci-Pin-pythes-8.0.0.patch b/ci-Pin-pythes-8.0.0.patch new file mode 100644 index 0000000..cdb8413 --- /dev/null +++ b/ci-Pin-pythes-8.0.0.patch @@ -0,0 +1,44 @@ +From 7f3b0ff968409a880596e04aece4e4c504fb9c64 Mon Sep 17 00:00:00 2001 +From: Brett Holman +Date: Mon, 29 Jan 2024 12:03:36 -0700 +Subject: [PATCH] ci: Pin pytest<8.0.0. (#4816) + +The latest pytest release broke some tests in non-obvious ways. Pin +the version for now so that CI passes. + +(cherry picked from commit 7c96c9cd9318e816ce4564b58a2c98271363c447) +Signed-off-by: Ani Sinha +--- + integration-requirements.txt | 2 +- + test-requirements.txt | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/integration-requirements.txt b/integration-requirements.txt +index 1f8b54a5..c0792d63 100644 +--- a/integration-requirements.txt ++++ b/integration-requirements.txt +@@ -7,7 +7,7 @@ pycloudlib>=5.10.0,<1!6 + # test/unittests/conftest.py to be loaded by our integration-tests tox env + # resulting in an unmet dependency issue: + # https://github.com/pytest-dev/pytest/issues/11104 +-pytest!=7.3.2 ++pytest!=7.3.2,<8.0.0 + + packaging + passlib +diff --git a/test-requirements.txt b/test-requirements.txt +index 46a98b4c..3d2480fd 100644 +--- a/test-requirements.txt ++++ b/test-requirements.txt +@@ -4,7 +4,7 @@ + # test/unittests/conftest.py to be loaded by our integration-tests tox env + # resulting in an unmet dependency issue: + # https://github.com/pytest-dev/pytest/issues/11104 +-pytest!=7.3.2 ++pytest!=7.3.2,<8.0.0 + + pytest-cov + pytest-mock +-- +2.39.3 + diff --git a/ci-fix-Add-types-to-network-v1-schema-4841.patch b/ci-fix-Add-types-to-network-v1-schema-4841.patch new file mode 100644 index 0000000..48224c6 --- /dev/null +++ b/ci-fix-Add-types-to-network-v1-schema-4841.patch @@ -0,0 +1,110 @@ +From 2f7f3dc6237ea70825dcb70f71d9718f631a9d95 Mon Sep 17 00:00:00 2001 +From: James Falcon +Date: Tue, 6 Feb 2024 09:24:37 -0600 +Subject: [PATCH] fix: Add types to network v1 schema (#4841) + +RH-Author: Cathy Avery +RH-MergeRequest: 69: fix: Add types to network v1 schema (#4841) +RH-Jira: RHEL-21324 +RH-Acked-by: Ani Sinha +RH-Acked-by: Emanuele Giuseppe Esposito +RH-Commit: [1/1] 59b2b4b07dd9eed956943a22b90af487f18b4cbd (cavery/cloud-init-c-9-s) + +Conflicts: +No log argument as we are not including commit e168b4a1383b6eae9c1dc81411d7684fcbbf7df9 + +Even though it has conflicted with our documentation, we have allowed +nameserver address to a be a string, mtu to be empty, and nameserver +search to be missing. Since we have allowed these, expand our schema +and documentation accordingly. + +Fixes GH-4710 + +(cherry picked from commit b08193b376552ede5d162d8283310adc783d81bf) +Signed-off-by: Cathy Avery +--- + .../config/schemas/schema-network-config-v1.json | 13 +++++++++---- + doc/rtd/reference/network-config-format-v1.rst | 4 ++-- + tests/unittests/config/test_schema.py | 13 +++++++++++++ + 3 files changed, 24 insertions(+), 6 deletions(-) + +diff --git a/cloudinit/config/schemas/schema-network-config-v1.json b/cloudinit/config/schemas/schema-network-config-v1.json +index c77885ec..56dc27c9 100644 +--- a/cloudinit/config/schemas/schema-network-config-v1.json ++++ b/cloudinit/config/schemas/schema-network-config-v1.json +@@ -24,7 +24,10 @@ + "description": "The lowercase MAC address of the physical device." + }, + "mtu": { +- "type": "integer", ++ "type": [ ++ "integer", ++ "null" ++ ], + "description": "The MTU size in bytes. The ``mtu`` key represents a device's Maximum Transmission Unit, which is the largest size packet or frame, specified in octets (eight-bit bytes), that can be sent in a packet- or frame-based network. Specifying ``mtu`` is optional. Values too small or too large for a device may be ignored by that device." + }, + "subnets": { +@@ -384,8 +387,7 @@ + "additionalProperties": false, + "required": [ + "type", +- "address", +- "search" ++ "address" + ], + "properties": { + "type": { +@@ -396,7 +398,10 @@ + }, + "address": { + "description": "List of IPv4 or IPv6 address of nameservers.", +- "type": "array", ++ "type": [ ++ "array", ++ "string" ++ ], + "items": { + "type": "string" + } +diff --git a/doc/rtd/reference/network-config-format-v1.rst b/doc/rtd/reference/network-config-format-v1.rst +index d267eb94..42f2dc22 100644 +--- a/doc/rtd/reference/network-config-format-v1.rst ++++ b/doc/rtd/reference/network-config-format-v1.rst +@@ -252,8 +252,8 @@ Users can specify a ``nameserver`` type. Nameserver dictionaries include + the following keys: + + - ``address``: List of IPv4 or IPv6 address of nameservers. +-- ``search``: List of hostnames to include in the :file:`resolv.conf` search +- path. ++- ``search``: Optional. List of hostnames to include in the :file:`resolv.conf` ++ search path. + - ``interface``: Optional. Ties the nameserver definition to the specified + interface. The value specified here must match the ``name`` of an interface + defined in this config. If unspecified, this nameserver will be considered +diff --git a/tests/unittests/config/test_schema.py b/tests/unittests/config/test_schema.py +index 28f0b39d..52667332 100644 +--- a/tests/unittests/config/test_schema.py ++++ b/tests/unittests/config/test_schema.py +@@ -2048,6 +2048,19 @@ class TestNetworkSchema: + does_not_raise(), + id="bond_with_all_known_properties", + ), ++ pytest.param( ++ { ++ "network": { ++ "version": 1, ++ "config": [ ++ {"type": "physical", "name": "eth0", "mtu": None}, ++ {"type": "nameserver", "address": "8.8.8.8"}, ++ ], ++ } ++ }, ++ does_not_raise(), ++ id="GH-4710_mtu_none_and_str_address", ++ ), + ), + ) + def test_network_schema(self, src_config, expectation): +-- +2.39.3 + diff --git a/cloud-init.spec b/cloud-init.spec index c692a48..7717f68 100644 --- a/cloud-init.spec +++ b/cloud-init.spec @@ -1,6 +1,6 @@ Name: cloud-init Version: 23.4 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Cloud instance init scripts License: ASL 2.0 or GPLv3 URL: http://launchpad.net/cloud-init @@ -18,6 +18,9 @@ Patch7: 0007-test-jsonschema-Pin-jsonschema-version-4781.patch Patch8: 0008-fix-clean-stop-warning-when-running-clean-command-47.patch # For RHEL-22255 - [Azure][RHEL-9] cloud-init-23.4 cannot read "- Azure" datasource_list format Patch9: ci-Revert-Use-grep-for-faster-parsing-of-cloud-config-i.patch +Patch10: ci-Pin-pythes-8.0.0.patch +# For RHEL-21324 - [rhel-9] The schema WARNING info for network-config.json is not suitable in cloud-init-23.4 +Patch11: ci-fix-Add-types-to-network-v1-schema-4841.patch BuildArch: noarch @@ -234,6 +237,11 @@ fi %config(noreplace) %{_sysconfdir}/rsyslog.d/21-cloudinit.conf %changelog +* Mon Feb 26 2024 Miroslav Rezanina - 23.4-6 +- ci-fix-Add-types-to-network-v1-schema-4841.patch [RHEL-21324] +- Resolves: RHEL-21324 + ([rhel-9] The schema WARNING info for network-config.json is not suitable in cloud-init-23.4) + * Mon Feb 19 2024 Miroslav Rezanina - 23.4-5 - ci-Revert-Use-grep-for-faster-parsing-of-cloud-config-i.patch [RHEL-22255] - Resolves: RHEL-22255