Allow ResourceGraphDefinition authors to maintain serveral versions #577
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In the issue #482 I initially proposed a way that would allow RGD authors to declare multiple versions in their RGD. However, after trying to implement a POC I realized that providing this kind of support would make the implementation too complex, specially when handling changes in the resource graph. Besides, from a UX standpoint it would not be too pleasant either as users would need to move what has changed from
schema
topreviousSchema
which could introduce unwanted errors.This PR proposes a different approach, still based on some of the conventions mentioned in the issue, namely...
spec.schema.apiVersion
will always be the latest version of the underlying CRDspec.schema.apiVersion
will always be both the served and storage version.And defining the latest version in the underlying CRD as the one where both served and storage are true.
Kro will detect when the schema's apiVersion has changed and add it to the underlying CRD. As described here #482 (comment) the limitation is that RGD authors will only see all the available versions if they inspect the underlying CRD. If we follow through with this approach maybe the Kro CLI can help mitigate that limitation somehow?
This PR is missing validation:
And of course, there is the question of how to provide conversion between versions. Will Kro provide basic conversion or will all the responsibility fall on the user side?
If you find this approach valid, I am happy to continue with the implementation.
How to test
Create a RGD
Then create a new version