From 0fb55c01007acdba36aa777593aa54a213301936 Mon Sep 17 00:00:00 2001 From: Ian Gann Date: Thu, 23 Jul 2026 14:23:01 -0700 Subject: [PATCH 1/4] VKAL-40713: add PreExistingVPCNetworkConfigAnnotation constant Add the constant that NamespaceNetworkConfiguration reacts to for adopting a pre-existing VPCNetworkConfiguration named ahead of the NNC, instead of always creating one named after the NNC itself. Needed for brownfield namespaces migrating from the legacy wcpsvc/VCDB path. Bug number: VKAL-40713 AI-Tool-Used: claude AI-Model-Used: claude-sonnet-5 AI-Tool-Use-Level: high AI-Code-Category: production AI-Time-Saved: 1 Testing Done: go build ./... --- api/v1alpha1/namespacenetworkconfiguration_types.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api/v1alpha1/namespacenetworkconfiguration_types.go b/api/v1alpha1/namespacenetworkconfiguration_types.go index a8949d3..658c92c 100644 --- a/api/v1alpha1/namespacenetworkconfiguration_types.go +++ b/api/v1alpha1/namespacenetworkconfiguration_types.go @@ -20,6 +20,14 @@ const ( // resource. NamespaceNetworkProtectionFinalizer = "netoperator.vmware.com/nnc-protection" + // PreExistingVPCNetworkConfigAnnotation, when set on a + // NamespaceNetworkConfiguration, names a pre-existing VPCNetworkConfiguration + // for net-operator's VPC reconciler to adopt in place of the CR it would + // otherwise auto-create (named after this resource). This supports brownfield + // namespaces whose VPCNetworkConfiguration was provisioned before adoption by + // this NamespaceNetworkConfiguration. + PreExistingVPCNetworkConfigAnnotation = "netoperator.vmware.com/vpc-network-configuration" + // NamespaceNetworkConditionReady is True when all networking resources owned // by the NamespaceNetworkConfiguration have been created and every associated // Namespace has been fully reconciled. When no Namespaces are associated, From 6b0c0f9d45011641ade7bdad2703d0c042d023e1 Mon Sep 17 00:00:00 2001 From: Ian Gann Date: Mon, 3 Aug 2026 10:03:35 -0700 Subject: [PATCH 2/4] Update godoc for PreExistingVPCNetworkConfigAnnotation --- api/v1alpha1/namespacenetworkconfiguration_types.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/api/v1alpha1/namespacenetworkconfiguration_types.go b/api/v1alpha1/namespacenetworkconfiguration_types.go index 658c92c..db0dfc0 100644 --- a/api/v1alpha1/namespacenetworkconfiguration_types.go +++ b/api/v1alpha1/namespacenetworkconfiguration_types.go @@ -21,11 +21,13 @@ const ( NamespaceNetworkProtectionFinalizer = "netoperator.vmware.com/nnc-protection" // PreExistingVPCNetworkConfigAnnotation, when set on a - // NamespaceNetworkConfiguration, names a pre-existing VPCNetworkConfiguration - // for net-operator's VPC reconciler to adopt in place of the CR it would - // otherwise auto-create (named after this resource). This supports brownfield - // namespaces whose VPCNetworkConfiguration was provisioned before adoption by - // this NamespaceNetworkConfiguration. + // NamespaceNetworkConfiguration at creation time, names a pre-existing + // VPCNetworkConfiguration for the VPC reconciler to adopt (1:1) instead of + // auto-creating one named after this resource. This supports brownfield + // namespaces provisioned before adoption by this NamespaceNetworkConfiguration. + // + // Immutable once set and must not collide with another + // NamespaceNetworkConfiguration's mapping. PreExistingVPCNetworkConfigAnnotation = "netoperator.vmware.com/vpc-network-configuration" // NamespaceNetworkConditionReady is True when all networking resources owned From 53366a1cf48c835bc946ed83939cda70deb5c9a3 Mon Sep 17 00:00:00 2001 From: Ian Gann Date: Fri, 14 Aug 2026 13:21:30 -0700 Subject: [PATCH 3/4] VKAL-41389: add PreExistingNSXNetworkConfigAnnotation constant Mirrors PreExistingVPCNetworkConfigAnnotation (VKAL-40713) for the NSXTier1/NCP provider so an NNC can adopt a pre-existing NSXNetworkConfiguration CR instead of auto-creating one. --- api/v1alpha1/namespacenetworkconfiguration_types.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/api/v1alpha1/namespacenetworkconfiguration_types.go b/api/v1alpha1/namespacenetworkconfiguration_types.go index db0dfc0..d2471ad 100644 --- a/api/v1alpha1/namespacenetworkconfiguration_types.go +++ b/api/v1alpha1/namespacenetworkconfiguration_types.go @@ -30,6 +30,16 @@ const ( // NamespaceNetworkConfiguration's mapping. PreExistingVPCNetworkConfigAnnotation = "netoperator.vmware.com/vpc-network-configuration" + // PreExistingNSXNetworkConfigAnnotation, when set on a + // NamespaceNetworkConfiguration at creation time, names a pre-existing + // NSXNetworkConfiguration for the tier1 reconciler to adopt (1:1) instead of + // auto-creating one named after this resource. This supports brownfield + // namespaces provisioned before adoption by this NamespaceNetworkConfiguration. + // + // Immutable once set and must not collide with another + // NamespaceNetworkConfiguration's mapping. + PreExistingNSXNetworkConfigAnnotation = "netoperator.vmware.com/nsx-network-configuration" + // NamespaceNetworkConditionReady is True when all networking resources owned // by the NamespaceNetworkConfiguration have been created and every associated // Namespace has been fully reconciled. When no Namespaces are associated, From f1bcaa1ef1264cb1e9f876c66743a9dbb4b352b5 Mon Sep 17 00:00:00 2001 From: Ian Gann Date: Fri, 14 Aug 2026 14:59:17 -0700 Subject: [PATCH 4/4] Minor text fix --- api/v1alpha1/namespacenetworkconfiguration_types.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/v1alpha1/namespacenetworkconfiguration_types.go b/api/v1alpha1/namespacenetworkconfiguration_types.go index d2471ad..11be659 100644 --- a/api/v1alpha1/namespacenetworkconfiguration_types.go +++ b/api/v1alpha1/namespacenetworkconfiguration_types.go @@ -32,7 +32,7 @@ const ( // PreExistingNSXNetworkConfigAnnotation, when set on a // NamespaceNetworkConfiguration at creation time, names a pre-existing - // NSXNetworkConfiguration for the tier1 reconciler to adopt (1:1) instead of + // NSXNetworkConfiguration for the reconciler to adopt (1:1) instead of // auto-creating one named after this resource. This supports brownfield // namespaces provisioned before adoption by this NamespaceNetworkConfiguration. //