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

fix(crds): add crd migration for locks.pkg.crossplane.io v1alpha1 #4447

Merged
merged 1 commit into from
Aug 4, 2023

Conversation

haarchri
Copy link
Contributor

@haarchri haarchri commented Aug 4, 2023

Description of your changes

add crd migration for locks.pkg.crossplane.io v1alpha1

background:
If you installed Crossplane prior to version v1.4.0, you would have the v1alpha1 version of locks.pkg.crossplane.io. However, starting from version v1.4.0, the storageVersion was updated to v1beta1, and drop for v1alpha1 was in version v1.11.0.

1.4.0 - Lock to v1beta1 and mark v1alpha1 as deprecated
#2537

v1.11.0 - Lock API v1alpha1 has been dropped
#3479

Fixes #4442

I have:

  • Read and followed Crossplane's contribution process.
  • Added or updated unit and E2E tests for my change.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.
  • Opened a PR updating the docs, if necessary.

create crossplane v1.3.2 -> upgrade to v1.7.0 -> upgrade to v1.12.2 (https://github.com/haarchri/crossplane-issue-4442)
and we can see the following issue:

crossplane: error: core.initCommand.Run(): cannot initialize core: cannot apply crd: cannot patch object: CustomResourceDefinition.apiextensions.k8s.io "locks.pkg.crossplane.io" is invalid: status.storedVersions[0]: Invalid value: "v1alpha1": must appear in spec.versions

we can see the following storedVersions:

kubectl get crd locks.pkg.crossplane.io -o json | jq '.status.storedVersions'
[
  "v1alpha1",
  "v1beta1"
]

hint: i tested also if migration from multiple crds is possible ;)

kubectl get crd compositionrevisions.apiextensions.crossplane.io -o json | jq '.status.storedVersions'
[
  "v1alpha1",
  "v1"
]

after this PR the result looks like:

kubectl get crd locks.pkg.crossplane.io -o json | jq '.status.storedVersions'                         
[
  "v1beta1"
]
kubectl get crd compositionrevisions.apiextensions.crossplane.io -o json | jq '.status.storedVersions'
[
  "v1"
]

Signed-off-by: Christopher Haar <christopher.haar@upbound.io>
@phisco phisco merged commit 6165d86 into crossplane:master Aug 4, 2023
16 of 17 checks passed
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.

lock CRD upgrade fail going from 1.7.0 to 1.12.2 or higher.
3 participants