Skip to content

WIP: Backport KMS TechPreview v1 API changes to 4.21#2737

Open
bertinatto wants to merge 3 commits intoopenshift:release-4.21from
bertinatto:kms-tp-v1-4.21
Open

WIP: Backport KMS TechPreview v1 API changes to 4.21#2737
bertinatto wants to merge 3 commits intoopenshift:release-4.21from
bertinatto:kms-tp-v1-4.21

Conversation

@bertinatto
Copy link
Member

Manual cherry-pick of #2669.

@openshift-ci-robot
Copy link

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 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 Mar 3, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 3, 2026

Hello @bertinatto! Some important instructions when contributing to openshift/api:
API design plays an important part in the user experience of OpenShift and as such API PRs are subject to a high level of scrutiny to ensure they follow our best practices. If you haven't already done so, please review the OpenShift API Conventions and ensure that your proposed changes are compliant. Following these conventions will help expedite the api review process for your PR.

@coderabbitai
Copy link

coderabbitai bot commented Mar 3, 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.

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
  • Post copyable unit tests in a comment

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

@openshift-ci openshift-ci bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 3, 2026
@qodo-code-review
Copy link

Review Summary by Qodo

Backport KMS TechPreview v1 API changes to 4.21

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Add new KMSEncryption feature gate for v1 API
• Remove KMS configuration from TechPreviewNoUpgrade CRD
• Update KMSEncryptionProvider to DevPreviewNoUpgrade only
• Update feature gate manifests across all deployment profiles
Diagram
flowchart LR
  A["KMSEncryptionProvider<br/>DevPreviewNoUpgrade"] --> B["Feature Gate<br/>Updates"]
  C["New KMSEncryption<br/>Feature Gate"] --> B
  D["Remove KMS Config<br/>from TechPreviewNoUpgrade"] --> B
  B --> E["Updated Manifests<br/>All Profiles"]
Loading

Grey Divider

File Changes

1. features/features.go ✨ Enhancement +9/-1

Add KMSEncryption gate, adjust KMSEncryptionProvider scope

features/features.go


2. config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-TechPreviewNoUpgrade.crd.yaml ⚙️ Configuration changes +0/-69

Remove KMS configuration from encryption schema

config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-TechPreviewNoUpgrade.crd.yaml


3. features.md 📝 Documentation +2/-1

Update feature gate documentation table

features.md


View more (6)
4. payload-manifests/featuregates/featureGate-Hypershift-Default.yaml ⚙️ Configuration changes +3/-0

Add KMSEncryption to default feature gates

payload-manifests/featuregates/featureGate-Hypershift-Default.yaml


5. payload-manifests/featuregates/featureGate-Hypershift-DevPreviewNoUpgrade.yaml ⚙️ Configuration changes +3/-0

Add KMSEncryption to dev preview feature gates

payload-manifests/featuregates/featureGate-Hypershift-DevPreviewNoUpgrade.yaml


6. payload-manifests/featuregates/featureGate-Hypershift-TechPreviewNoUpgrade.yaml ⚙️ Configuration changes +4/-1

Add KMSEncryptionProvider, rename KMSEncryptionProvider to KMSEncryption

payload-manifests/featuregates/featureGate-Hypershift-TechPreviewNoUpgrade.yaml


7. payload-manifests/featuregates/featureGate-SelfManagedHA-Default.yaml ⚙️ Configuration changes +3/-0

Add KMSEncryption to default feature gates

payload-manifests/featuregates/featureGate-SelfManagedHA-Default.yaml


8. payload-manifests/featuregates/featureGate-SelfManagedHA-DevPreviewNoUpgrade.yaml ⚙️ Configuration changes +3/-0

Add KMSEncryption to dev preview feature gates

payload-manifests/featuregates/featureGate-SelfManagedHA-DevPreviewNoUpgrade.yaml


9. payload-manifests/featuregates/featureGate-SelfManagedHA-TechPreviewNoUpgrade.yaml ⚙️ Configuration changes +4/-1

Add KMSEncryptionProvider, rename KMSEncryptionProvider to KMSEncryption

payload-manifests/featuregates/featureGate-SelfManagedHA-TechPreviewNoUpgrade.yaml


Grey Divider

Qodo Logo

@qodo-code-review
Copy link

qodo-code-review bot commented Mar 3, 2026

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (1) 📎 Requirement gaps (0)

Grey Divider


Action required

1. KMSEncryption tests missing 📘 Rule violation ⛯ Reliability
Description
This PR introduces the KMSEncryption FeatureGate and changes the APIServer TechPreviewNoUpgrade
CRD schema to no longer allow type: KMS, but the existing validation tests still only target
KMSEncryptionProvider. Without adding/updating tests for the new gate and updated schema, these
API changes risk going unvalidated and regressing.
Code

config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-TechPreviewNoUpgrade.crd.yaml[L244-251]

-                    - KMS
                    type: string
                type: object
-                x-kubernetes-validations:
-                - message: kms config is required when encryption type is KMS, and
-                    forbidden otherwise
-                  rule: 'has(self.type) && self.type == ''KMS'' ?  has(self.kms) :
-                    !has(self.kms)'
Evidence
PR Compliance ID 5 requires API/CRD changes to include corresponding integration/validation tests.
The PR modifies the TechPreviewNoUpgrade APIServer CRD to remove KMS from the allowed
spec.encryption.type enum, while also registering/enabling a new KMSEncryption FeatureGate;
however, the only existing APIServer KMS validation tests are still gated on
KMSEncryptionProvider, with no test coverage updated/added for KMSEncryption and the changed
TechPreview schema.

AGENTS.md
features/features.go[653-667]
config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-TechPreviewNoUpgrade.crd.yaml[157-182]
config/v1/tests/apiservers.config.openshift.io/KMSEncryptionProvider.yaml[1-6]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The PR changes the APIServer encryption schema behavior (TechPreviewNoUpgrade CRD no longer allows `type: KMS`) and introduces a new FeatureGate (`KMSEncryption`), but the validation tests under `config/v1/tests/apiservers.config.openshift.io/` still only cover `KMSEncryptionProvider`.

## Issue Context
Per compliance, API/CRD changes must be accompanied by corresponding integration/validation tests under the API group&#x27;s `tests/` directory.

## Fix Focus Areas
- features/features.go[653-667]
- config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-TechPreviewNoUpgrade.crd.yaml[157-183]
- config/v1/tests/apiservers.config.openshift.io/KMSEncryptionProvider.yaml[1-20]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. KMSEncryption enabled in Default 🐞 Bug ✓ Correctness
Description
The Default payload FeatureGate manifests enable KMSEncryption, but the feature gate registry only
enables it for DevPreviewNoUpgrade and TechPreviewNoUpgrade. This mismatch is likely to fail
hack/verify-payload-featuregates.sh (generated manifests won’t match) and/or unintentionally turn on
the gate for Default clusters.
Code

payload-manifests/featuregates/featureGate-Hypershift-Default.yaml[R135-140]

+                    {
+                        "name": "KMSEncryption"
+                    },
                    {
                        "name": "KMSEncryptionProvider"
                    },
Evidence
The payload Default manifests list KMSEncryption under enabled, but features/features.go registers
KMSEncryption without configv1.Default in enableIn(), meaning it should be disabled for Default. The
repo’s verify script regenerates payload featuregate manifests from features.AllFeatureSets() and
diffs them against ./payload-manifests/featuregates, so this inconsistency is expected to break
verification.

payload-manifests/featuregates/featureGate-Hypershift-Default.yaml[125-142]
payload-manifests/featuregates/featureGate-SelfManagedHA-Default.yaml[130-146]
features/features.go[653-667]
hack/verify-payload-featuregates.sh[5-10]
features.md[1-2]
features.md[55-57]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`KMSEncryption` is listed as **enabled** in the **Default** payload FeatureGate manifests, but the feature-gate registry enables it only for `DevPreviewNoUpgrade` and `TechPreviewNoUpgrade`. This creates a drift that is expected to fail `hack/verify-payload-featuregates.sh` (regen + diff) and/or unintentionally enable the gate for Default clusters.

### Issue Context
- Feature gate registry is in `features/features.go`.
- Payload featuregate manifests are expected to be generated from `features.AllFeatureSets()` (see `hack/verify-payload-featuregates.sh`).

### Fix Focus Areas
- payload-manifests/featuregates/featureGate-Hypershift-Default.yaml[125-142]
- payload-manifests/featuregates/featureGate-SelfManagedHA-Default.yaml[130-146]
- features/features.go[653-667]
- hack/verify-payload-featuregates.sh[5-10]

### Expected fix
Option A (recommended): remove `KMSEncryption` from the Default payload manifests and regenerate via `hack/update-payload-featuregates.sh`.

Option B: if Default is intended, add `configv1.Default` to `FeatureGateKMSEncryption.enableIn(...)` and regenerate manifests + update docs accordingly.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@openshift-ci openshift-ci bot requested review from JoelSpeed and everettraven March 3, 2026 21:12
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 3, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign deads2k for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

Comment on lines +135 to 140
{
"name": "KMSEncryption"
},
{
"name": "KMSEncryptionProvider"
},

Choose a reason for hiding this comment

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

Action required

2. Kmsencryption enabled in default 🐞 Bug ✓ Correctness

The Default payload FeatureGate manifests enable KMSEncryption, but the feature gate registry only
enables it for DevPreviewNoUpgrade and TechPreviewNoUpgrade. This mismatch is likely to fail
hack/verify-payload-featuregates.sh (generated manifests won’t match) and/or unintentionally turn on
the gate for Default clusters.
Agent Prompt
### Issue description
`KMSEncryption` is listed as **enabled** in the **Default** payload FeatureGate manifests, but the feature-gate registry enables it only for `DevPreviewNoUpgrade` and `TechPreviewNoUpgrade`. This creates a drift that is expected to fail `hack/verify-payload-featuregates.sh` (regen + diff) and/or unintentionally enable the gate for Default clusters.

### Issue Context
- Feature gate registry is in `features/features.go`.
- Payload featuregate manifests are expected to be generated from `features.AllFeatureSets()` (see `hack/verify-payload-featuregates.sh`).

### Fix Focus Areas
- payload-manifests/featuregates/featureGate-Hypershift-Default.yaml[125-142]
- payload-manifests/featuregates/featureGate-SelfManagedHA-Default.yaml[130-146]
- features/features.go[653-667]
- hack/verify-payload-featuregates.sh[5-10]

### Expected fix
Option A (recommended): remove `KMSEncryption` from the Default payload manifests and regenerate via `hack/update-payload-featuregates.sh`.

Option B: if Default is intended, add `configv1.Default` to `FeatureGateKMSEncryption.enableIn(...)` and regenerate manifests + update docs accordingly.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

- identity
- aescbc
- aesgcm
- KMS

Choose a reason for hiding this comment

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

Action required

1. kmsencryption tests missing 📘 Rule violation ⛯ Reliability

This PR introduces the KMSEncryption FeatureGate and changes the APIServer TechPreviewNoUpgrade
CRD schema to no longer allow type: KMS, but the existing validation tests still only target
KMSEncryptionProvider. Without adding/updating tests for the new gate and updated schema, these
API changes risk going unvalidated and regressing.
Agent Prompt
## Issue description
The PR changes the APIServer encryption schema behavior (TechPreviewNoUpgrade CRD no longer allows `type: KMS`) and introduces a new FeatureGate (`KMSEncryption`), but the validation tests under `config/v1/tests/apiservers.config.openshift.io/` still only cover `KMSEncryptionProvider`.

## Issue Context
Per compliance, API/CRD changes must be accompanied by corresponding integration/validation tests under the API group's `tests/` directory.

## Fix Focus Areas
- features/features.go[653-667]
- config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-TechPreviewNoUpgrade.crd.yaml[157-183]
- config/v1/tests/apiservers.config.openshift.io/KMSEncryptionProvider.yaml[1-20]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@bertinatto bertinatto force-pushed the kms-tp-v1-4.21 branch 2 times, most recently from c0f5796 to e8e8195 Compare March 3, 2026 21:53
productScope(ocpSpecific).
enhancementPR("https://github.com/openshift/enhancements/pull/1682").
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
enableIn(configv1.DevPreviewNoUpgrade).
Copy link
Member Author

Choose a reason for hiding this comment

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

Do we want to do this in 4.21 as well? Or should we just introduce KMSEncryption?

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 3, 2026

@bertinatto: 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/verify-crdify a2258d5 link true /test verify-crdify
ci/prow/verify-crd-schema a2258d5 link true /test verify-crd-schema

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

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants