Skip to content

Commit 0f1c293

Browse files
committed
[25.x] Use hashed properties rather than version (#922)
* use hashed pro perties rather than version * add changelog * Add regression test (cherry picked from commit ce69bb3)
1 parent eda76c5 commit 0f1c293

File tree

4 files changed

+44
-3
lines changed

4 files changed

+44
-3
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
project: operator
2+
kind: Fixed
3+
body: Fixed a bug where pods would be restarted indefinitely in the case of config version changes when syncing cluster configuration.
4+
time: 2025-06-17T11:33:25.480184-04:00

operator/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ This is required to ensure that a pre-existing sts can roll over to new configur
9898
* `get` permissions on `Node` resources is now correctly configured by default.
9999

100100
`--set rbac.createAdditionalControllerCRs=true` is no longer required for rackawareness to work.
101+
* Fixed a bug where pods would be restarted indefinitely in the case of config version changes when syncing cluster configuration.
101102

102103
## [v25.1.1-beta3](https://github.com/redpanda-data/redpanda-operator/releases/tag/operator%2Fv25.1.1-beta3) - 2025-05-07
103104
### Added

operator/internal/controller/redpanda/redpanda_controller.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import (
1414
"bytes"
1515
"context"
1616
"fmt"
17-
"strconv"
1817
"strings"
1918
"time"
2019

@@ -584,8 +583,7 @@ func (r *RedpandaReconciler) reconcileClusterConfig(ctx context.Context, admin *
584583
return "", false, errors.WithStack(err)
585584
}
586585

587-
// TODO: this needs to be updated when the hashing code lands
588-
return strconv.FormatInt(configStatus.Version, 10), configStatus.NeedsRestart, nil
586+
return configStatus.PropertiesThatNeedRestartHash, configStatus.NeedsRestart, nil
589587
}
590588

591589
func (r *RedpandaReconciler) configSyncMode(ctx context.Context, rp *redpandav1alpha2.Redpanda) syncclusterconfig.SyncerMode {

operator/internal/controller/redpanda/redpanda_controller_test.go

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,44 @@ func (s *RedpandaControllerSuite) TestClusterSettings() {
414414
s.deleteAndWait(rp)
415415
}
416416

417+
func (s *RedpandaControllerSuite) TestClusterSettingsRegressionSuperusers() {
418+
rp := s.minimalRP()
419+
rp.Annotations[redpanda.RestartClusterOnConfigChangeKey] = "true"
420+
421+
// Ensure that some superusers exist.
422+
rp.Spec.ClusterSpec.Auth = &redpandav1alpha2.Auth{
423+
SASL: &redpandav1alpha2.SASL{
424+
Enabled: ptr.To(true),
425+
Users: []redpandav1alpha2.UsersItems{
426+
{Name: ptr.To("bob"), Password: ptr.To("bobert")},
427+
{Name: ptr.To("alice"), Password: ptr.To("alicert")},
428+
},
429+
},
430+
}
431+
432+
s.applyAndWait(rp)
433+
434+
initialVersion := rp.Status.ConfigVersion
435+
436+
// Add a superuser and ensure we don't change the config version (since we now hash).
437+
rp.Spec.ClusterSpec.Auth = &redpandav1alpha2.Auth{
438+
SASL: &redpandav1alpha2.SASL{
439+
Enabled: ptr.To(true),
440+
Users: []redpandav1alpha2.UsersItems{
441+
{Name: ptr.To("bob"), Password: ptr.To("bobert")},
442+
{Name: ptr.To("alice"), Password: ptr.To("alicert")},
443+
{Name: ptr.To("ted"), Password: ptr.To("tedrt")},
444+
},
445+
},
446+
}
447+
448+
s.applyAndWait(rp)
449+
450+
s.Require().Equal(initialVersion, rp.Status.ConfigVersion)
451+
452+
s.deleteAndWait(rp)
453+
}
454+
417455
func (s *RedpandaControllerSuite) TestLicenseReal() {
418456
const (
419457
LicenseEnvVar = "REDPANDA_SAMPLE_LICENSE"

0 commit comments

Comments
 (0)