annotate broker on config change#672
Conversation
b25443e to
20c0cdc
Compare
20c0cdc to
a5cf19e
Compare
RafalKorepta
left a comment
There was a problem hiding this comment.
I wrongly guide you. Pods does not have generation. Higher level resources like StatefulSet and Deployment have such generation. Pods have only labels and resourceVersion and uid in metadata.
Maybe only one change I would make is to not change the assertion, but rather when the Condition is set to True. As far as I understand
syncer := syncclusterconfig.Syncer{Client: client, Mode: syncclusterconfig.SyncerModeAdditive}
configVersion, err := syncer.Sync(ctx, config, usersTXT)
if err != nil {
return errors.WithStack(err)
}
apimeta.SetStatusCondition(rp.GetConditions(), metav1.Condition{
Type: redpandav1alpha2.ClusterConfigSynced,
Status: metav1.ConditionTrue,
ObservedGeneration: rp.Generation,
Reason: "ConfigSynced",
Message: fmt.Sprintf("ClusterConfig at Version %d", configVersion),
})will set the condition when Pods did not restart. Am I right?
jan-g
left a comment
There was a problem hiding this comment.
As long as the forced restart by applying a new/changed configuration doesn't cause a config version bump (I don't think it does, having just tried it) I think this approach is okay.
chrisseto
left a comment
There was a problem hiding this comment.
I think we'll want to include this in main and backport it to v2.4.x and v2.3.x? WDYT?
Implementation LGTM, just a couple things to fix up in tests.
operator/internal/controller/redpanda/redpanda_controller_test.go
Outdated
Show resolved
Hide resolved
operator/internal/controller/redpanda/redpanda_controller_test.go
Outdated
Show resolved
Hide resolved
bb40b20 to
9057a75
Compare
chrisseto
left a comment
There was a problem hiding this comment.
LGTM! You need to run task lint -- --fix to get the linter to approve you.
operator/internal/controller/redpanda/redpanda_controller_test.go
Outdated
Show resolved
Hide resolved
operator/internal/controller/redpanda/redpanda_controller_test.go
Outdated
Show resolved
Hide resolved
9057a75 to
de64fab
Compare
de64fab to
00e4cf8
Compare
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
1 similar comment
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
Annotate brokers with cluster config version to force a restart on config changes
Refs