func (ssc *FakeServiceControl) UpdateService(_ *v1alpha1.TikvCluster, svc *corev1.Service) (*corev1.Service, error) {
	defer ssc.updateServiceTracker.Inc()
	if ssc.updateServiceTracker.ErrorReady() {
		defer ssc.updateServiceTracker.Reset()
		return nil, ssc.updateServiceTracker.GetError()
	}

	if svc.Spec.Selector != nil {
		eps := &corev1.Endpoints{
			ObjectMeta: metav1.ObjectMeta{
				Name:      svc.Name,
				Namespace: svc.Namespace,
			},
		}
		err := ssc.EpsIndexer.Update(eps)
		if err != nil {
			return nil, err
		}
	}
	return svc, ssc.SvcIndexer.Update(svc)
}
// UpdateService updates the service of SvcIndexer
UpdateService updates the service of SvcIndexer
// UpdateService updates the service of SvcIndexer
func (ssc *FakeServiceControl) UpdateService(_ *v1alpha1.TikvCluster, svc *corev1.Service) (*corev1.Service, error) {
	defer ssc.updateServiceTracker.Inc()
	if ssc.updateServiceTracker.ErrorReady() {
		defer ssc.updateServiceTracker.Reset()
		return nil, ssc.updateServiceTracker.GetError()
	}
	if svc.Spec.Selector != nil {
		eps := &corev1.Endpoints{
			ObjectMeta: metav1.ObjectMeta{
				Name:      svc.Name,
				Namespace: svc.Namespace,
			},
		}
		err := ssc.EpsIndexer.Update(eps)
		if err != nil {
			return nil, err
		}
	}
	return svc, ssc.SvcIndexer.Update(svc)
}
func ( ssc * FakeServiceControl ) UpdateService ( _ * v1alpha1 . TikvCluster , svc * corev1 . Service ) ( * corev1 . Service , error ) { defer ssc . updateServiceTracker . Inc ( ) if ssc . updateServiceTracker . ErrorReady ( ) { defer ssc . updateServiceTracker . Reset ( ) return nil , ssc . updateServiceTracker . GetError ( ) } if svc . Spec . Selector != nil { eps := & corev1 . Endpoints { ObjectMeta : metav1 . ObjectMeta { Name : svc . Name , Namespace : svc . Namespace , } , } err := ssc . EpsIndexer . Update ( eps ) if err != nil { return nil , err } } return svc , ssc . SvcIndexer . Update ( svc ) }
UpdateService updates the service of SvcIndexer
UpdateService updates the service of SvcIndexer