Skip to content

Commit

Permalink
Finally found it. FFS.
Browse files Browse the repository at this point in the history
  • Loading branch information
Miles-Garnsey committed Jan 12, 2024
1 parent d4c039a commit f33b8fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 0 additions & 4 deletions controllers/k8ssandra/reaper.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (
k8ssandralabels "github.com/k8ssandra/k8ssandra-operator/pkg/labels"
"github.com/k8ssandra/k8ssandra-operator/pkg/reaper"
"github.com/k8ssandra/k8ssandra-operator/pkg/result"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/types"
Expand Down Expand Up @@ -106,9 +105,6 @@ func (r *K8ssandraClusterReconciler) reconcileReaper(
logger.Info("Reaper present for DC " + actualDc.DatacenterName())

desiredReaper, err := reaper.NewReaper(reaperKey, kc, actualDc, reaperTemplate, logger)
if kc.Spec.Reaper.UiUserSecretRef == nil {
desiredReaper.Spec.UiUserSecretRef = &corev1.LocalObjectReference{Name: reaper.DefaultUiSecretName(kc.SanitizedName())}
}

if err != nil {
logger.Error(err, "failed to create Reaper API object")
Expand Down
4 changes: 3 additions & 1 deletion pkg/reaper/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ func NewReaper(
desiredReaper.Spec.CassandraUserSecretRef.Name = DefaultUserSecretName(kc.SanitizedName())
}
// Note: deliberately skip JmxUserSecretRef, which is deprecated.
if desiredReaper.Spec.UiUserSecretRef == nil {
if kc.Spec.Reaper.UiUserSecretRef == nil && kc.Spec.IsAuthEnabled() {
desiredReaper.Spec.UiUserSecretRef = &corev1.LocalObjectReference{Name: DefaultUiSecretName(kc.SanitizedName())}
} else {
desiredReaper.Spec.UiUserSecretRef = nil
}

if desiredReaper.Spec.ResourceMeta == nil {
Expand Down

0 comments on commit f33b8fb

Please sign in to comment.