Skip to content

Commit

Permalink
do not try to set ownerreference if secret not exists
Browse files Browse the repository at this point in the history
  • Loading branch information
johannes94 committed Jan 25, 2024
1 parent 7dab047 commit bbae6a3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fleetshard/pkg/central/reconciler/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,10 @@ func (r *CentralReconciler) encryptSecrets(secrets map[string]*corev1.Secret) (m
func (r *CentralReconciler) ensureCentralTLSSecretHasOwnerReference(ctx context.Context, remoteCentral *private.ManagedCentral, central *v1alpha1.Central) error {
secret, err := r.getSecret(remoteCentral.Metadata.Namespace, k8s.CentralTLSSecretName)
if err != nil {
if apiErrors.IsNotFound(err) {
// no need to ensure correct owner reference if the secret doesn't exist
return nil
}
return err
}

Expand Down

0 comments on commit bbae6a3

Please sign in to comment.