diff --git a/controllers/helmchart_controller.go b/controllers/helmchart_controller.go index 93a79509f..8260a0f0a 100644 --- a/controllers/helmchart_controller.go +++ b/controllers/helmchart_controller.go @@ -61,7 +61,6 @@ import ( sourcev1 "github.com/fluxcd/source-controller/api/v1beta1" "github.com/fluxcd/source-controller/internal/helm" - "github.com/fluxcd/source-controller/internal/util" ) // +kubebuilder:rbac:groups=source.toolkit.fluxcd.io,resources=helmcharts,verbs=get;list;watch;create;update;patch;delete @@ -926,7 +925,7 @@ func (r *HelmChartReconciler) requestsForHelmRepositoryChange(o client.Object) [ // enqueued twice. var reqs []reconcile.Request for _, i := range list.Items { - reqs = append(reqs, reconcile.Request{NamespacedName: util.ObjectKey(&i)}) + reqs = append(reqs, reconcile.Request{NamespacedName: client.ObjectKeyFromObject(&i)}) } return reqs } @@ -955,7 +954,7 @@ func (r *HelmChartReconciler) requestsForGitRepositoryChange(o client.Object) [] // enqueued twice. var reqs []reconcile.Request for _, i := range list.Items { - reqs = append(reqs, reconcile.Request{NamespacedName: util.ObjectKey(&i)}) + reqs = append(reqs, reconcile.Request{NamespacedName: client.ObjectKeyFromObject(&i)}) } return reqs } @@ -984,7 +983,7 @@ func (r *HelmChartReconciler) requestsForBucketChange(o client.Object) []reconci // enqueued twice. var reqs []reconcile.Request for _, i := range list.Items { - reqs = append(reqs, reconcile.Request{NamespacedName: util.ObjectKey(&i)}) + reqs = append(reqs, reconcile.Request{NamespacedName: client.ObjectKeyFromObject(&i)}) } return reqs } diff --git a/internal/util/util.go b/internal/util/util.go deleted file mode 100644 index 4d9e19adf..000000000 --- a/internal/util/util.go +++ /dev/null @@ -1,30 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package util - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "sigs.k8s.io/controller-runtime/pkg/client" -) - -// ObjectKey returns client.ObjectKey for the object. -func ObjectKey(object metav1.Object) client.ObjectKey { - return client.ObjectKey{ - Namespace: object.GetNamespace(), - Name: object.GetName(), - } -}