feat: allow to disable PDB management#164
Merged
Merged
Conversation
Member
Author
|
@Revenge-Rakesh, this PR should fix most problems. |
There was a problem hiding this comment.
Pull request overview
Adds a global switch to disable PodDisruptionBudget (PDB) management by the operator, intended for environments where granting PDB permissions is not possible.
Changes:
- Introduces
ENABLE_PDBenvironment variable (defaulttrue) and Helm chart valuepdbManagement.enable. - Threads the flag into ClickHouse/Keeper controllers to skip PDB reconciliation steps and to avoid registering PDB ownership watches.
- Updates unit/e2e wiring to account for the new
SetupWithManager(..., enablePDB bool)signature.
Reviewed changes
Copilot reviewed 11 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
cmd/main.go |
Passes env.EnablePDB into controller setup. |
internal/environment/environment.go |
Adds EnablePDB env var parsing with default true. |
internal/environment/environment_test.go |
Adds coverage for ENABLE_PDB=false. |
internal/controller/clickhouse/controller.go |
Stores EnablePDB on controller; conditionally registers PDB ownership watch; passes flag into reconciler. |
internal/controller/clickhouse/controller_test.go |
Updates controller construction to include EnablePDB. |
internal/controller/clickhouse/sync.go |
Gates PDB reconciliation step on EnablePDB. |
internal/controller/keeper/controller.go |
Stores EnablePDB on controller; conditionally registers PDB ownership watch; passes flag into reconciler. |
internal/controller/keeper/controller_test.go |
Updates controller construction to include EnablePDB. |
internal/controller/keeper/sync.go |
Gates PDB reconciliation step on EnablePDB and extracts PDB reconcile logic into its own step. |
internal/controller/keeper/sync_test.go |
Updates controller construction to include EnablePDB. |
test/e2e/e2e_suite_test.go |
Updates controller setup calls for new signature. |
dist/chart/values.yaml |
Adds pdbManagement.enable Helm value and documentation. |
dist/chart/templates/manager/manager.yaml |
Wires Helm value into ENABLE_PDB env var for the manager container. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
In some environments, users are restricted to creating/updating PDBs and need a way to ignore this feature.
What
Add
ENABLE_PDBenv variable that disables PDB reconciliation and controller informers.Related Issues
Fixes #141