Skip to content
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

crddiff: Look up version by name, not array index #226

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

Conversation

chlunde
Copy link

@chlunde chlunde commented Jan 29, 2025

Description of your changes

When crddiff looked for a specific api version, it checked the new CRD
using array indexing. This fails for example when checking crossplane
1.16 to 1.17, where 1.16 has [v1beta1] and 1.17 has [v1, v1beta1]:

go run ./cmd/crddiff/ revision crossplane-1.16/cluster/crds/pkg.crossplane.io_functions.yaml crossplane-1.17/cluster/crds/pkg.crossplane.io_functions.yaml
crddiff: error: Failed to compute CRD breaking API changes: revision has no corresponding version to compare with the base for the version name: v1beta1

This does not fix a specific issue but makes itmore usable to compare
different versions of CRDs for provider and core crossplane releases.

I have:

  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

Unit test and against 1.16 -> 1.17 crossplane CRD diff.

When crddiff looked for a specific api version, it checked the new CRD
using array indexing. This fails for example when checking crossplane
1.16 to 1.17, where 1.16 has [v1beta1] and 1.17 has [v1, v1beta1]:

  go run ./cmd/crddiff/ revision crossplane-1.16/cluster/crds/pkg.crossplane.io_functions.yaml crossplane-1.17/cluster/crds/pkg.crossplane.io_functions.yaml
  crddiff: error: Failed to compute CRD breaking API changes: revision has no corresponding version to compare with the base for the version name: v1beta1

Signed-off-by: Carl Henrik Lunde <chlunde@ifi.uio.no>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant