-
Notifications
You must be signed in to change notification settings - Fork 897
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
Support multiple XR versions for handling breaking API changes #2762
Comments
Thanks for raising this @samidbb! We currently don't really support multiple versions - technically we do but both versions must have identical schemas so it's not very useful. #2608 tracks improving that. One thing to note is that the way Kubernetes handles multiple versions is sometimes a bit surprising - you wouldn't actually need to delete the old (v1alpha1) version and create a new (v1alpha2) version. When you teach Crossplane/Kubernetes about a new version the resource exists at both versions simultaneously - it helps to think about it as adding a new API version that's accessing the same underlying data. |
To more directly answer your question - no you're not missing anything. This is just something we don't yet support in Crossplane. We'd like to though. I believe it will be critical. In the meantime, a workaround would be:
This has some downsides - region effectively becomes optional - but allows you to rename without a breaking change until we support them. |
I couldn't really get it to work unfortunately. What it doesn't work for me is the following:
|
@samidbb I'm not following. Are you seeing the two issues you reported when you create an XRD with two identical schemas? As I mentioned above, we don't support multiple different schemas yet per #2608. My most recent comment was suggesting a way to achieve the change you want to make in a backward compatible way so you can do so without introducing a new version. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Crossplane does not currently have enough maintainers to address every issue and pull request. This issue has been automatically marked as |
/fresh I believe this is still relevant as part of supporting effective composition revisions |
Crossplane does not currently have enough maintainers to address every issue and pull request. This issue has been automatically marked as |
/fresh multiple XRD versions with different schemas are still desired enhancements |
This would be a critical feature for us. It is obvious that schemas/APIs will evolve over time. Not having the chance to implement a stable versioning strategy and running different versions in parallel makes the whole thing pretty useless. Kubernetes already provides that possibility. So I would expect that Crossplane does, too. |
This is a duplicate of #2608 - let's discuss this there. |
What problem are you facing?
I have a composite resource called XAWSBucket. and when a claim deployed to my cluster it should provision a bucket on AWS in repsonse.
Here is the XRD:
the composition:
And the claim:
Then I decide to rename locationConstraint field to region. And I consider this to be a breaking change because it requires users to change their claim manifests.
So I add a new schema version to my XRD with the updated field name and a new composition.
Here is my updated XRD:
Here is the added composition:
and the claim for v1alpha2 schema:
So the migration path for the v1alpha1 composite resources will involve the following steps:
Following behavior should be supported:
The problems
When I run kubectl describe composite I can see that there is an error/warning:
v1alpha2 claims run without issues.
How could Crossplane help solve your problem?
Is there anything I'm missing? We want to understand if multiple version can be run like this or is there a better way to handle breaking changes in the API schema?
The text was updated successfully, but these errors were encountered: