Skip to content

Commit

Permalink
Revert "Fix secret race condition"
Browse files Browse the repository at this point in the history
This reverts commit 18e382a.
  • Loading branch information
TheBigLee committed Oct 24, 2024
1 parent 18e382a commit c464cc0
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions pkg/crossplane/service_mariadb_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/types"
"k8s.io/utils/ptr"
"k8s.io/utils/pointer"
"sigs.k8s.io/controller-runtime/pkg/client"
)

Expand Down Expand Up @@ -155,14 +155,14 @@ func (msb MariadbDatabaseServiceBinder) markCredentialsForDeletion(ctx context.C
}

ref := metav1.OwnerReference{
APIVersion: "v1",
Kind: "Secret",
Name: secret.GetName(),
UID: secret.GetUID(),
BlockOwnerDeletion: ptr.To(true),
}
user.SetOwnerReferences([]metav1.OwnerReference{ref})
return msb.cp.client.Update(ctx, user)
APIVersion: user.GetAPIVersion(),
Kind: user.GetKind(),
Name: user.GetName(),
UID: user.GetUID(),
BlockOwnerDeletion: pointer.BoolPtr(true),
}
secret.SetOwnerReferences([]metav1.OwnerReference{ref})
return msb.cp.client.Update(ctx, secret)
}

// Deprovisionable always returns nil for MariadbDatabase instances.
Expand Down

0 comments on commit c464cc0

Please sign in to comment.