#48 Backport rawhide to f40
Merged 2 months ago by mhayden. Opened 2 months ago by mhayden.

@@ -1,114 +0,0 @@ 

- From 02d0c4852feddb0715cb515e5e552351df3d9e5f Mon Sep 17 00:00:00 2001

- From: Major Hayden <major@redhat.com>

- Date: Tue, 28 Mar 2023 17:16:41 -0500

- Subject: [PATCH] ec2: Do not enable dhcp6 on EC2

- 

- When cloud-init finds any ipv6 information in the instance metadata, it

- automatically enables dhcp6 for the network interface. However, this

- brings up the instance with a broken IPv6 configuration because SLAAC

- should be used for almost all situations on EC2.

- 

- Red Hat BZ: https://bugzilla.redhat.com/show_bug.cgi?id=2092459

- Fedora Pagure: https://pagure.io/cloud-sig/issue/382

- Upstream: https://bugs.launchpad.net/cloud-init/+bug/1976526

- 

- Signed-off-by: Major Hayden <major@redhat.com>

- ---

-  cloudinit/sources/DataSourceEc2.py  |  5 -----

-  tests/unittests/sources/test_ec2.py | 15 +++++++--------

-  2 files changed, 7 insertions(+), 13 deletions(-)

- 

- diff --git a/cloudinit/sources/DataSourceEc2.py b/cloudinit/sources/DataSourceEc2.py

- index 44665b26..b78b3e99 100644

- --- a/cloudinit/sources/DataSourceEc2.py

- +++ b/cloudinit/sources/DataSourceEc2.py

- @@ -921,8 +921,6 @@ def convert_ec2_metadata_network_config(

-              "set-name": nic_name,

-          }

-          nic_metadata = macs_metadata.get(mac)

- -        if nic_metadata.get("ipv6s"):  # Any IPv6 addresses configured

- -            dev_config["dhcp6"] = True

-          netcfg["ethernets"][nic_name] = dev_config

-          return netcfg

-      # Apply network config for all nics and any secondary IPv4/v6 addresses

- @@ -942,9 +940,6 @@ def convert_ec2_metadata_network_config(

-              "match": {"macaddress": mac.lower()},

-              "set-name": nic_name,

-          }

- -        if nic_metadata.get("ipv6s"):  # Any IPv6 addresses configured

- -            dev_config["dhcp6"] = True

- -            dev_config["dhcp6-overrides"] = dhcp_override

-          dev_config["addresses"] = get_secondary_addresses(nic_metadata, mac)

-          if not dev_config["addresses"]:

-              dev_config.pop("addresses")  # Since we found none configured

- diff --git a/tests/unittests/sources/test_ec2.py b/tests/unittests/sources/test_ec2.py

- index 3fe525e3..9721cab2 100644

- --- a/tests/unittests/sources/test_ec2.py

- +++ b/tests/unittests/sources/test_ec2.py

- @@ -432,7 +432,7 @@ class TestEc2(test_helpers.ResponsesTestCase):

-                      "match": {"macaddress": "06:17:04:d7:26:09"},

-                      "set-name": "eth9",

-                      "dhcp4": True,

- -                    "dhcp6": True,

- +                    "dhcp6": False,

-                  }

-              },

-          }

- @@ -513,7 +513,7 @@ class TestEc2(test_helpers.ResponsesTestCase):

-                          "2600:1f16:292:100:f153:12a3:c37c:11f9/128",

-                      ],

-                      "dhcp4": True,

- -                    "dhcp6": True,

- +                    "dhcp6": False,

-                  }

-              },

-          }

- @@ -593,7 +593,7 @@ class TestEc2(test_helpers.ResponsesTestCase):

-                      "match": {"macaddress": mac1},

-                      "set-name": "eth9",

-                      "dhcp4": True,

- -                    "dhcp6": True,

- +                    "dhcp6": False,

-                  }

-              },

-          }

- @@ -1000,7 +1000,7 @@ class TestConvertEc2MetadataNetworkConfig(test_helpers.CiTestCase):

-                      "match": {"macaddress": self.mac1},

-                      "set-name": "eth9",

-                      "dhcp4": True,

- -                    "dhcp6": True,

- +                    "dhcp6": False,

-                  }

-              },

-          }

- @@ -1077,7 +1077,7 @@ class TestConvertEc2MetadataNetworkConfig(test_helpers.CiTestCase):

-                      "match": {"macaddress": self.mac1},

-                      "set-name": "eth9",

-                      "dhcp4": True,

- -                    "dhcp6": True,

- +                    "dhcp6": False,

-                  }

-              },

-          }

- @@ -1107,8 +1107,7 @@ class TestConvertEc2MetadataNetworkConfig(test_helpers.CiTestCase):

-                      "set-name": "eth9",

-                      "dhcp4": True,

-                      "dhcp4-overrides": {"route-metric": 100},

- -                    "dhcp6": True,

- -                    "dhcp6-overrides": {"route-metric": 100},

- +                    "dhcp6": False,

-                  },

-                  "eth10": {

-                      "match": {"macaddress": mac2},

- @@ -1139,7 +1138,7 @@ class TestConvertEc2MetadataNetworkConfig(test_helpers.CiTestCase):

-                      "match": {"macaddress": self.mac1},

-                      "set-name": "eth9",

-                      "dhcp4": True,

- -                    "dhcp6": True,

- +                    "dhcp6": False,

-                  }

-              },

-          }

- -- 

- 2.39.2

- 

file modified
+2 -12
@@ -5,7 +5,7 @@ 

  %endif

  

  Name:           cloud-init

- Version:        23.4.4

+ Version:        24.1.4

  Release:        %autorelease

  Summary:        Cloud instance init scripts

  License:        Apache-2.0 OR GPL-3.0-only
@@ -14,10 +14,6 @@ 

  Source0:        %{url}/archive/%{version}/%{name}-%{version}.tar.gz

  Source1:        cloud-init-tmpfiles.conf

  

- # Enabling dhcp6 on EC2 causes a broken IPv6 configuration.

- # See RHBZ 2092459.

- Patch0:         Do-not-enable-dhcp6-on-EC2.patch

- 

  BuildArch:      noarch

  

  BuildRequires:  systemd-rpm-macros
@@ -37,12 +33,7 @@ 

  BuildRequires:  python3dist(passlib)

  %endif

  

- # ISC DHCP is no longer maintained and cloud-init will ship a 

- # release with dhcpcd support soon. See BZ 2247055 for details.

- #

- # Cloud-init dhcpcd support is pending a release here:

- # https://github.com/canonical/cloud-init/pull/4746/files

- Requires:       dhcp-client

+ Requires:       dhcpcd

  

  Requires:       hostname

  Requires:       e2fsprogs
@@ -142,7 +133,6 @@ 

  %license LICENSE LICENSE-Apache2.0 LICENSE-GPLv3

  %doc ChangeLog

  %doc doc/*

- %doc %{_sysconfdir}/cloud/clean.d/README

  %{_mandir}/man1/*

  %config(noreplace) %{_sysconfdir}/cloud/cloud.cfg

  %dir               %{_sysconfdir}/cloud/cloud.cfg.d

file modified
+1 -1
@@ -1,1 +1,1 @@ 

- SHA512 (cloud-init-23.4.4.tar.gz) = 37b51da4e9df627f0590f3ac70e0ce70bd727a6ca5a58e1f905713bcca0c7215afc5a52584df2304149dc4e980fb85d396af4e3ea7fded16dc4b0b1baac6c2bc

+ SHA512 (cloud-init-24.1.4.tar.gz) = 374a5a10895f4f850457f3015687fb2c5b605841658b819244139fadf0075cd818cfdec5aeb8d0ca9ddbfa40de3b5070d2c4ffd0f6bcc306349b0db70edee2c7

no initial comment

Build succeeded.
https://fedora.softwarefactory-project.io/zuul/buildset/6a3cfd9b67554b60816246fddc9a2e1d

Pull-Request has been merged by mhayden

2 months ago