Skip to content

Conversation

@chrisseto
Copy link
Contributor

@chrisseto chrisseto commented Oct 14, 2025

Prior to this commit the operator sidecar's decommissioner and pvcunbinder
controllers did not work. This was due to:

  • RBAC issues, the sidecar did not correctly scope itself to a single namespace.
  • Incorrect label selectors hidden within the controllers in question.
    • This likely prevented the vectorized adaptor from ever working.

Additionally, the statefulset decommissioner's sole test case has been disabled
for quite sometime. There's been zero test coverage of this functionality.

This commit:

  • Restores the decommissioner's tests to a working state
  • Strips out the "fetcher" to reduce duplication and remove reliance on
    fetching live helm values.
  • Replaces baked in filtering with a label selector argument that will be
    constructed by the helm chart.

A follow up commit with chart changes and acceptance tests will be submitted.
It's been made separate to ease the process of backporting to the v2.x
branches.

var _ suite.SetupAllSuite = (*StatefulSetDecommissionerSuite)(nil)

func (s *StatefulSetDecommissionerSuite) TestDecommission() {
s.T().Skip("we currently have issues with the eviction code in this test due to pod disruption budgets")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test was disabled quite sometime ago 😬

@chrisseto chrisseto force-pushed the chris/p/sidecar-fixes branch from 136df65 to dfae5b0 Compare October 16, 2025 17:24
// vectorizedDecommissionerAdapter is a helper struct that implements various methods
// of mapping StatefulSets through Vectorized Clusters to arguments for the
// StatefulSetDecommissioner.
type vectorizedDecommissionerAdapter struct {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bulk of this code is the same. I've moved it into it's own file because the diff would otherwise be interleaved and abysmal to read.

@chrisseto chrisseto force-pushed the chris/p/sidecar-fixes branch 2 times, most recently from 27c9f52 to 11bdc24 Compare October 20, 2025 21:26
Copy link
Contributor

@andrewstucki andrewstucki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Generally I'm fine with this, and thanks for looking into/fixing this. The one thing I'm 🤷 about is the use of the closure for the admin client v. delegating to the factory itself, but I understand why we might want to do it that way given that we're indirecting through the statefulset itself.

@chrisseto
Copy link
Contributor Author

The one thing I'm 🤷 about is the use of the closure for the admin client v. delegating to the factory itself

You know me, I like closures and dislike interfaces 😛. In this case specifically, opted for a closure "adapter" because the controller really only needs a single method func(StatefulSet) (AdminClient, error). Adding that to the factory would just expand an already large interface and potentially invite unwanted usage.

Oh and in the case of the sidecar, there's no STS indirection. We're just loading the redpanda.yaml and ignoring the STS all together.

@chrisseto
Copy link
Contributor Author

I'm going to hold off on merging this until I get the vectorized test finished/passing so I can hopefully avoid and additional backport pains.

Prior to this commit the operator sidecar's decommissioner and pvcunbinder
controllers did not work. This was due to:
- RBAC issues, the sidecar did not correctly scope itself to a single namespace.
- Incorrect label selectors hidden within the controllers in question.

Additionally, the statefulset decommissioner's sole test case has been disabled
for quite sometime. There's been zero test coverage of this functionality.

This commit:
- Restores the decommissioner's tests to a working state
- Strips out the "fetcher" to reduce duplication and remove reliance on
  fetching live helm values.
- Replaces baked in filtering with a label selector argument that will be
  constructed by the helm chart.

A follow up commit with chart changes and acceptance tests will be submitted.
It's been made separate to ease the process of backporting to the v2.x.x
branches.
@chrisseto chrisseto force-pushed the chris/p/sidecar-fixes branch from 9a5a3d0 to 12f4fb2 Compare October 21, 2025 18:55
@chrisseto chrisseto enabled auto-merge (rebase) October 21, 2025 18:56
@chrisseto chrisseto merged commit 03dd394 into main Oct 21, 2025
10 checks passed
@github-actions
Copy link

💚 All backports created successfully

Status Branch Result
release/v2.4.x
release/v2.3.x
release/v25.1.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

@RafalKorepta RafalKorepta deleted the chris/p/sidecar-fixes branch December 12, 2025 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants