From 940fa5dd9730fc9bd6a2bc8ec5fd56808f9e904c Mon Sep 17 00:00:00 2001 From: Arthur Outhenin-Chalandre Date: Wed, 21 May 2025 16:08:13 +0200 Subject: [PATCH] apis: add ipFamilies field Signed-off-by: Arthur Outhenin-Chalandre --- config/crd/multicluster.x-k8s.io_serviceimports.yaml | 8 ++++++++ pkg/apis/v1alpha1/serviceimport.go | 3 +++ pkg/apis/v1alpha1/zz_generated.deepcopy.go | 5 +++++ 3 files changed, 16 insertions(+) diff --git a/config/crd/multicluster.x-k8s.io_serviceimports.yaml b/config/crd/multicluster.x-k8s.io_serviceimports.yaml index 4bb744a..1c9aecf 100644 --- a/config/crd/multicluster.x-k8s.io_serviceimports.yaml +++ b/config/crd/multicluster.x-k8s.io_serviceimports.yaml @@ -71,6 +71,14 @@ spec: - ports - type properties: + ipFamilies: + description: IPFamilies identifies all the IPFamilies assigned for this ServiceImport. + type: array + items: + description: |- + IPFamily represents the IP Family (IPv4 or IPv6). This type is used + to express the family of an IP expressed by a type (e.g. service.spec.ipFamilies). + type: string ips: description: ip will be used as the VIP for this service when type is ClusterSetIP. type: array diff --git a/pkg/apis/v1alpha1/serviceimport.go b/pkg/apis/v1alpha1/serviceimport.go index 813cc7a..09b44dc 100644 --- a/pkg/apis/v1alpha1/serviceimport.go +++ b/pkg/apis/v1alpha1/serviceimport.go @@ -71,6 +71,9 @@ type ServiceImportSpec struct { // sessionAffinityConfig contains session affinity configuration. // +optional SessionAffinityConfig *v1.SessionAffinityConfig `json:"sessionAffinityConfig,omitempty"` + // IPFamilies identifies all the IPFamilies assigned for this ServiceImport. + // +optional + IPFamilies []v1.IPFamily `json:"ipFamilies,omitempty"` } // ServicePort represents the port on which the service is exposed diff --git a/pkg/apis/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/v1alpha1/zz_generated.deepcopy.go index 4e6fd4d..6b923b4 100644 --- a/pkg/apis/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/v1alpha1/zz_generated.deepcopy.go @@ -230,6 +230,11 @@ func (in *ServiceImportSpec) DeepCopyInto(out *ServiceImportSpec) { *out = new(corev1.SessionAffinityConfig) (*in).DeepCopyInto(*out) } + if in.IPFamilies != nil { + in, out := &in.IPFamilies, &out.IPFamilies + *out = make([]corev1.IPFamily, len(*in)) + copy(*out, *in) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceImportSpec.