Skip to content

CNTRLPLANE-3237: kms preflight: add AlwaysSucceedKMSPreflightDeployer - #2396

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:masterfrom
p0lyn0mial:kms-preflight-always-succeed-deployer
Aug 3, 2026
Merged

CNTRLPLANE-3237: kms preflight: add AlwaysSucceedKMSPreflightDeployer#2396
openshift-merge-bot[bot] merged 1 commit into
openshift:masterfrom
p0lyn0mial:kms-preflight-always-succeed-deployer

Conversation

@p0lyn0mial

@p0lyn0mial p0lyn0mial commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Added a KMS preflight deployment option that records configuration, reports successful readiness conditions, and supports cleanup.
    • Status now clearly indicates when a preflight deployment has not yet been created or has been removed.
    • Preflight status reports success even when configuration details are empty.
  • Tests

    • Added coverage for deployment, status reporting, required KMS conditions, empty configuration, and cleanup behavior.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 3, 2026
@openshift-ci-robot

openshift-ci-robot commented Aug 3, 2026

Copy link
Copy Markdown

@p0lyn0mial: This pull request references CNTRLPLANE-3237 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:

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.

@openshift-ci
openshift-ci Bot requested review from ardaguclu and dgrisonnet August 3, 2026 11:45
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 3, 2026
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

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: 1de4c05a-19c2-4fce-86a0-dd7fec4c7d58

📥 Commits

Reviewing files that changed from the base of the PR and between a620ed5 and cecc12a.

📒 Files selected for processing (2)
  • pkg/operator/encryption/kms/preflight/always_succeed_deployer.go
  • pkg/operator/encryption/kms/preflight/always_succeed_deployer_test.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • pkg/operator/encryption/kms/preflight/always_succeed_deployer_test.go
  • pkg/operator/encryption/kms/preflight/always_succeed_deployer.go

Walkthrough

Adds an always-success KMS preflight deployer. It records the configuration hash, reports successful KMS conditions after deployment, returns NotFound before deployment and after cleanup, and includes lifecycle tests.

Changes

KMS preflight deployment

Layer / File(s) Summary
Deployer lifecycle behavior
pkg/operator/encryption/kms/preflight/always_succeed_deployer.go
Adds construction, deployment, status reporting, and cleanup. The deployer records the configuration hash and reports successful KMS preflight conditions.
Lifecycle validation
pkg/operator/encryption/kms/preflight/always_succeed_deployer_test.go
Tests initial and post-cleanup NotFound states, successful pod status, configuration-hash reporting, successful-result reporting, remote key ID reporting, and empty-hash deployment.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: ardaguclu, dgrisonnet

🚥 Pre-merge checks | ✅ 14 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Test Structure And Quality ⚠️ Warning The added test combines pre-deploy Status, successful Deploy conditions, Cleanup reset, and empty-hash behavior in one test function (lines 17–65). Split the lifecycle and empty-hash checks into focused test functions or subtests with independent setup; retain the existing diagnostic assertion messages.
✅ Passed checks (14 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the KMS preflight component added by this pull request and includes the related issue identifier.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 The added test uses standard testing, not Ginkgo. Its only test name is the static TestAlwaysSucceedKMSPreflightDeployer; dynamic values appear only in the test body.
Microshift Test Compatibility ✅ Passed The added test is a standard Go testing.T unit test, not a Ginkgo e2e test, and it references no MicroShift-unavailable APIs, namespaces, or unsupported assumptions.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The patch adds only a standard Go unit test (func Test...) in the preflight package; it adds no Ginkgo e2e test or multi-node assumption.
Topology-Aware Scheduling Compatibility ✅ Passed The PR adds only an in-memory preflight deployer; Deploy records state and Status returns PodStatus, with no workload manifest, scheduling field, topology logic, or node constraint changed.
Ote Binary Stdout Contract ✅ Passed The two changed Go files add no stdout, logging, init, main, TestMain, or suite-setup code; they only implement and test the deployer.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The added test is a standard Go Test function, not a Ginkgo e2e test, and the changed files contain no IPv4 assumptions or external network operations.
No-Weak-Crypto ✅ Passed The PR adds no crypto imports, weak algorithms, cipher modes, custom crypto, or secret/token comparisons; it only stores and reports a configuration hash.
Container-Privileges ✅ Passed Both changed files are Go source/test files, not manifests; added-line and structural scans found no privileged settings, host namespaces, SYS_ADMIN, root execution, or privilege escalation.
No-Sensitive-Data-In-Logs ✅ Passed The added deployer and test contain no logging calls and do not emit passwords, tokens, keys, PII, hostnames, or customer data.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pkg/operator/encryption/kms/preflight/always_succeed_deployer.go`:
- Around line 22-24: Use a separate boolean deployment-state field in
AlwaysSucceedKMSPreflightDeployer rather than inferring deployment from
configHash, so Deploy with an empty hash still causes Status to report success.
Update Deploy and Status to maintain and consult this state, and add a lifecycle
test covering deployment with an empty hash.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: 94325e6c-641d-4c0b-93fa-f929372226df

📥 Commits

Reviewing files that changed from the base of the PR and between 26e4f37 and a620ed5.

📒 Files selected for processing (2)
  • pkg/operator/encryption/kms/preflight/always_succeed_deployer.go
  • pkg/operator/encryption/kms/preflight/always_succeed_deployer_test.go

Comment thread pkg/operator/encryption/kms/preflight/always_succeed_deployer.go
@p0lyn0mial
p0lyn0mial force-pushed the kms-preflight-always-succeed-deployer branch from a620ed5 to cecc12a Compare August 3, 2026 12:04
@ardaguclu

Copy link
Copy Markdown
Member

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 3, 2026
@openshift-ci

openshift-ci Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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

@p0lyn0mial

Copy link
Copy Markdown
Contributor Author

xref: #2392

@openshift-ci

openshift-ci Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

@p0lyn0mial: 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.

@openshift-merge-bot
openshift-merge-bot Bot merged commit 8bf2204 into openshift:master Aug 3, 2026
6 checks passed
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. 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