Skip to content

WIP: NO-JIRA: add kms plugin status#2850

Open
tjungblu wants to merge 1 commit into
openshift:masterfrom
tjungblu:kms_internal_status
Open

WIP: NO-JIRA: add kms plugin status#2850
tjungblu wants to merge 1 commit into
openshift:masterfrom
tjungblu:kms_internal_status

Conversation

@tjungblu
Copy link
Copy Markdown
Contributor

@tjungblu tjungblu commented May 20, 2026

This API allows us to track the plugin health status and key rotation details much better than using status conditions.

work in progress for the time being...

/hold

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

@tjungblu: This pull request explicitly references no jira issue.

Details

In response to this:

This API allows us to track the plugin health status and key rotation details much better than using status conditions.

work in progress for the time being...

/hold

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 20, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This pull request adds KMS encryption status reporting to the APIServer resource. It introduces new Go types in config/v1/types_apiserver.go: a KMSPluginHealthStatus enum, a KMSPluginHealthReport struct for per-node probe details, a KMSPluginRotationStatus struct for KEK lifecycle timestamps, and an APIServerEncryptionStatus aggregation. APIServerStatus gains an EncryptionStatus field under the KMSEncryption feature gate. The APIServer CRD schemas (CustomNoUpgrade, DevPreviewNoUpgrade, TechPreviewNoUpgrade) are updated to validate status.encryptionStatus.healthReports (atomic, maxItems: 100) and status.encryptionStatus.keyRotationStatus (atomic, maxItems: 3).

🚥 Pre-merge checks | ✅ 12
✅ Passed checks (12 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding KMS plugin status to the APIServer configuration types and CRD schemas.
Description check ✅ Passed The description explains the purpose of the changes (tracking KMS plugin health and key rotation) and is directly related to the changeset.
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 PR contains no Ginkgo tests. Check modifies only API type definitions and CRD schemas, which are not subject to this test naming convention rule.
Test Structure And Quality ✅ Passed PR contains no test code (only Go types and YAML CRD definitions). Custom check requires reviewing Ginkgo tests, which are not present and therefore not applicable to this PR.
Microshift Test Compatibility ✅ Passed No Ginkgo e2e tests are present in this PR. The changes consist only of API type definitions and CRD schema updates, not test code. Check is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No Ginkgo e2e tests are added in this PR. Changes are limited to API type definitions and CRD schema updates, which are not subject to SNO test compatibility checks.
Topology-Aware Scheduling Compatibility ✅ Passed PR adds KMS status types to APIServerStatus; no deployment manifests, operator code, or scheduling constraints affecting topology compatibility.
Ote Binary Stdout Contract ✅ Passed This PR contains only type definitions and CRD manifests with no executable code. The OTE Binary Stdout Contract check is inapplicable as this is not a binary/executable repository.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed This PR adds no Ginkgo e2e tests—only type definitions and CRD schemas. The IPv6/disconnected network test check is not applicable.

✏️ 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 do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels May 20, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 20, 2026

Hello @tjungblu! 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.

@openshift-ci openshift-ci Bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label May 20, 2026
@openshift-ci openshift-ci Bot requested review from JoelSpeed and everettraven May 20, 2026 11:48
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 20, 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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

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 `@config/v1/types_apiserver.go`:
- Around line 336-339: APIServerStatus.EncryptionStatus is encoded with
omitempty but missing the +optional marker and omitted-field documentation;
update the APIServerStatus type to add a `+optional` comment above the
EncryptionStatus field and a short doc comment describing the omitted behavior
(e.g., that when EncryptionStatus is omitted the server's encryption state is
unknown/default and consumers should treat it as not set), referencing the
EncryptionStatus field and its type APIServerEncryptionStatus so readers can
find the expected values.
🪄 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 YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 83c30676-7543-40be-aa25-54d34803f553

📥 Commits

Reviewing files that changed from the base of the PR and between dcaca8e and 640b0f1.

⛔ Files ignored due to path filters (7)
  • config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-CustomNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-DevPreviewNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-TechPreviewNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • config/v1/zz_generated.deepcopy.go is excluded by !**/zz_generated*
  • config/v1/zz_generated.featuregated-crd-manifests/apiservers.config.openshift.io/KMSEncryption.yaml is excluded by !**/zz_generated.featuregated-crd-manifests/**
  • config/v1/zz_generated.swagger_doc_generated.go is excluded by !**/zz_generated*
  • openapi/generated_openapi/zz_generated.openapi.go is excluded by !openapi/**, !**/zz_generated*
📒 Files selected for processing (4)
  • config/v1/types_apiserver.go
  • payload-manifests/crds/0000_10_config-operator_01_apiservers-CustomNoUpgrade.crd.yaml
  • payload-manifests/crds/0000_10_config-operator_01_apiservers-DevPreviewNoUpgrade.crd.yaml
  • payload-manifests/crds/0000_10_config-operator_01_apiservers-TechPreviewNoUpgrade.crd.yaml

Comment thread config/v1/types_apiserver.go
Comment thread config/v1/types_apiserver.go Outdated
Comment thread config/v1/types_apiserver.go Outdated
Comment thread config/v1/types_apiserver.go Outdated
// +openshift:enable:FeatureGate=KMSEncryption
type APIServerEncryptionStatus struct {
// HealthReports contains all KMS plugin health reports for this APIServer.
// +listType=atomic
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

could also be a map over (KeyId, NodeName), not sure we have support for composite keys here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

or alternatively only KeyId, that way we have everything aggregated nicely for the key rotation feature

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

in the current conditions based design it is actually a map type over the NodeName.

@tjungblu tjungblu force-pushed the kms_internal_status branch from 640b0f1 to dd92146 Compare May 20, 2026 12:54
@openshift-ci openshift-ci Bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 20, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 8

🧹 Nitpick comments (2)
config/v1/types_apiserver.go (2)

281-311: 💤 Low value

Document MaxLength constraints in field comments.

Per coding guidelines, +kubebuilder:validation:MaxLength markers should be documented. Fields keyId (2048 chars), nodeName (1024 chars), and kekId (1024 chars) have length constraints that aren't mentioned in their comments. This helps API consumers understand validation limits.

🤖 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 `@config/v1/types_apiserver.go` around lines 281 - 311, The struct
KMSPluginHealthReport has +kubebuilder:validation:MaxLength annotations but the
field comments don't mention those limits; update the comments for KeyId,
NodeName, and KEKId to include their max lengths (KeyId: 2048, NodeName: 1024,
KEKId: 1024) so API consumers see the validation constraints (edit the comments
above the KeyId, NodeName and KEKId fields in KMSPluginHealthReport to append
the respective max-length information).

337-339: ⚖️ Poor tradeoff

Consider adding MaxItems constraint on healthReports.

Unlike keyRotationStatus (capped at 3), healthReports has no upper bound. In large clusters with many nodes, this list could grow significantly, potentially bloating the status object. Consider adding a reasonable limit (e.g., based on max supported nodes × plugins).

🤖 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 `@config/v1/types_apiserver.go` around lines 337 - 339, The HealthReports slice
(HealthReports []KMSPluginHealthReport) currently has no upper bound and can
grow unbounded; add a MaxItems constraint (kubebuilder/k8s validation tag) to
cap the list size (choose a sensible limit informed by max supported nodes ×
plugins, e.g., similar rationale to keyRotationStatus which is capped at 3) so
the APIServer status cannot be bloated; update the struct tag/comment for
HealthReports (and document the chosen limit) to use
+kubebuilder:validation:MaxItems=<N> referencing HealthReports and
KMSPluginHealthReport.
🤖 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 `@config/v1/types_apiserver.go`:
- Around line 318-319: Fix the garbled comment text "DiscovdiscoveryTimeeryTime"
by replacing it with a clear identifier such as "DiscoveryTime" (or
"discoveryTime" if following lowerCamelCase for field comments) so the comment
reads: "DiscoveryTime contains the time when the operator has detected a change
in the status key ID, determined by all nodes agreeing on the same KEKid or when
a key has been initially discovered." Update the comment near the corresponding
type/field in types_apiserver.go to match the project's comment casing
conventions.

In
`@payload-manifests/crds/0000_10_config-operator_01_apiservers-CustomNoUpgrade.crd.yaml`:
- Around line 741-746: The description for the discoveryTime field contains a
duplicated-typo "DiscovdiscoveryTimeeryTime"; update the discoveryTime
description to fix the typo and make the sentence readable (e.g., start with
"DiscoveryTime contains the time..." and keep the rest of the text about
operator detection of keyId/KEKid agreement and use for key convergence/cache
invalidation). Ensure you edit the description value belonging to the
discoveryTime field in the CRD so the typo is removed and punctuation/spacing
remain correct.

In
`@payload-manifests/crds/0000_10_config-operator_01_apiservers-Default.crd.yaml`:
- Around line 417-421: The description for the CRD field discoveryTime contains
a garbled word "DiscovdiscoveryTimeeryTime"; update the YAML description to a
correct sentence (e.g., "discoveryTime contains the time when the operator has
detected a change in the status keyId...") and also fix the originating Go
source comment/const that generated this CRD (the struct/field comment for
DiscoveryTime) so the corrected text persists when CRDs are regenerated; after
fixing the Go comment, regenerate the CRD manifests to ensure the cleaned
description replaces the garbled text.
- Around line 399-403: The schema for the "status" field in the Default and OKD
variants is missing the enum constraint present in other variants; update the
CRD definitions for the "status" property (the "status" key under the respective
spec/status sections for the Default and OKD variants) to include the same enum:
["", "healthy", "unhealthy"] as used by
CustomNoUpgrade/DevPreviewNoUpgrade/TechPreviewNoUpgrade, or alternatively
remove the encryptionStatus field consistently from the non-KMS-enabled
variants—ensure the change is applied to the "status" property in both Default
and OKD manifest blocks (matching the exact property name "status" and keeping
maxLength/type consistent).

In
`@payload-manifests/crds/0000_10_config-operator_01_apiservers-DevPreviewNoUpgrade.crd.yaml`:
- Around line 741-746: Fix the typo in the CRD description for the discoveryTime
field: replace the garbled "DiscovdiscoveryTimeeryTime" with a correct, single
phrase such as "discoveryTime contains the time when the operator has detected a
change in the status keyId..." in the description of the discoveryTime property
so the text reads clearly; update the description under the discoveryTime schema
entry (symbol: discoveryTime) to the corrected string.

In `@payload-manifests/crds/0000_10_config-operator_01_apiservers-OKD.crd.yaml`:
- Around line 417-421: The description for the discoveryTime field contains a
duplicated typo "DiscovdiscoveryTimeeryTime"; update the description string for
the discoveryTime field (the YAML property named discoveryTime) to a single
correct word, e.g., "DiscoveryTime contains the time when the operator..." so
the sentence reads normally and remove the duplicated fragment.
- Around line 399-403: The CRD schema for the apiservers-OKD resource is missing
the enum constraint on the status property; update the status property in the
CRD (the status field under the schema block) to include the same enum array
used in the Default/feature-gated CRD so validation is consistent—add an enum:
[...] entry with the exact same status values as the Default CRD's status enum.

In
`@payload-manifests/crds/0000_10_config-operator_01_apiservers-TechPreviewNoUpgrade.crd.yaml`:
- Around line 741-746: The description for the CRD field discoveryTime contains
a duplicated/garbled word "DiscovdiscoveryTimeeryTime"; update the description
of the discoveryTime field to a clean sentence (e.g., "discoveryTime contains
the time when the operator has detected a change in the status keyId..."),
preserving the rest of the text, formatting and the date-time format; modify the
description under the discoveryTime property in the CRD (field name:
discoveryTime) to remove the typo and ensure it reads correctly.

---

Nitpick comments:
In `@config/v1/types_apiserver.go`:
- Around line 281-311: The struct KMSPluginHealthReport has
+kubebuilder:validation:MaxLength annotations but the field comments don't
mention those limits; update the comments for KeyId, NodeName, and KEKId to
include their max lengths (KeyId: 2048, NodeName: 1024, KEKId: 1024) so API
consumers see the validation constraints (edit the comments above the KeyId,
NodeName and KEKId fields in KMSPluginHealthReport to append the respective
max-length information).
- Around line 337-339: The HealthReports slice (HealthReports
[]KMSPluginHealthReport) currently has no upper bound and can grow unbounded;
add a MaxItems constraint (kubebuilder/k8s validation tag) to cap the list size
(choose a sensible limit informed by max supported nodes × plugins, e.g.,
similar rationale to keyRotationStatus which is capped at 3) so the APIServer
status cannot be bloated; update the struct tag/comment for HealthReports (and
document the chosen limit) to use +kubebuilder:validation:MaxItems=<N>
referencing HealthReports and KMSPluginHealthReport.
🪄 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 YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: cbb7b355-d5a7-4a82-8636-c48a980feb40

📥 Commits

Reviewing files that changed from the base of the PR and between 640b0f1 and dd92146.

⛔ Files ignored due to path filters (11)
  • config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-CustomNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-Default.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-DevPreviewNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-OKD.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-TechPreviewNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • config/v1/zz_generated.deepcopy.go is excluded by !**/zz_generated*
  • config/v1/zz_generated.featuregated-crd-manifests/apiservers.config.openshift.io/AAA_ungated.yaml is excluded by !**/zz_generated.featuregated-crd-manifests/**
  • config/v1/zz_generated.featuregated-crd-manifests/apiservers.config.openshift.io/KMSEncryption.yaml is excluded by !**/zz_generated.featuregated-crd-manifests/**
  • config/v1/zz_generated.featuregated-crd-manifests/apiservers.config.openshift.io/TLSAdherence.yaml is excluded by !**/zz_generated.featuregated-crd-manifests/**
  • config/v1/zz_generated.swagger_doc_generated.go is excluded by !**/zz_generated*
  • openapi/generated_openapi/zz_generated.openapi.go is excluded by !openapi/**, !**/zz_generated*
📒 Files selected for processing (6)
  • config/v1/types_apiserver.go
  • payload-manifests/crds/0000_10_config-operator_01_apiservers-CustomNoUpgrade.crd.yaml
  • payload-manifests/crds/0000_10_config-operator_01_apiservers-Default.crd.yaml
  • payload-manifests/crds/0000_10_config-operator_01_apiservers-DevPreviewNoUpgrade.crd.yaml
  • payload-manifests/crds/0000_10_config-operator_01_apiservers-OKD.crd.yaml
  • payload-manifests/crds/0000_10_config-operator_01_apiservers-TechPreviewNoUpgrade.crd.yaml

Comment thread config/v1/types_apiserver.go Outdated
Comment thread payload-manifests/crds/0000_10_config-operator_01_apiservers-Default.crd.yaml Outdated
Comment thread payload-manifests/crds/0000_10_config-operator_01_apiservers-Default.crd.yaml Outdated
Comment thread payload-manifests/crds/0000_10_config-operator_01_apiservers-OKD.crd.yaml Outdated
Comment thread payload-manifests/crds/0000_10_config-operator_01_apiservers-OKD.crd.yaml Outdated
@tjungblu tjungblu force-pushed the kms_internal_status branch from dd92146 to 363baa7 Compare May 20, 2026 13:08
@openshift-ci openshift-ci Bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels May 20, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (3)
config/v1/types_apiserver.go (3)

281-313: ⚡ Quick win

Missing compatibility annotation and length constraint documentation.

This is a new stable v1 API type but lacks the required +openshift:compatibility-gen:level=1 annotation. Additionally, per coding guidelines, +kubebuilder:validation:MaxLength markers should be documented in field comments.

Suggested changes
+// +openshift:compatibility-gen:level=1
 type KMSPluginHealthReport struct {
-	// keyId is the encryption-key-secret id (kms-{keyId}.sock), a unique identifier of the plugin on that node.
-	// This is not a cryptographic key used to encrypt/decrypt any resources.
+	// keyId is the encryption-key-secret id (kms-{keyId}.sock), a unique identifier of the plugin on that node.
+	// This is not a cryptographic key used to encrypt/decrypt any resources.
+	// The value must be at most 512 characters.
 	// +kubebuilder:validation:MaxLength=512
 	// +required
 	KeyId string `json:"keyId"`

-	// nodeName is the name of the node this instance of the plugin runs on.
-	// The combination of NodeName/KeyId makes this health report unique.
+	// nodeName is the name of the node this instance of the plugin runs on.
+	// The combination of NodeName/KeyId makes this health report unique.
+	// The value must be at most 512 characters.
 	// +kubebuilder:validation:MaxLength=512
 	// +required
 	NodeName string `json:"nodeName"`

As per coding guidelines, "New Stable APIs (v1) must include the kubebuilder annotation +openshift:compatibility-gen:level=1" and "Documentation for +kubebuilder:validation:MaxLength markers must document character length constraints."

🤖 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 `@config/v1/types_apiserver.go` around lines 281 - 313, Add the required
stability annotation and document the MaxLength constraints: add the kubebuilder
compatibility marker `+openshift:compatibility-gen:level=1` above the
KMSPluginHealthReport type declaration, and update the field comments for KeyId,
NodeName, KEKId, and Detail to explicitly state the character length limits
referenced by their `+kubebuilder:validation:MaxLength` tags (e.g., "Maximum X
characters.") so the MaxLength markers are documented in the field comments.

337-347: ⚡ Quick win

Missing +optional markers and compatibility annotation.

Both HealthReports and KeyRotationStatus fields use omitempty but lack explicit +optional markers and omission behavior documentation. The struct also needs the +openshift:compatibility-gen:level=1 annotation for v1 stable APIs.

Suggested changes
+// +openshift:compatibility-gen:level=1
 type APIServerEncryptionStatus struct {
 	// healthReports contains all KMS plugin health reports for this APIServer.
+	// When omitted, no health reports are available.
+	// +optional
 	// +listType=atomic
 	HealthReports []KMSPluginHealthReport `json:"healthReports,omitempty"`

 	// keyRotationStatus contains the status of the last three key rotations that were running.
-	//
+	// When omitted, no key rotations have been recorded.
+	// The list is limited to the 3 most recent rotation records.
+	// +optional
 	// +kubebuilder:validation:MaxItems=3
 	// +listType=atomic
 	KeyRotationStatus []KMSPluginRotationStatus `json:"keyRotationStatus,omitempty"`
 }

As per coding guidelines, "Documentation for +optional fields must explain the behavior when the field is omitted" and "Documentation for +kubebuilder:validation:MaxItems markers must document item count ranges."

🤖 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 `@config/v1/types_apiserver.go` around lines 337 - 347, Add the missing API
docs and markers to APIServerEncryptionStatus: annotate the struct with
+openshift:compatibility-gen:level=1, add +optional above both HealthReports and
KeyRotationStatus, and update their doc comments to explain omission behavior
(what happens when the field is nil/omitted) and to document the allowed item
count range for KeyRotationStatus in relation to
+kubebuilder:validation:MaxItems=3; locate the APIServerEncryptionStatus type
and adjust the comments for HealthReports and KeyRotationStatus accordingly.

315-335: ⚡ Quick win

Missing validation markers on KEKId and compatibility annotation.

  1. KEKId lacks +required marker and +kubebuilder:validation:MaxLength constraint. For consistency with KMSPluginHealthReport.KEKId (which has MaxLength=1024), consider adding similar validation.

  2. Missing +openshift:compatibility-gen:level=1 for this v1 stable API type.

  3. DiscoveryTime is marked +optional but doesn't explain the behavior when omitted.

Suggested changes
+// +openshift:compatibility-gen:level=1
 type KMSPluginRotationStatus struct {
 	// kekId refers to the remote KEK id from KMS v2 StatusResponse.key_id.
 	// This id can change externally and tells OpenShift when to trigger a migration of the configured resources.
+	// +kubebuilder:validation:MaxLength=1024
+	// +required
 	KEKId string `json:"kekId"`

 	// discoveryTime contains the time when the operator has detected a change in the status keyId, this
 	// is determined by all nodes agreeing on the same KEKid or when a key has been initially discovered.
 	// This can be used to give additional time for key convergence or cache invalidation before a migration is started.
+	// When omitted, the key discovery time has not yet been recorded.
 	// +optional
 	DiscoveryTime *metav1.Time `json:"discoveryTime,omitempty"`

As per coding guidelines, "Documentation for +optional fields must explain the behavior when the field is omitted."

🤖 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 `@config/v1/types_apiserver.go` around lines 315 - 335, KMSPluginRotationStatus
is missing validation and compatibility annotations: add a +required marker and
a +kubebuilder:validation:MaxLength=1024 tag on the KEKId field (matching
KMSPluginHealthReport.KEKId), add the +openshift:compatibility-gen:level=1
annotation above the KMSPluginRotationStatus type, and update the DiscoveryTime
field comment to explain behavior when omitted (e.g., that omission means no KEK
change has been observed or that discovery time is unknown and will be set when
a change is detected).
🤖 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.

Nitpick comments:
In `@config/v1/types_apiserver.go`:
- Around line 281-313: Add the required stability annotation and document the
MaxLength constraints: add the kubebuilder compatibility marker
`+openshift:compatibility-gen:level=1` above the KMSPluginHealthReport type
declaration, and update the field comments for KeyId, NodeName, KEKId, and
Detail to explicitly state the character length limits referenced by their
`+kubebuilder:validation:MaxLength` tags (e.g., "Maximum X characters.") so the
MaxLength markers are documented in the field comments.
- Around line 337-347: Add the missing API docs and markers to
APIServerEncryptionStatus: annotate the struct with
+openshift:compatibility-gen:level=1, add +optional above both HealthReports and
KeyRotationStatus, and update their doc comments to explain omission behavior
(what happens when the field is nil/omitted) and to document the allowed item
count range for KeyRotationStatus in relation to
+kubebuilder:validation:MaxItems=3; locate the APIServerEncryptionStatus type
and adjust the comments for HealthReports and KeyRotationStatus accordingly.
- Around line 315-335: KMSPluginRotationStatus is missing validation and
compatibility annotations: add a +required marker and a
+kubebuilder:validation:MaxLength=1024 tag on the KEKId field (matching
KMSPluginHealthReport.KEKId), add the +openshift:compatibility-gen:level=1
annotation above the KMSPluginRotationStatus type, and update the DiscoveryTime
field comment to explain behavior when omitted (e.g., that omission means no KEK
change has been observed or that discovery time is unknown and will be set when
a change is detected).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: a879ebcf-cdc3-42be-83b3-29bd470dfc1d

📥 Commits

Reviewing files that changed from the base of the PR and between dd92146 and 363baa7.

⛔ Files ignored due to path filters (7)
  • config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-CustomNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-DevPreviewNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-TechPreviewNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • config/v1/zz_generated.deepcopy.go is excluded by !**/zz_generated*
  • config/v1/zz_generated.featuregated-crd-manifests/apiservers.config.openshift.io/KMSEncryption.yaml is excluded by !**/zz_generated.featuregated-crd-manifests/**
  • config/v1/zz_generated.swagger_doc_generated.go is excluded by !**/zz_generated*
  • openapi/generated_openapi/zz_generated.openapi.go is excluded by !openapi/**, !**/zz_generated*
📒 Files selected for processing (4)
  • config/v1/types_apiserver.go
  • payload-manifests/crds/0000_10_config-operator_01_apiservers-CustomNoUpgrade.crd.yaml
  • payload-manifests/crds/0000_10_config-operator_01_apiservers-DevPreviewNoUpgrade.crd.yaml
  • payload-manifests/crds/0000_10_config-operator_01_apiservers-TechPreviewNoUpgrade.crd.yaml

@tjungblu tjungblu force-pushed the kms_internal_status branch 2 times, most recently from 74b0656 to a055c87 Compare May 20, 2026 13:59
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

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 `@config/v1/types_apiserver.go`:
- Around line 270-303: Update the documentation for the KMSPluginHealthStatus
type and the Status field on KMSPluginHealthReport to explicitly list each
allowed enum value and its meaning ("" (empty string) — allowed when the
KMSEncryption feature gate is disabled or not set; "healthy" — plugin is
operational and responding; "unhealthy" — plugin is present but not functioning
correctly; "error" — plugin returned an error state), and also document the
kubebuilder length constraints on the Status field (MinLength=1, MaxLength=10)
so the API contract is self-contained; make these changes in the comments above
the KMSPluginHealthStatus type declaration and the Status field in
KMSPluginHealthReport and reference the featureGate=KMSEncryption behavior
described by the FeatureGateAwareEnum marker.
🪄 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 YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: cf242cfa-4792-4dd0-bd6f-dfe1cd336e70

📥 Commits

Reviewing files that changed from the base of the PR and between 74b0656 and a055c87.

⛔ Files ignored due to path filters (7)
  • config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-CustomNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-DevPreviewNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-TechPreviewNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • config/v1/zz_generated.deepcopy.go is excluded by !**/zz_generated*
  • config/v1/zz_generated.featuregated-crd-manifests/apiservers.config.openshift.io/KMSEncryption.yaml is excluded by !**/zz_generated.featuregated-crd-manifests/**
  • config/v1/zz_generated.swagger_doc_generated.go is excluded by !**/zz_generated*
  • openapi/generated_openapi/zz_generated.openapi.go is excluded by !openapi/**, !**/zz_generated*
📒 Files selected for processing (4)
  • config/v1/types_apiserver.go
  • payload-manifests/crds/0000_10_config-operator_01_apiservers-CustomNoUpgrade.crd.yaml
  • payload-manifests/crds/0000_10_config-operator_01_apiservers-DevPreviewNoUpgrade.crd.yaml
  • payload-manifests/crds/0000_10_config-operator_01_apiservers-TechPreviewNoUpgrade.crd.yaml

Comment thread config/v1/types_apiserver.go
@tjungblu tjungblu force-pushed the kms_internal_status branch 2 times, most recently from 00e61ed to 8ae83ee Compare May 20, 2026 14:30
This API allows us to track the plugin health status and key rotation
details much better than using status conditions.

Signed-off-by: Thomas Jungblut <tjungblu@redhat.com>
@tjungblu tjungblu force-pushed the kms_internal_status branch from 8ae83ee to a0df76f Compare May 21, 2026 08:16
@openshift-ci openshift-ci Bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 21, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 21, 2026

@tjungblu: 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/lint a0df76f link true /test lint
ci/prow/verify-crd-schema a0df76f link true /test verify-crd-schema
ci/prow/verify a0df76f link true /test verify

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/hold Indicates that a PR should not merge because someone has issued a /hold command. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants