@@ -23,6 +23,7 @@ import (
2323
2424 "github.com/cilium/cilium/pkg/annotation"
2525 "github.com/cilium/cilium/pkg/clustermesh/common"
26+ mcsapitypes "github.com/cilium/cilium/pkg/clustermesh/mcsapi/types"
2627 "github.com/cilium/cilium/pkg/clustermesh/store"
2728 "github.com/cilium/cilium/pkg/k8s"
2829 "github.com/cilium/cilium/pkg/k8s/resource"
@@ -171,6 +172,13 @@ func (i *meshServiceInformer) clusterSvcToSvc(clusterSvc *store.ClusterService,
171172 mcsapiv1alpha1 .LabelSourceCluster : clusterSvc .Cluster ,
172173 })
173174
175+ // Use the internal supported IP families annotation from our MCS-API implementation if present
176+ valIPFamilies , ok := svc .Annotations [annotation .SupportedIPFamilies ]
177+ ipFamilies , err := mcsapitypes .IPFamiliesFromString (valIPFamilies )
178+ if ! ok || err != nil {
179+ ipFamilies = toKubeIpFamilies (svc .Spec .IPFamilies )
180+ }
181+
174182 return & v1.Service {
175183 ObjectMeta : metav1.ObjectMeta {
176184 Name : clusterSvc .Name + "-" + clusterSvc .Cluster ,
@@ -187,7 +195,7 @@ func (i *meshServiceInformer) clusterSvcToSvc(clusterSvc *store.ClusterService,
187195 ClusterIP : svc .Spec .ClusterIP ,
188196 ClusterIPs : svc .Spec .ClusterIPs ,
189197 Type : v1 .ServiceType (svc .Spec .Type ),
190- IPFamilies : toKubeIpFamilies ( svc . Spec . IPFamilies ) ,
198+ IPFamilies : ipFamilies ,
191199 },
192200 }, nil
193201}
0 commit comments