You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
func MatchExistingSvc(de *danmv1.DanmEp, servicesList []*corev1.Service) []*corev1.Service {
deNs := de.Namespace
var svcList []*corev1.Service
for _, svc := range servicesList {
annotations := svc.GetAnnotations()
selectorMap, svcNets, err := GetDanmSvcAnnotations(annotations)
if err != nil {
return svcList
}
if len(selectorMap) == 0 || !isDepSelectedBySvc(de, svcNets) || svc.GetNamespace() != deNs {
continue
}
deMap := de.GetLabels()
deFit := IsContain(deMap, selectorMap)
if !deFit {
continue
}
svcList = append(svcList, svc.DeepCopy())
}
return svcList
}
if GetDanmSvcAnnotations() return with error code, if the K8s service with wrong format of DANM service exist, then will cause some K8s endpoint can't be update/modified, What you expected to happen:
i think the code should be:
by the way:
my service YAML file with below Annotations: danm.k8s.io/selector: '{ "nwservice": "l1-nwmgmtservice" }'
svcwatcher will ouput these error log: utils.go:44] utils: json error: invalid character 'f' after object key:value pair
and DANM can't update K8s endpoint with selected IP.
but if use below Annotations: danm.k8s.io/selector: '{"nwservice":"l1-nwmgmtservice"}'
everything is OK.
The text was updated successfully, but these errors were encountered:
Is this a BUG REPORT or FEATURE REQUEST?:
bug
What happened:
if GetDanmSvcAnnotations() return with error code, if the K8s service with wrong format of DANM service exist, then will cause some K8s endpoint can't be update/modified,
What you expected to happen:
i think the code should be:
by the way:
my service YAML file with below Annotations:
danm.k8s.io/selector: '{ "nwservice": "l1-nwmgmtservice" }'
svcwatcher will ouput these error log:
utils.go:44] utils: json error: invalid character 'f' after object key:value pair
and DANM can't update K8s endpoint with selected IP.
but if use below Annotations:
danm.k8s.io/selector: '{"nwservice":"l1-nwmgmtservice"}'
everything is OK.
The text was updated successfully, but these errors were encountered: