Skip to content

Commit

Permalink
Merge pull request #305 from darkowlzz/rm-util-objectkey
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddeco committed Aug 1, 2021
2 parents 5e38727 + 91eb550 commit 8ffa994
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
4 changes: 2 additions & 2 deletions controllers/helmrelease_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ func (r *HelmReleaseReconciler) requestsForHelmChartChange(o client.Object) []re
ctx := context.Background()
var list v2.HelmReleaseList
if err := r.List(ctx, &list, client.MatchingFields{
v2.SourceIndexKey: util.ObjectKey(hc).String(),
v2.SourceIndexKey: client.ObjectKeyFromObject(hc).String(),
}); err != nil {
return nil
}
Expand All @@ -722,7 +722,7 @@ func (r *HelmReleaseReconciler) requestsForHelmChartChange(o client.Object) []re
if hc.GetArtifact().Revision == i.Status.LastAttemptedRevision {
continue
}
reqs = append(reqs, reconcile.Request{NamespacedName: util.ObjectKey(&i)})
reqs = append(reqs, reconcile.Request{NamespacedName: client.ObjectKeyFromObject(&i)})
}
return reqs
}
Expand Down
10 changes: 0 additions & 10 deletions internal/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import (

"helm.sh/helm/v3/pkg/chartutil"
"helm.sh/helm/v3/pkg/release"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
)

// ValuesChecksum calculates and returns the SHA1 checksum for the
Expand All @@ -43,11 +41,3 @@ func ReleaseRevision(rel *release.Release) int {
}
return rel.Version
}

// ObjectKey returns client.ObjectKey for the object.
func ObjectKey(object metav1.Object) client.ObjectKey {
return client.ObjectKey{
Namespace: object.GetNamespace(),
Name: object.GetName(),
}
}

0 comments on commit 8ffa994

Please sign in to comment.