Skip to content

feat: add e2e tests for component configuration overrides (EP-1898)#131

Open
swghosh wants to merge 3 commits intoopenshift:ai-staging-release-1.0from
swghosh:feature/e2e-tests-1898
Open

feat: add e2e tests for component configuration overrides (EP-1898)#131
swghosh wants to merge 3 commits intoopenshift:ai-staging-release-1.0from
swghosh:feature/e2e-tests-1898

Conversation

@swghosh
Copy link
Copy Markdown
Member

@swghosh swghosh commented Apr 6, 2026

Summary

  • Adds Ginkgo-based e2e tests for the new component configuration features introduced in EP-1898
  • Tests verify custom annotations are applied to all operand deployment pod templates
  • Tests verify per-component revisionHistoryLimit overrides (Controller=5, Webhook=3, CertController=default)
  • Tests verify per-component overrideEnv (GOMAXPROCS=4 on controller, absent from webhook)
  • Tests verify CR update reconciliation propagates annotation changes
  • Tests verify Ready condition after successful reconciliation
  • Includes test documentation: test-cases.md, execution-steps.md, e2e-suggestions.md

Test plan

  • Verify e2e test code compiles with go vet --tags=e2e ./test/e2e/...
  • Run e2e tests against a live cluster with operator installed
  • Verify all 10 test cases pass (3 annotation + 3 revisionHistoryLimit + 2 overrideEnv + 2 update/ready)

Dependencies

🤖 Generated with Claude Code

…-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>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 6, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e6c4f5f8-ce3a-4cbb-ab85-62724c0d85d4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Apr 6, 2026

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 6, 2026
@swghosh swghosh force-pushed the feature/e2e-tests-1898 branch from c7fa175 to fa6da34 Compare April 6, 2026 08:32
…(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>
@swghosh swghosh changed the title feat: add e2e tests for component config overrides (EP#1898) feat: add e2e test artifacts for component config and annotations (EP-1898) Apr 6, 2026
@swghosh swghosh force-pushed the feature/e2e-tests-1898 branch 2 times, most recently from 044a292 to 6abd049 Compare April 6, 2026 08:42
@swghosh swghosh changed the title feat: add e2e test artifacts for component config and annotations (EP-1898) feat: add e2e tests for component configuration overrides (EP-1898) Apr 6, 2026
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>
@swghosh swghosh force-pushed the feature/e2e-tests-1898 branch from 6abd049 to ebb7cfa Compare April 6, 2026 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant