Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Mattia Lavacca <[email protected]>
  • Loading branch information
pmalek and mlavacca authored Jul 9, 2024
1 parent 6aaa4e7 commit 452a689
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions controller/controlplane/controller_reconciler_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,9 @@ func (r *Reconciler) ensureClusterRole(
cp *operatorv1beta1.ControlPlane,
) (createdOrUpdated bool, cr *rbacv1.ClusterRole, err error) {
// TODO: This performs a migration from the old managedBy label to the new one.
// After several versions of soak time we can remove handling the legeacy label set.
// After several versions of soak time we can remove handling the legacy label set.
// PR that introduced the new set of labels: https://github.com/Kong/gateway-operator/pull/259
// PR: that introduced the migration: https://github.com/Kong/gateway-operator/pull/369
// PR that introduced the migration: https://github.com/Kong/gateway-operator/pull/369
clusterRolesLegacy, err := k8sutils.ListClusterRoles(
ctx,
r.Client,
Expand Down Expand Up @@ -376,9 +376,9 @@ func (r *Reconciler) ensureClusterRoleBinding(
logger := log.GetLogger(ctx, "controlplane.ensureClusterRoleBinding", r.DevelopmentMode)

// TODO: This performs a migration from the old managedBy label to the new one.
// After several versions of soak time we can remove handling the legeacy label set.
// After several versions of soak time we can remove handling the legacy label set.
// PR that introduced the new set of labels: https://github.com/Kong/gateway-operator/pull/259
// PR: that introduced the migration: https://github.com/Kong/gateway-operator/pull/369
// PR that introduced the migration: https://github.com/Kong/gateway-operator/pull/369
clusterRoleBindingsLegacy, err := k8sutils.ListClusterRoleBindings(
ctx,
r.Client,
Expand Down Expand Up @@ -767,9 +767,9 @@ func (r *Reconciler) ensureValidatingWebhookConfiguration(
logger := log.GetLogger(ctx, "controlplane.ensureValidatingWebhookConfiguration", r.DevelopmentMode)

// TODO: This performs a migration from the old managedBy label to the new one.
// After several versions of soak time we can remove handling the legeacy label set.
// After several versions of soak time we can remove handling the legacy label set.
// PR that introduced the new set of labels: https://github.com/Kong/gateway-operator/pull/259
// PR: that introduced the migration: https://github.com/Kong/gateway-operator/pull/369
// PR that introduced the migration: https://github.com/Kong/gateway-operator/pull/369
validatingWebhookConfigurationsLegacy, err := k8sutils.ListValidatingWebhookConfigurationsForOwner(
ctx,
r.Client,
Expand Down
4 changes: 2 additions & 2 deletions controller/controlplane/controller_watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ func (r *Reconciler) getControlPlaneRequestFromManagedByNameLabel(ctx context.Co

// objectIsOwnedByControlPlane checks if the object is owned by the control plane.
//
// NOTE: We are using the managed-by-name label to identify the owner of the resource
// NOTE: We are using the managed-by-name label to identify the owner of the resource.
// To keep backward compatibility, we also check the owner reference which
// are not used anymore for cluster-scoped resources since that's considered
// is not used anymore for cluster-scoped resources since that's considered
// an error.
func objectIsOwnedByControlPlane(obj client.Object, cp *operatorv1beta1.ControlPlane) bool {
if k8sutils.IsOwnedByRefUID(obj, cp.GetUID()) {
Expand Down

0 comments on commit 452a689

Please sign in to comment.