Skip to content

✨ (deps): import kubernetes-sigs/crdify for performing CRD upgrade safety checks #2054

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

everettraven
Copy link
Contributor

Description

Removes all custom CRD upgrade pre-flight check validations in favor of importing validation logic from kubernetes-sigs/crdify.

This allows OLM to stay consistent with what is deemed "safe" by an more formal library that performs validation checks. As was the previous behavior, OLM configures the validation to be as strict as reasonably possible and to continue failing closed on unhandled changes.

While it is still possible to implement custom validations with this approach (by adding them to the registry), it would be awesome to see OLM maintainers get involved in discussions with the maintainers of kubernetes-sigs/crdify and contribute new validations there first and pull them in through dependency updates.

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

@everettraven everettraven requested a review from a team as a code owner June 26, 2025 17:12
Copy link

netlify bot commented Jun 26, 2025

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit fe34799
🔍 Latest deploy log https://app.netlify.com/projects/olmv1/deploys/685d89fe3df18a0008cc36e9
😎 Deploy Preview https://deploy-preview-2054--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

codecov bot commented Jun 26, 2025

Codecov Report

Attention: Patch coverage is 75.00000% with 18 lines in your changes missing coverage. Please review.

Project coverage is 72.47%. Comparing base (a449fc4) to head (fe34799).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ak/preflights/crdupgradesafety/crdupgradesafety.go 75.00% 14 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2054      +/-   ##
==========================================
- Coverage   73.82%   72.47%   -1.35%     
==========================================
  Files          81       77       -4     
  Lines        7365     7056     -309     
==========================================
- Hits         5437     5114     -323     
- Misses       1588     1600      +12     
- Partials      340      342       +2     
Flag Coverage Δ
e2e 45.03% <31.94%> (+0.96%) ⬆️
unit 58.27% <75.00%> (-1.97%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@everettraven everettraven force-pushed the dep/use-crdify-for-crd-checks branch from 390e72a to d486316 Compare June 26, 2025 17:55
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 26, 2025
…ty checks

Signed-off-by: Bryce Palmer <bpalmer@redhat.com>
@everettraven everettraven force-pushed the dep/use-crdify-for-crd-checks branch from d486316 to fe34799 Compare June 26, 2025 17:57
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 26, 2025
@tmshort
Copy link
Contributor

tmshort commented Jun 26, 2025

/approve
Looks OK to me, but I'm not too familiar with the code in question.

The primary purpose seems to replace github.com/openshift/crd-schema-checker with k8s-sigs/crdify?

Copy link

openshift-ci bot commented Jun 26, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tmshort

The full list of commands accepted by this bot can be found here.

The pull request process is described here

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, 2025
@grokspawn
Copy link
Contributor

Hi @everettraven !
This looks like it supplants #2010. Confirm/deny?

@everettraven
Copy link
Contributor Author

Hi @everettraven ! This looks like it supplants #2010. Confirm/deny?

Deny. #2010 is for the check in CI that runs against the OLMv1 APIs. This PR imports it for use within OLMv1 for OLMv1's CRD upgrade safety check validations

@everettraven
Copy link
Contributor Author

The primary purpose seems to replace github.com/openshift/crd-schema-checker with k8s-sigs/crdify?

@tmshort The removal of github.com/openshift/crd-schema-checker is a side effect of removing the internal validation checks that we had that imported that library. k8s-sigs/crdify is a new sig-api-machinery subproject that got created to centralize the work that a few folks were doing related to CRD schema change validations.

The primary purpose is to have OLM stop using its own checks and instead use this centralized place where there is active development and discussion with sig-api-machinery folks on what rules should be codified when evaluating CRD schema changes for compatibility.

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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants