Skip to content

Commit 90a5894

Browse files
MrFreezeexgiorio94
authored andcommitted
clustermesh: use supported ip families annotation in epslicesync
Signed-off-by: Arthur Outhenin-Chalandre <git@mrfreezeex.fr>
1 parent 4e776ed commit 90a5894

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

pkg/clustermesh/endpointslicesync/service_informer.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)