Skip to content

CNTRLPLANE-3236: kms: set required field in container sidecar#2230

Open
bertinatto wants to merge 1 commit into
openshift:masterfrom
bertinatto:kms-plugins-lifecycle-vault-mock-follow-up-termination
Open

CNTRLPLANE-3236: kms: set required field in container sidecar#2230
bertinatto wants to merge 1 commit into
openshift:masterfrom
bertinatto:kms-plugins-lifecycle-vault-mock-follow-up-termination

Conversation

@bertinatto
Copy link
Copy Markdown
Member

@bertinatto bertinatto commented May 15, 2026

OpenShift CI expects these fields to be set. We have a few monitor tests that assert that.

Summary by CodeRabbit

  • Improvements
    • Vault KMS sidecar now sets container policies and default resource requests to improve reliability (pull policy, termination message behavior, CPU/memory requests).
  • Tests
    • Updated tests to validate the new sidecar container policies and resource request defaults.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 15, 2026
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 15, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 15, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented May 15, 2026

@bertinatto: This pull request references CNTRLPLANE-3236 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

OpenShift CI expects these fields to be set. We have a few monitor tests that assert that.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 29a5672c-c77a-4b0e-967b-ef97d892dd9b

📥 Commits

Reviewing files that changed from the base of the PR and between 7da318b and 04f88cd.

📒 Files selected for processing (3)
  • pkg/operator/encryption/kms/pluginlifecycle/sidecar_test.go
  • pkg/operator/encryption/kms/pluginlifecycle/vault.go
  • pkg/operator/encryption/kms/pluginlifecycle/vault_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • pkg/operator/encryption/kms/pluginlifecycle/vault.go

Walkthrough

Adds resource parsing import and sets Vault KMS sidecar container fields: ImagePullPolicy, TerminationMessagePolicy, and default Resources.Requests (cpu 5m, memory 50Mi). Tests updated to expect these fields for injected and built sidecar containers.

Changes

Vault Sidecar Container Configuration

Layer / File(s) Summary
Vault BuildSidecarContainer update
pkg/operator/encryption/kms/pluginlifecycle/vault.go
Added k8s.io/apimachinery/pkg/api/resource import and set ImagePullPolicy, TerminationMessagePolicy, and default Resources.Requests (50Mi memory, 5m CPU) in BuildSidecarContainer.
Vault sidecar unit tests
pkg/operator/encryption/kms/pluginlifecycle/vault_test.go
Updated tests to assert ImagePullPolicy, TerminationMessagePolicy, and Resources.Requests are present on the built Vault sidecar container in multiple test cases.
Sidecar injection tests
pkg/operator/encryption/kms/pluginlifecycle/sidecar_test.go
Updated AddKMSPluginSidecarToPodSpec expectations to include pull/termination policies and resource requests for injected vault-kms-plugin-* containers across affected test cases.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • openshift/library-go#2223: Modifies Vault KMS sidecar handling and arguments; relates to sidecar container spec and argument construction.

Suggested labels

lgtm

Suggested reviewers

  • dgrisonnet
  • p0lyn0mial
🚥 Pre-merge checks | ✅ 10 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Test Structure And Quality ❓ Inconclusive Custom check targets Ginkgo tests but PR contains standard Go testing.T tests using table-driven patterns. Check criteria incompatible with test framework used. PR tests use standard Go patterns, not Ginkgo. Table-driven tests are idiomatic Go. No cluster operations need timeouts. Assertion messages lack context but test names describe behavior. Clarify if check applies to standard Go tests.
✅ Passed checks (10 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: setting required fields (ImagePullPolicy, TerminationMessagePolicy, and Resources) in the KMS plugin sidecar container across multiple files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed Test files use traditional Go testing (not Ginkgo). All 13 test case names are static and deterministic with no dynamic values that could change between test runs.
Microshift Test Compatibility ✅ Passed The check applies only to NEW Ginkgo e2e tests. This PR only modifies existing Go unit tests to update expected container field values. No new Ginkgo e2e tests are added.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR modifies only standard Go unit tests in library-go, not Ginkgo e2e tests. Custom check applies only to new Ginkgo tests. Not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed Sets container fields (ImagePullPolicy, TerminationMessagePolicy, resource requests) only. No affinity, tolerations, node selectors, topology spreads, or PDBs. Topology-agnostic.
Ote Binary Stdout Contract ✅ Passed Library code only, no executable code. No process-level stdout violations: no main/init/TestMain/suite setup. No fmt.Print or log.Print calls. klog only in library functions.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR adds no new Ginkgo e2e tests. Only unit tests (standard Go testing.T) updated with new expected values. IPv6/disconnected network check not applicable here.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 15, 2026
OpenShift CI expects these fields to be set. We have a few monitor tests
that assert that.
@ardaguclu
Copy link
Copy Markdown
Member

Changes look reasonable to me. Feel free to ping me, when you need to merge this

@bertinatto bertinatto marked this pull request as ready for review May 15, 2026 18:45
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 15, 2026
@bertinatto
Copy link
Copy Markdown
Member Author

@openshift-ci openshift-ci Bot requested review from dgrisonnet and p0lyn0mial May 15, 2026 18:45
@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 15, 2026
@ardaguclu
Copy link
Copy Markdown
Member

/lgtm
It is already held

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label May 15, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 15, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ardaguclu, bertinatto

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
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 15, 2026

@bertinatto: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

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. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants