diff --git a/controllers/k8ssandra/secrets.go b/controllers/k8ssandra/secrets.go index dd75dbc7b..7b0cad301 100644 --- a/controllers/k8ssandra/secrets.go +++ b/controllers/k8ssandra/secrets.go @@ -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" @@ -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)