diff --git a/staging/src/k8s.io/cloud-provider/controllers/service/controller.go b/staging/src/k8s.io/cloud-provider/controllers/service/controller.go index 0a403c9fae9..984fe74cbfe 100644 --- a/staging/src/k8s.io/cloud-provider/controllers/service/controller.go +++ b/staging/src/k8s.io/cloud-provider/controllers/service/controller.go @@ -887,7 +887,10 @@ func (s *Controller) syncService(ctx context.Context, key string) error { case err != nil: runtime.HandleError(fmt.Errorf("Unable to retrieve service %v from store: %v", key, err)) default: - err = s.processServiceCreateOrUpdate(ctx, service, key) + // It is not safe to modify an object returned from an informer. + // As reconcilers may modify the service object we need to copy + // it first. + err = s.processServiceCreateOrUpdate(ctx, service.DeepCopy(), key) } return err