Skip to content

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

Open
p0lyn0mial wants to merge 2 commits into
openshift:masterfrom
p0lyn0mial:kms-key-controller-preflight-gate
Open

CNTRLPLANE-3237: kms key controller preflight support- #747#965
p0lyn0mial wants to merge 2 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 encryption configuration handling for the OAuth API server.
    • Added validation during encryption setup to improve reliability and surface configuration errors earlier.
    • Improved reporting of authentication encryption status.
    • Strengthened encryption readiness checks to help identify configuration issues before they affect service operation.

@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: eb250d22-082a-4b06-81d3-591768d53269

📥 Commits

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

⛔ 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
🚧 Files skipped from review as they are similar to previous changes (2)
  • go.mod
  • pkg/operator/starter.go

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.

Changes

OAuth encryption integration

Layer / File(s) Summary
Update library-go dependency
go.mod
The github.com/openshift/library-go dependency uses a newer pseudo-version.
Configure encryption providers
pkg/operator/starter.go
The operator creates the authentication encryption status provider, returns initialization errors, and passes the provider plus an always-succeeding KMS preflight deployer to the encryption controller.

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

Possibly related PRs

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 only go.sum and production wiring in pkg/operator/starter.go; it adds no Ginkgo test declarations or dynamic test titles.
Test Structure And Quality ✅ Passed No Ginkgo test files or test blocks changed; the PR only updates dependencies, operator wiring, and vendored production code, so this test-quality check is not applicable.
Microshift Test Compatibility ✅ Passed The pull request changes only go.sum and pkg/operator/starter.go; it adds no Ginkgo e2e tests, so MicroShift test compatibility is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The commit adds no Ginkgo e2e tests or test files; its only source changes wire encryption providers in pkg/operator/starter.go, so no SNO multi-node assumption is introduced.
Topology-Aware Scheduling Compatibility ✅ Passed PR changes only update KMS preflight support in encryption controllers. No deployment manifests, pod specs, or scheduling constraints were added or modified. Existing manifests use topology-aware p...
Ote Binary Stdout Contract ✅ Passed OTE main calls klog.LogToStderr(true) before command setup; the PR adds no main/init/suite output calls, and changed KMS/controller code has no stdout writes.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The patch modifies only go.sum and pkg/operator/starter.go; it adds no *_test.go files, Ginkgo tests, IPv4 assumptions, or external connectivity.
No-Weak-Crypto ✅ Passed The PR only wires existing encryption status and KMS preflight components; it adds no MD5, SHA1, DES, RC4, 3DES, Blowfish, ECB, custom crypto, or secret comparison code.
Container-Privileges ✅ Passed The PR changes only go.sum and Go code. No container or Kubernetes manifest changes or added privilege settings are present.
No-Sensitive-Data-In-Logs ✅ Passed No logging of sensitive data detected. New code adds only imports, initialization, and parameter passing with no logging statements that could expose passwords, tokens, keys, PII, or credentials.
✨ 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

@openshift-ci

openshift-ci Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@p0lyn0mial: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-operator-encryption 6ade05a link true /test e2e-operator-encryption
ci/prow/e2e-oidc 6ade05a link true /test e2e-oidc
ci/prow/test-operator-integration 6ade05a link true /test test-operator-integration

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