Skip to content

Commit

Permalink
fix(token/upsertControllerRef): check for controlling ownership of th…
Browse files Browse the repository at this point in the history
…e current ownerRef
  • Loading branch information
cannonpalms committed Nov 27, 2023
1 parent 0ec58e8 commit 798eecb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/token/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func upsertControllerRef(controllee client.Object, controller client.Object) {
var controllerRefUpdated bool
for _, ownerRef := range controllee.GetOwnerReferences() {
// Identify and replace the controlling owner reference
if metav1.IsControlledBy(controllee, controller) {
if ownerRef.Controller != nil && *ownerRef.Controller {
updatedOwnerReferences = append(updatedOwnerReferences, *newControllerRef)
controllerRefUpdated = true
} else {
Expand Down

0 comments on commit 798eecb

Please sign in to comment.