From 6e01c874d8a450880d80f5444e4853b23c7c496e Mon Sep 17 00:00:00 2001 From: Maximilian Moehl Date: Wed, 4 Feb 2026 08:38:37 +0100 Subject: [PATCH] feat: record IPv6 address in ActualLRPNetInfo After creating the container, record the chosen IPv6 address alongside the already existing IPv4 address for later use. --- conversion_helpers.go | 2 +- conversion_helpers_test.go | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/conversion_helpers.go b/conversion_helpers.go index 5bae637..98ce5c4 100644 --- a/conversion_helpers.go +++ b/conversion_helpers.go @@ -101,7 +101,7 @@ func ActualLRPNetInfoFromContainer(container executor.Container) (*models.Actual preferredAddress = models.ActualLRPNetInfo_PreferredAddressInstance } - actualLRPNetInfo := models.NewActualLRPNetInfo(container.ExternalIP, container.InternalIP, preferredAddress, ports...) + actualLRPNetInfo := models.NewActualLRPNetInfoWithIPv6(container.ExternalIP, container.InternalIP, container.InternalIPv6, preferredAddress, ports...) err := actualLRPNetInfo.Validate() if err != nil { diff --git a/conversion_helpers_test.go b/conversion_helpers_test.go index d53ff53..83c0e13 100644 --- a/conversion_helpers_test.go +++ b/conversion_helpers_test.go @@ -236,6 +236,17 @@ var _ = Describe("Resources", func() { Expect(*lrpNetInfo).To(Equal(expectedNetInfo)) }) + Context("when the container has an IPv6 address", func() { + BeforeEach(func() { + container.InternalIPv6 = "fd00::1" + }) + + It("includes the IPv6 address in the net info", func() { + Expect(netInfoConversionErr).NotTo(HaveOccurred()) + Expect(lrpNetInfo.InstanceIpv6Address).To(Equal("fd00::1")) + }) + }) + Context("when advertisePreferenceForInstanceAddress set to false", func() { BeforeEach(func() { container.AdvertisePreferenceForInstanceAddress = false