Skip to content

CSPL-4630: add feature gate infrastructure using k8s FeatureGate pattern#1848

Open
kubabuczak wants to merge 2 commits intodevelopfrom
CSPL-4630-feature-gate-infrastructure
Open

CSPL-4630: add feature gate infrastructure using k8s FeatureGate pattern#1848
kubabuczak wants to merge 2 commits intodevelopfrom
CSPL-4630-feature-gate-infrastructure

Conversation

@kubabuczak
Copy link
Copy Markdown
Collaborator

Description

Add a feature gate registry using k8s.io/component-base/featuregate so new controllers can be gated behind --feature-gates=<Gate>=true|false with Alpha/Beta/GA lifecycle. Migrate the validation webhook toggle from the ENABLE_VALIDATION_WEBHOOK env var to a ValidationWebhook feature gate with backwards-compatible env var support.

Key Changes

  • Feature gate registry in pkg/config/ with ValidationWebhook gate (Alpha, off by default) and legacy env var bridge
  • Migrate cmd/main.go from flag to pflag and wire --feature-gates CLI flag
  • Update webhook kustomize overlays to use container args instead of env var
  • Add docs/FeatureGates.md with 4-step checklist for adding new gates
  • Update docs/ValidationWebhook.md to reflect feature gate enablement

Testing and Verification

  • Unit tests cover gate registration, default-off behavior, and all three legacy env var paths (set to "true", unset, set to "false")
  • Existing flags behave identically after the flagpflag migration (1:1 rename)

Related Issues

PR Checklist

  • Code changes adhere to the project's coding standards
  • Relevant unit and integration tests are included
  • Documentation has been updated accordingly
  • If test framework files were changed (test/testenv/, test/run-tests.sh, test/env.sh), docs/IntegrationTesting.md has been updated
  • All tests pass locally
  • The PR description follows the project's guidelines

Introduce a feature gate registry backed by k8s.io/component-base/featuregate
so new capabilities can be gated behind --feature-gates=<Gate>=true|false with
Alpha/Beta/GA lifecycle. Migrate the validation webhook toggle from the
ENABLE_VALIDATION_WEBHOOK env var to a ValidationWebhook feature gate with
backwards-compatible env var support.
Remove non-existent Helm values snippet from FeatureGates.md, add
CLI-over-env-var precedence note to ValidationWebhook.md, and log
effective gate states instead of just known feature names.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant