Skip to content

OTA-1966: pkg/readiness/crd_compat: Drop unnecessary CustomResourceDefinition check#1415

Open
wking wants to merge 1 commit into
openshift:mainfrom
wking:drop-custom-resource-definition-compat-readiness-check
Open

OTA-1966: pkg/readiness/crd_compat: Drop unnecessary CustomResourceDefinition check#1415
wking wants to merge 1 commit into
openshift:mainfrom
wking:drop-custom-resource-definition-compat-readiness-check

Conversation

@wking

@wking wking commented Jun 26, 2026

Copy link
Copy Markdown
Member

We grew this check recently in b0e4c90 (#1395). But I don't think we need it. I agree with the guard, having a CRD with storage versions that were not served would be weird, and probably not what the CRD maintainers intended. But what would a cluster-admin be expected to do about it? There's nothing in the code I'm removing here, or in
https://github.com/openshift/agentic-skills as far as I can see, that turns stored version no longer served into an actionable plan.

In the CRD-evolution space, OpenShift packages the Kube storage-version migrator. But we don't run the trigger logic. And, as far as I can tell, the migration operator isn't checking to see if any StorageVersionMigrations are completed. I expect that, if OpenShift ever decides to remove support for a previously-stored version, we'll set up something to run (and require the completion of) a StorageVersionMigration to ensure storage is off the outgoing version before we leave the last release where it was served. So that would protect OpenShift users from OpenShift-managed CRD evolution, without needing the guard I'm deleting.

In addition to OpenShift-managed CRDs, there might be many CRDs on an OpenShift cluster that are not part of the OpenShift release payload. They may have been installed by OLM-installed operators. They may have been installed by individual cluster users running oc apply .... Lots of other folks who could be maintaining CRDs on the cluster. We don't want to confuse admins who are considering an OpenShift version update by any issues that might be going on with those non-OpenShift CRDs.

Summary by CodeRabbit

  • Bug Fixes

    • Simplified readiness reporting by removing the CRD compatibility check from the readiness check set.
    • Updated readiness output expectations to reflect one fewer check being reported.
  • Tests

    • Adjusted test coverage and fixtures to match the new readiness behavior.
    • Removed CRD compatibility-specific test cases and updated total check counts from 9 to 8.

…heck

We grew this check recently in b0e4c90 (pkg/readiness: Add
readiness checks and wire into proposal controller, 2026-05-27, openshift#1395).
But I don't think we need it.  I agree with the guard, that having a
CRD with storage versions that were not served would be weird, and
probably not what the CRD maintainers intended.  But what would a
cluster-admin be expected to do about it?  There's nothing in the code
I'm removing here, or in https://github.com/openshift/agentic-skills
as far as I can see, that turns "stored version no longer served" into
an actionable plan.

In the CRD-evolution space, OpenShift packages the Kube
storage-version migrator.  But we don't run the trigger logic [1].
And, as far as I can tell, the migration operator isn't checking to
see if any StorageVersionMigrations are completed [2].  I expect that,
if OpenShift ever decides to remove support for a previously-stored
version, we'll set up something to run (and require the completion of)
a StorageVersionMigration to ensure storage is off the outgoing
version before we leave the last release where it was served.  So that
would protect OpenShift users from OpenShift-managed CRD evolution,
without needing the guard I'm deleting

In addition to OpenShift-managed CRDs, there might be many CRDs on an
OpenShift cluster that are not part of the OpenShift release payload.
They may have been installed by OLM-installed operators.  They may
have been installed by individual cluster users running 'oc apply
...'.  Lots of other folks who could be maintaining CRDs on the
cluster.  We don't want to confuse admins who are considering an
OpenShift version update by any issues that might be going on with
those non-OpenShift CRDs.

[1]: openshift/cluster-kube-storage-version-migrator-operator@807c909#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R7
[2]: https://github.com/kubernetes-sigs/kube-storage-version-migrator/blob/master/USER_GUIDE.md#check-if-migration-has-completed
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jun 26, 2026
@openshift-ci-robot

openshift-ci-robot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

@wking: This pull request references OTA-1966 which is a valid jira issue.

Details

In response to this:

We grew this check recently in b0e4c90 (#1395). But I don't think we need it. I agree with the guard, having a CRD with storage versions that were not served would be weird, and probably not what the CRD maintainers intended. But what would a cluster-admin be expected to do about it? There's nothing in the code I'm removing here, or in
https://github.com/openshift/agentic-skills as far as I can see, that turns stored version no longer served into an actionable plan.

In the CRD-evolution space, OpenShift packages the Kube storage-version migrator. But we don't run the trigger logic. And, as far as I can tell, the migration operator isn't checking to see if any StorageVersionMigrations are completed. I expect that, if OpenShift ever decides to remove support for a previously-stored version, we'll set up something to run (and require the completion of) a StorageVersionMigration to ensure storage is off the outgoing version before we leave the last release where it was served. So that would protect OpenShift users from OpenShift-managed CRD evolution, without needing the guard I'm deleting.

In addition to OpenShift-managed CRDs, there might be many CRDs on an OpenShift cluster that are not part of the OpenShift release payload. They may have been installed by OLM-installed operators. They may have been installed by individual cluster users running oc apply .... Lots of other folks who could be maintaining CRDs on the cluster. We don't want to confuse admins who are considering an OpenShift version update by any issues that might be going on with those non-OpenShift CRDs.

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

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Walkthrough

The PR removes the CRD compatibility readiness check from the readiness registry and updates tests and fixtures to expect one fewer readiness check and no crd_compat output.

Changes

Readiness compatibility check removal

Layer / File(s) Summary
Registry and GVR cleanup
pkg/readiness/check.go, pkg/readiness/client.go, pkg/readiness/crd_compat.go
AllChecks no longer registers CRDCompatCheck, and the CRD GroupVersionResource definition is removed.
Readiness test coverage updates
pkg/readiness/check_test.go, pkg/readiness/checks_test.go
AllChecks() expectations now use 8 checks, CRD compatibility test cases are removed, fake CRD fixtures are dropped, and RunAll assertions no longer expect crd_compat.
Consumer readiness assertions
pkg/proposal/controller_test.go, test/cvo/readiness.go
The proposal and CVO readiness tests stop setting up CRD compatibility data and update total-check expectations to 8.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 13 | ❌ 2

❌ Failed checks (2 warnings)

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.
Test Structure And Quality ⚠️ Warning TestGetProposals_WithReadinessData still expects total_checks and checks_ok to be 9, but RunAll() now has 8 checks. Update those aggregate assertions to 8 so the test matches the current readiness check set.
✅ Passed checks (13 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the removal of the CustomResourceDefinition readiness check and matches the main change.
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 Changed tests use static, descriptive titles; no dynamic or generated values appear in any touched Ginkgo test names.
Microshift Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; test/cvo/readiness.go only changes an assertion count, so MicroShift compatibility isn’t implicated.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the modified test/cvo tests only validate cluster state/counts and contain no SNO skip or multi-node-only assumptions.
Topology-Aware Scheduling Compatibility ✅ Passed PR only removes a readiness check and updates tests; it adds no manifests, controllers, or scheduling constraints to assess.
Ote Binary Stdout Contract ✅ Passed No touched main/init/TestMain/RunSpecs code writes to stdout; the PR only changes tests/library code, and searches found no fmt/klog/log stdout calls.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the only changed readiness test uses cluster-internal clients and adds no IPv4 or external connectivity assumptions.
No-Weak-Crypto ✅ Passed Changed files only remove CRD readiness code/tests; no MD5/SHA1/DES/RC4/3DES/Blowfish/ECB, custom crypto, or token comparisons found.
Container-Privileges ✅ Passed Touched files are Go readiness code/tests only; no container/K8s manifests or privilege settings (privileged, hostPID, hostNetwork, hostIPC, SYS_ADMIN, allowPrivilegeEscalation) appear.
No-Sensitive-Data-In-Logs ✅ Passed No new or changed logging was introduced in the touched files; the PR only removes the CRD check and updates tests.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci

openshift-ci Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: wking

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 Jun 26, 2026

@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/proposal/controller_test.go`:
- Around line 1359-1364: The aggregate readiness expectations in
controller_test.go are still asserting 9 checks even though the updated check
list in the readiness loop no longer includes crd_compat and RunAll() now
reports 8 total checks. Update the assertions around meta["total_checks"] and
meta["checks_ok"] to match the new 8-check aggregate, and verify the related
readiness metadata expectations stay consistent with the check names used in the
loop and RunAll().
🪄 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: 6d648dc8-afba-438c-8ecb-27c1a63781a5

📥 Commits

Reviewing files that changed from the base of the PR and between dd0a841 and f1868ad.

📒 Files selected for processing (7)
  • pkg/proposal/controller_test.go
  • pkg/readiness/check.go
  • pkg/readiness/check_test.go
  • pkg/readiness/checks_test.go
  • pkg/readiness/client.go
  • pkg/readiness/crd_compat.go
  • test/cvo/readiness.go
💤 Files with no reviewable changes (3)
  • pkg/readiness/client.go
  • pkg/readiness/crd_compat.go
  • pkg/readiness/check.go

Comment on lines 1359 to 1364
for _, name := range []string{
"cluster_conditions", "operator_health", "api_deprecations",
"node_capacity", "pdb_drain", "etcd_health", "network",
"crd_compat", "olm_operator_lifecycle",
"olm_operator_lifecycle",
} {
check, ok := checks[name].(map[string]any)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Update the aggregate readiness assertions to 8 as well.

This loop drops crd_compat, but the same test still expects meta["total_checks"] and meta["checks_ok"] to be 9 on Lines 1346-1350. RunAll() now reports 8 checks, so this test will fail even with the new check list.

🤖 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/proposal/controller_test.go` around lines 1359 - 1364, The aggregate
readiness expectations in controller_test.go are still asserting 9 checks even
though the updated check list in the readiness loop no longer includes
crd_compat and RunAll() now reports 8 total checks. Update the assertions around
meta["total_checks"] and meta["checks_ok"] to match the new 8-check aggregate,
and verify the related readiness metadata expectations stay consistent with the
check names used in the loop and RunAll().

@openshift-ci

openshift-ci Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

@wking: 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-agnostic-operator f1868ad link true /test e2e-agnostic-operator
ci/prow/unit f1868ad link true /test unit
ci/prow/e2e-agnostic-ovn-techpreview-serial-2of3 f1868ad link true /test e2e-agnostic-ovn-techpreview-serial-2of3
ci/prow/e2e-hypershift f1868ad link true /test e2e-hypershift
ci/prow/e2e-aws-ovn-techpreview f1868ad link true /test e2e-aws-ovn-techpreview

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. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants