func (t *tke) ApplyTo(annotations map[string]string, svc *v1.Service) error {

	klog.Infof("before update annotations: %v, service annotations: %v", annotations, svc.Annotations)

	svc.Spec.Type = v1.ServiceTypeLoadBalancer
	if _, ok := annotations[AnnotationLoadBalancerInternalSubnetID]; ok {
		if svc.Annotations == nil {
			svc.Annotations = make(map[string]string)
		}
		svc.Annotations[AnnotationLoadBalancerInternalSubnetID] = annotations[AnnotationLoadBalancerInternalSubnetID]
	} else {
		delete(svc.Annotations, AnnotationLoadBalancerInternalSubnetID)
	}
	klog.Infof("after update annotations: %v, service annotations: %v", annotations, svc.Annotations)

	return nil
}
// ApplyTo apply the configuration in annotations to the service
ApplyTo apply the configuration in annotations to the service
// ApplyTo apply the configuration in annotations to the service
func (t *tke) ApplyTo(annotations map[string]string, svc *v1.Service) error {
	klog.Infof("before update annotations: %v, service annotations: %v", annotations, svc.Annotations)
	svc.Spec.Type = v1.ServiceTypeLoadBalancer
	if _, ok := annotations[AnnotationLoadBalancerInternalSubnetID]; ok {
		if svc.Annotations == nil {
			svc.Annotations = make(map[string]string)
		}
		svc.Annotations[AnnotationLoadBalancerInternalSubnetID] = annotations[AnnotationLoadBalancerInternalSubnetID]
	} else {
		delete(svc.Annotations, AnnotationLoadBalancerInternalSubnetID)
	}
	klog.Infof("after update annotations: %v, service annotations: %v", annotations, svc.Annotations)
	return nil
}
func ( t * tke ) ApplyTo ( annotations map [ string ] string , svc * v1 . Service ) error { klog . Infof ( " " , annotations , svc . Annotations ) svc . Spec . Type = v1 . ServiceTypeLoadBalancer if _ , ok := annotations [ AnnotationLoadBalancerInternalSubnetID ] ; ok { if svc . Annotations == nil { svc . Annotations = make ( map [ string ] string ) } svc . Annotations [ AnnotationLoadBalancerInternalSubnetID ] = annotations [ AnnotationLoadBalancerInternalSubnetID ] } else { delete ( svc . Annotations , AnnotationLoadBalancerInternalSubnetID ) } klog . Infof ( " " , annotations , svc . Annotations ) return nil }
ApplyTo apply the configuration in annotations to the service
ApplyTo apply the configuration in annotations to the service