Skip to content

Commit

Permalink
Improve the condition for determining wether to reconcile reapers CQL…
Browse files Browse the repository at this point in the history
… user
  • Loading branch information
rzvoncek committed Aug 28, 2024
1 parent 535b417 commit 3be2056
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions controllers/k8ssandra/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package k8ssandra

import (
"context"
reaperapi "github.com/k8ssandra/k8ssandra-operator/apis/reaper/v1alpha1"

"github.com/go-logr/logr"
api "github.com/k8ssandra/k8ssandra-operator/apis/k8ssandra/v1alpha1"
Expand Down Expand Up @@ -64,8 +65,8 @@ func (r *K8ssandraClusterReconciler) reconcileReaperSecrets(ctx context.Context,
uiUserSecretRef.Name = reaper.DefaultUiSecretName(kc.SanitizedName())
}
kcKey := utils.GetKey(kc)
if kc.Spec.Reaper != nil && kc.Spec.Reaper.ReaperRef.Name == "" {
// ReaperRef presence indicates we use an Control Plane Reaper, which talks to C* via mgmt API, so we don't need a CQL user
if kc.Spec.Reaper != nil && kc.Spec.Reaper.StorageType == reaperapi.StorageTypeCassandra {
// We reconcile the CQL user secret only if Reaper uses Cassandra to store its data
if err := secret.ReconcileSecret(ctx, r.Client, cassandraUserSecretRef.Name, kcKey); err != nil {
logger.Error(err, "Failed to reconcile Reaper CQL user secret", "ReaperCassandraUserSecretRef", cassandraUserSecretRef)
return result.Error(err)
Expand Down

0 comments on commit 3be2056

Please sign in to comment.