Skip to content

CNTRLPLANE-3237: kms key controller preflight support- #747 - #965

Merged
openshift-merge-bot[bot] merged 3 commits into
openshift:masterfrom
p0lyn0mial:kms-key-controller-preflight-gate
Aug 10, 2026
Merged

CNTRLPLANE-3237: kms key controller preflight support- #747#965
openshift-merge-bot[bot] merged 3 commits into
openshift:masterfrom
p0lyn0mial:kms-key-controller-preflight-gate

Conversation

@p0lyn0mial

@p0lyn0mial p0lyn0mial commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Improvements
    • Enhanced OAuth API server encryption configuration handling.
    • Added earlier validation of encryption readiness to identify configuration issues before service operation.
    • Improved visibility into authentication encryption status and KMS preflight checks.
    • Updated status reporting to clearly indicate successful or skipped readiness checks.
    • Corrected token age values in operator event messages for clearer diagnostics.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot

openshift-ci-robot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@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-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 6, 2026
@coderabbitai

coderabbitai Bot commented Aug 6, 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: 8f9b6d98-d435-420c-9f03-8fce4ceea143

📥 Commits

Reviewing files that changed from the base of the PR and between 6ade05a and 186e1dc.

📒 Files selected for processing (13)
  • test-data/apply-configuration/overall/minimal-cluster/expected-output/Management/ApplyStatus/cluster-scoped-resources/operator.openshift.io/authentications/047a-body-cluster.yaml
  • test-data/apply-configuration/overall/minimal-cluster/expected-output/Management/ApplyStatus/cluster-scoped-resources/operator.openshift.io/authentications/047a-metadata-cluster.yaml
  • test-data/apply-configuration/overall/minimal-cluster/expected-output/Management/ApplyStatus/cluster-scoped-resources/operator.openshift.io/authentications/047a-options-cluster.yaml
  • test-data/apply-configuration/overall/minimal-cluster/expected-output/UserWorkload/Create/cluster-scoped-resources/certificates.k8s.io/certificatesigningrequests/ad23-body-system-COLON-openshift-COLON-openshift-authenticator-.yaml
  • test-data/apply-configuration/overall/minimal-cluster/expected-output/UserWorkload/Create/cluster-scoped-resources/certificates.k8s.io/certificatesigningrequests/ad23-metadata-system-COLON-openshift-COLON-openshift-authenticator-.yaml
  • test-data/apply-configuration/overall/minimal-cluster/expected-output/controller-results.yaml
  • test-data/apply-configuration/overall/oauth-apiserver-creation-minimal/expected-output/controller-results.yaml
  • test-data/apply-configuration/overall/oauth-server-configobserver/expected-output/Management/Create/namespaces/openshift-authentication-operator/core/events/aea5-body-authentication-operator.18599d2230299800.2a210194.yaml
  • test-data/apply-configuration/overall/oauth-server-configobserver/expected-output/Management/Create/namespaces/openshift-authentication-operator/core/events/aea5-metadata-authentication-operator.18599d2230299800.2a210194.yaml
  • test-data/apply-configuration/overall/oauth-server-configobserver/expected-output/controller-results.yaml
  • test-data/apply-configuration/overall/oauth-server-creation-minimal/expected-output/controller-results.yaml
  • test-data/apply-configuration/overall/oauth-server-payloadcontroller/expected-output/controller-results.yaml
  • test-data/apply-configuration/overall/oauth-server-staticresource/expected-output/controller-results.yaml

Walkthrough

The change updates the library-go dependency and adds authentication encryption status and KMS preflight components to OAuth API server encryption controller setup. Provider initialization errors now stop operator preparation. Expected outputs reflect the new controller and resource results.

Changes

OAuth encryption integration

Layer / File(s) Summary
Configure encryption providers
go.mod, pkg/operator/starter.go
The operator uses a newer github.com/openshift/library-go version. It creates the authentication encryption status provider, returns initialization errors, and passes the provider and an always-succeeding KMS preflight deployer to the encryption controller.
Update expected outputs
test-data/apply-configuration/overall/...
Expected outputs include KMS preflight results, Authentication apply-status resources, updated CSR data, and corrected event output.

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

Suggested reviewers: ibihim, tjungblu

🚥 Pre-merge checks | ✅ 14 | ❌ 1

❌ Failed checks (1 warning)

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.
✅ 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 main change: adding KMS key controller preflight support.
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 PR changes no test source files or Ginkgo title declarations; generated fixture identifiers are data and do not appear in It, Describe, Context, or When titles.
Test Structure And Quality ✅ Passed The PR changes no Ginkgo test source or *_test.go files; its test-related changes are generated YAML golden files, so the listed test-quality requirements do not apply.
Microshift Test Compatibility ✅ Passed The complete PR diff adds no Ginkgo tests or test files; it changes operator code, vendored code, and golden YAML only, so MicroShift test compatibility is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The complete PR diff adds no Ginkgo e2e tests or It/Describe/Context/When declarations; changes are operator code, vendored code, and test-data golden files.
Topology-Aware Scheduling Compatibility ✅ Passed The PR adds no scheduling constraints; it wires the KMS controller with an in-memory AlwaysSucceed deployer, while changed YAML files are status and test goldens.
Ote Binary Stdout Contract ✅ Passed OTE main redirects klog to stderr before command setup; reachable local packages have no init logging, and stdout prints occur only in test client helpers.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The full PR range adds no Ginkgo e2e tests or test files; it changes operator wiring, vendored library code, dependencies, and golden outputs only.
No-Weak-Crypto ✅ Passed PR additions wire KMS preflight and compare configuration hashes; audit found no MD5, SHA-1, DES, RC4, Blowfish, ECB, custom crypto, or secret/token timing comparison.
Container-Privileges ✅ Passed PR-range diff adds no privileged, hostPID, hostNetwork, hostIPC, SYS_ADMIN, root, or allowPrivilegeEscalation fields; existing privilege-bearing manifests are unchanged.
No-Sensitive-Data-In-Logs ✅ Passed PR-added paths hash Secret and ConfigMap values and log only resource names, error context, and config hashes; no passwords, tokens, API keys, PII, or customer data are logged.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@ardaguclu

Copy link
Copy Markdown
Member

/lgtm
/approve

@openshift-ci
openshift-ci Bot requested review from ibihim and tjungblu August 6, 2026 13:59
@openshift-ci

openshift-ci Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ardaguclu

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 Aug 6, 2026
@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 6, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e-agnostic
/test e2e-agnostic-upgrade
/test e2e-console-login
/test e2e-gcp-operator-disruptive
/test e2e-oidc
/test e2e-operator

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aws-operator-encryption-kms
/test e2e-aws-operator-encryption-kms-2
/test e2e-gcp-operator-encryption-perf
/test e2e-gcp-operator-encryption-rotation
/test e2e-operator-encryption

@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/starter.go`:
- Around line 719-720: Replace NewAlwaysSucceedKMSPreflightDeployer() in the
starter setup with the real KMS preflight deployer used for production
validation, and wire it with the existing configuration and dependencies. Ensure
invalid KMS configuration fails the key-creation gate, and add coverage for that
failing configuration through the relevant starter or OAuth encryption tests.
🪄 Autofix

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: 0bb14af3-2c1b-4f11-9cd3-c94563c9fc4e

📥 Commits

Reviewing files that changed from the base of the PR and between 64f0e6a and decaa40.

⛔ Files ignored due to path filters (6)
  • go.sum is excluded by !**/*.sum
  • vendor/github.com/openshift/library-go/pkg/operator/apiserver/controllerset/apiservercontrollerset.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/library-go/pkg/operator/encryption/controllers.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/library-go/pkg/operator/encryption/controllers/key_controller.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/library-go/pkg/operator/encryption/kms/preflight/deployer.go is excluded by !**/vendor/**, !vendor/**
  • vendor/modules.txt is excluded by !**/vendor/**, !vendor/**
📒 Files selected for processing (2)
  • go.mod
  • pkg/operator/starter.go

Comment thread pkg/operator/starter.go
Comment on lines +719 to +720
authEncryptionStatusProvider,
kmspreflight.NewAlwaysSucceedKMSPreflightDeployer(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

rg -n -C 8 \
  'NewAlwaysSucceedKMSPreflightDeployer|EncryptionKMSPreflight|KMSPreflight|encryption-config' \
  --glob '*.go' --glob '*.yaml' --glob '*.yml' .

Repository: openshift/cluster-authentication-operator

Length of output: 50398


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '%s\n' '--- starter wiring ---'
sed -n '680,740p' pkg/operator/starter.go

printf '%s\n' '--- non-vendor KMS/encryption references ---'
rg -n -C 5 \
  'NewAlwaysSucceedKMSPreflightDeployer|KMSPreflight|EncryptionConfig|encryption-config|kms' \
  --glob '*.go' --glob '*.yaml' --glob '*.yml' \
  --glob '!vendor/**' .

printf '%s\n' '--- library implementation and controller references ---'
rg -n -C 12 \
  'type AlwaysSucceed|NewAlwaysSucceedKMSPreflightDeployer|AlwaysSucceedKMSPreflightDeployer|preflight.*Succeeded|KMSPreflight' \
  vendor/github.com/openshift/library-go/pkg/operator/encryption/kms \
  vendor/github.com/openshift/library-go/pkg/operator/encryption \
  --glob '*.go'

Repository: openshift/cluster-authentication-operator

Length of output: 50398


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '%s\n' '--- exact always-succeed implementation ---'
rg -l \
  'NewAlwaysSucceedKMSPreflightDeployer|AlwaysSucceedKMSPreflightDeployer' \
  vendor/github.com/openshift/library-go --glob '*.go' |
while IFS= read -r file; do
  echo "FILE: $file"
  cat -n "$file"
done

printf '%s\n' '--- encryption controller wiring and gate ---'
rg -l \
  'WithEncryptionControllers|KMSPreflightDeployer|KMSPreflight|Preflight.*Succeeded|Succeeded.*Preflight' \
  vendor/github.com/openshift/library-go/pkg/operator --glob '*.go' |
while IFS= read -r file; do
  echo "FILE: $file"
  rg -n -C 15 \
    'WithEncryptionControllers|KMSPreflightDeployer|KMSPreflight|Preflight.*Succeeded|Succeeded.*Preflight' \
    "$file"
done

Repository: openshift/cluster-authentication-operator

Length of output: 39169


Use a real KMS preflight deployer in production.

NewAlwaysSucceedKMSPreflightDeployer() fabricates a successful result, so invalid KMS configuration can pass the key-creation gate. OAuth API server encryption supports KMS. Add coverage for a failing KMS configuration.

🤖 Prompt for 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.

In `@pkg/operator/starter.go` around lines 719 - 720, Replace
NewAlwaysSucceedKMSPreflightDeployer() in the starter setup with the real KMS
preflight deployer used for production validation, and wire it with the existing
configuration and dependencies. Ensure invalid KMS configuration fails the
key-creation gate, and add coverage for that failing configuration through the
relevant starter or OAuth encryption tests.

@p0lyn0mial

Copy link
Copy Markdown
Contributor Author

/hold

until the kms jobs post their results.

@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 Aug 6, 2026
@p0lyn0mial
p0lyn0mial force-pushed the kms-key-controller-preflight-gate branch from decaa40 to 6ade05a Compare August 6, 2026 14:18
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 6, 2026
@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 6, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e-agnostic
/test e2e-agnostic-upgrade
/test e2e-console-login
/test e2e-gcp-operator-disruptive
/test e2e-oidc
/test e2e-operator

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aws-operator-encryption-kms
/test e2e-aws-operator-encryption-kms-2
/test e2e-gcp-operator-encryption-perf
/test e2e-gcp-operator-encryption-rotation
/test e2e-operator-encryption

@ardaguclu

Copy link
Copy Markdown
Member

/hold cancel
/verified by CI
/retest

@openshift-ci openshift-ci Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 10, 2026
@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Aug 10, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@ardaguclu: This PR has been marked as verified by CI.

Details

In response to this:

/hold cancel
/verified by CI
/retest

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-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD f3df4f5 and 2 for PR HEAD 6ade05a in total

@openshift-ci-robot openshift-ci-robot removed the verified Signifies that the PR passed pre-merge verification criteria label Aug 10, 2026
@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 10, 2026
@ardaguclu

Copy link
Copy Markdown
Member

/lgtm

@openshift-ci-robot

openshift-ci-robot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

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

Summary by CodeRabbit

  • Improvements
  • Enhanced OAuth API server encryption configuration handling.
  • Added earlier validation of encryption readiness to identify configuration issues before service operation.
  • Improved visibility into authentication encryption status and KMS preflight checks.
  • Updated status reporting to clearly indicate successful or skipped readiness checks.
  • Corrected token age values in operator event messages for clearer diagnostics.

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 added the lgtm Indicates that a PR is ready to be merged. label Aug 10, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e-agnostic
/test e2e-agnostic-upgrade
/test e2e-console-login
/test e2e-gcp-operator-disruptive
/test e2e-oidc
/test e2e-operator

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aws-operator-encryption-kms
/test e2e-aws-operator-encryption-kms-2
/test e2e-gcp-operator-encryption-perf
/test e2e-gcp-operator-encryption-rotation
/test e2e-operator-encryption

@p0lyn0mial

Copy link
Copy Markdown
Contributor Author

/verified by CI

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Aug 10, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@p0lyn0mial: This PR has been marked as verified by CI.

Details

In response to this:

/verified by CI

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-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD f3df4f5 and 2 for PR HEAD 186e1dc in total

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 67eaafd and 1 for PR HEAD 186e1dc in total

@openshift-ci

openshift-ci Bot commented Aug 10, 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 b1f60a8 into openshift:master Aug 10, 2026
20 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. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants