diff --git a/config/crd/multicluster.x-k8s.io_serviceimports.yaml b/config/crd/multicluster.x-k8s.io_serviceimports.yaml index c3a1220..b405a72 100644 --- a/config/crd/multicluster.x-k8s.io_serviceimports.yaml +++ b/config/crd/multicluster.x-k8s.io_serviceimports.yaml @@ -72,6 +72,15 @@ spec: - ports - type properties: + ipFamilies: + description: IPFamilies identifies all the IPFamilies assigned for this ServiceImport. + type: array + maxItems: 2 + 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 8810a63..4429664 100644 --- a/pkg/apis/v1alpha1/serviceimport.go +++ b/pkg/apis/v1alpha1/serviceimport.go @@ -84,6 +84,10 @@ type ServiceImportSpec struct { // sessionAffinityConfig contains session affinity configuration. // +optional SessionAffinityConfig *v1.SessionAffinityConfig `json:"sessionAffinityConfig,omitempty"` + // IPFamilies identifies all the IPFamilies assigned for this ServiceImport. + // +kubebuilder:validation:MaxItems:=2 + // +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 7218123..1922458 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.