func ServiceEqual(newSvc, oldSvc *corev1.Service) (bool, error) {
	oldSpec := corev1.ServiceSpec{}
	if lastAppliedConfig, ok := oldSvc.Annotations[LastAppliedConfigAnnotation]; ok {
		err := json.Unmarshal([]byte(lastAppliedConfig), &oldSpec)
		if err != nil {
			klog.Errorf("unmarshal ServiceSpec: [%s/%s]'s applied config failed,error: %v", oldSvc.GetNamespace(), oldSvc.GetName(), err)
			return false, err
		}
		return apiequality.Semantic.DeepEqual(oldSpec, newSvc.Spec), nil
	}
	return false, nil
}
// ServiceEqual compares the new Service's spec with old Service's last applied config
ServiceEqual compares the new Service's spec with old Service's last applied config
// ServiceEqual compares the new Service ' s spec with old Service ' s last applied config
func ServiceEqual(newSvc, oldSvc *corev1.Service) (bool, error) {
	oldSpec := corev1.ServiceSpec{}
	if lastAppliedConfig, ok := oldSvc.Annotations[LastAppliedConfigAnnotation]; ok {
		err := json.Unmarshal([]byte(lastAppliedConfig), &oldSpec)
		if err != nil {
			klog.Errorf("unmarshal ServiceSpec: [%s/%s]'s applied config failed,error: %v", oldSvc.GetNamespace(), oldSvc.GetName(), err)
			return false, err
		}
		return apiequality.Semantic.DeepEqual(oldSpec, newSvc.Spec), nil
	}
	return false, nil
}
func ServiceEqual ( newSvc , oldSvc * corev1 . Service ) ( bool , error ) { oldSpec := corev1 . ServiceSpec { } if lastAppliedConfig , ok := oldSvc . Annotations [ LastAppliedConfigAnnotation ] ; ok { err := json . Unmarshal ( [ ] byte ( lastAppliedConfig ) , & oldSpec ) if err != nil { klog . Errorf ( " " , oldSvc . GetNamespace ( ) , oldSvc . GetName ( ) , err ) return false , err } return apiequality . Semantic . DeepEqual ( oldSpec , newSvc . Spec ) , nil } return false , nil }
ServiceEqual compares the new Service's spec with old Service's last applied config
ServiceEqual compares the new Service ' s spec with old Service ' s last applied config