feat: implement controller for component config and annotations (EP-1898)#127
feat: implement controller for component config and annotations (EP-1898)#127swghosh wants to merge 2 commits intoopenshift:ai-staging-release-1.0from
Conversation
|
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 |
9034bd5 to
c93ed1f
Compare
…-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>
c93ed1f to
b60b8fc
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>
b60b8fc to
fda2e55
Compare
Summary
annotationsandcomponentConfigsAPI fields from EP-1898component_config.gowith functions to apply per-component deployment overrides and global annotationsgetDeploymentObject()flow indeployments.gocomponent_config_test.goEnhancement Proposal
openshift/enhancements#1898
Depends On
Changes
pkg/controller/external_secrets/component_config.gopkg/controller/external_secrets/component_config_test.gopkg/controller/external_secrets/deployments.goapplyAnnotations()andapplyComponentConfig()Implementation Details
applyAnnotations()— merges user annotations onto Deployment + Pod template metadataapplyComponentConfig()— maps ComponentName → deployment asset, appliesrevisionHistoryLimitandoverrideEnvapplyOverrideEnv()— merges user env vars into the correct container, overriding conflictsTest plan
make generatepassesmake buildpasses (compilation verified)🤖 Generated with Claude Code