Versioning support -part 2 #17
Open
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.
Controller: add
upsertanddeletecalls in Reconcile to add required labels for reference maintainance. Not adding labels in webhook as the tags can be a identifier to check whether the labels (rootResource, version and latest tag) are added or not.Vendor: change
vendorroute and addlistas default route needs "objectname/version".Manager: maintain labels in
manager. AddrootResourceandversionin state andrefreshLabelsto indicate whether latest label needs to be added or removed.DeleteStateaccepts ":" object to identify rootResource for latest removal and adding for other objects. SupportGetLatestStateto fetch latest objectProvider:
k8sstate providers handles the calls frommanager. Based onrefreshLabelsbool, maintaintag=latestlabel.- Create new: remove current latest label in the same group (the same rootResource) and add latest label for the new item.
- Update: check if the current item is the last created. If yes, add
latestlabel.- Delete: if current item has
latestlabel, find the last created in the same group and assign latest label.API client: accepts
/objects/versionroute in creation and deletion for versioned objectsTest: fix object reference using new
:typeTemporarily disable instance and target controller unit test. Will fix in other PRs.
Materialize: require
objectState.ObjectMeta.Nameas "object:version" to maintain the same naming convension and labels (for example, scenario 04)