Skip to content

Commit

Permalink
fix: ensure SetControllerReference to certificates
Browse files Browse the repository at this point in the history
Co-authored-by: Andrey Kontyakov <[email protected]>
  • Loading branch information
andreykont and Andrey Kontyakov authored Apr 3, 2024
1 parent 06a55f6 commit dc3d506
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/resources/ca_certificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func (r *CACertificate) mutate(ctx context.Context, tenantControlPlane *kamajiv1
}

if isValid {
return nil
return ctrl.SetControllerReference(tenantControlPlane, r.resource, r.Client.Scheme())
}
}

Expand Down
2 changes: 1 addition & 1 deletion internal/resources/front_proxy_ca_certificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (r *FrontProxyCACertificate) mutate(ctx context.Context, tenantControlPlane
logger.Info(fmt.Sprintf("%s certificate-private_key pair is not valid: %s", kubeadmconstants.FrontProxyCACertAndKeyBaseName, err.Error()))
}
if isValid {
return nil
return ctrl.SetControllerReference(tenantControlPlane, r.resource, r.Client.Scheme())
}
}

Expand Down
2 changes: 1 addition & 1 deletion internal/resources/sa_certificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (r *SACertificate) mutate(ctx context.Context, tenantControlPlane *kamajiv1
logger.Info(fmt.Sprintf("%s public_key-private_key pair is not valid: %s", kubeadmconstants.ServiceAccountKeyBaseName, err.Error()))
}
if isValid {
return nil
return ctrl.SetControllerReference(tenantControlPlane, r.resource, r.Client.Scheme())
}
}

Expand Down

0 comments on commit dc3d506

Please sign in to comment.