feat: add e2e tests for component configuration overrides (EP-1898)#131
feat: add e2e tests for component configuration overrides (EP-1898)#131swghosh wants to merge 3 commits intoopenshift:ai-staging-release-1.0from
Conversation
…-1898) Extend the ExternalSecretsConfig API with annotations and componentConfig fields in ControllerConfig to support per-component deployment overrides. New types added: - ComponentConfig: per-component configuration with deploymentConfigs and overrideEnv - DeploymentConfig: deployment-level overrides (revisionHistoryLimit) - KVPair/Annotation: reusable key-value pair types for custom annotations New ComponentName enum values: Webhook, CertController (extending existing ExternalSecretsCoreController and BitwardenSDKServer). Includes CEL validation rules for: - Reserved annotation prefix rejection (kubernetes.io/, openshift.io/, etc.) - Reserved environment variable prefix rejection (HOSTNAME, KUBERNETES_, EXTERNAL_SECRETS_) - Component name uniqueness enforcement - RevisionHistoryLimit minimum value of 1 Also includes comprehensive integration test suite covering all new fields, validation rules, and update scenarios. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: swghosh The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
c7fa175 to
fa6da34
Compare
…(EP-1898) Add controller implementation to reconcile the new annotations and componentConfig fields from ExternalSecretsConfig into operand deployments. New file: component_config.go - applyAnnotations: merges custom annotations onto Deployment and Pod template - applyComponentConfig: applies per-component overrides (revisionHistoryLimit, overrideEnv) - applyOverrideEnv: merges override environment variables with existing container env - componentNameToDeploymentAsset/componentNameToContainerName: mapping tables - getComponentNameForAsset: reverse lookup from asset to component name Modified files: - deployments.go: integrates annotation and component config application into getDeploymentObject pipeline - networkpolicy.go: extends getPodSelectorForComponent with Webhook and CertController pod selectors Unit tests: component_config_test.go - TestApplyAnnotations: empty, single, multiple, override scenarios - TestApplyComponentConfig: revisionHistoryLimit, overrideEnv, no-match, combined - TestApplyOverrideEnv: add, override, no-match container scenarios - TestGetComponentNameForAsset: all 4 components + unknown asset error Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
044a292 to
6abd049
Compare
Add comprehensive end-to-end tests for the new controller configuration features introduced by EP-1898, including: - Custom annotations applied to operand Deployments and Pod templates - Reserved annotation prefix rejection (kubernetes.io/, openshift.io/, etc.) - ComponentConfig revisionHistoryLimit per component - ComponentConfig overrideEnv for custom environment variables - Reserved env var prefix rejection (KUBERNETES_, EXTERNAL_SECRETS_, HOSTNAME) - Duplicate componentName validation - NetworkPolicy with Webhook and CertController pod selectors - Combined configuration reconciliation Also includes generated e2e artifacts: test cases, execution steps, and test suggestions documentation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
6abd049 to
ebb7cfa
Compare
Summary
revisionHistoryLimitoverrides (Controller=5, Webhook=3, CertController=default)overrideEnv(GOMAXPROCS=4 on controller, absent from webhook)Test plan
go vet --tags=e2e ./test/e2e/...Dependencies
🤖 Generated with Claude Code