Skip to content

Commit

Permalink
fix PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nmarukovich committed Aug 18, 2024
1 parent 6469171 commit 2306d33
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/controller/ps/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@ func (r *PerconaServerMySQLReconciler) ensureTLSSecret(ctx context.Context, cr *
log := logf.FromContext(ctx)

secretObj := corev1.Secret{}
errSecret := r.Client.Get(context.TODO(),
err := r.Client.Get(context.TODO(),
types.NamespacedName{
Namespace: cr.Namespace,
Name: cr.Spec.SSLSecretName,
},
&secretObj,
)

// don't create secret ssl-internal if secret ssl is not created by operator
if errSecret == nil && !metav1.IsControlledBy(&secretObj, cr) {
// don't create ssl secret if it is created by customer not by operator
if err == nil && !metav1.IsControlledBy(&secretObj, cr) {
return nil
}

err := r.ensureSSLByCertManager(ctx, cr)
err = r.ensureSSLByCertManager(ctx, cr)
if err != nil {
if cr.Spec.TLS != nil && cr.Spec.TLS.IssuerConf != nil {
log.Error(err, fmt.Sprintf("Failed to ensure certificate by cert-manager. Check `.spec.tls.issuerConf` in PerconaServerMySQL %s/%s", cr.Namespace, cr.Name))
Expand Down

0 comments on commit 2306d33

Please sign in to comment.