This repository has been archived by the owner on May 3, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apis: move 'Release.Meta.Environment' to 'Release.Spec.Environment'
Kubernetes 1.11 introduces a large set of improvements for CRDs. However, one of them is stricter validation of the 'metadata' field of CRD instances: it will drop any unknown keys from the 'metadata' object before storage. As a result, Release objects land in the cluster without any Environment. This Release is useless for the Schedule and Strategy controllers, and because it does not match the Application template, Shipper creates a new Release; ultimately this turns into a tight loop of creating bogus Releases. Suboptimal. This patch moves the 'environment' portion of Release objects to the 'spec'. We originally did not put 'Environment' into the spec because it was meant to be immutable, and not part of the user-facing command language -- we appreciated a 'spec' section that consisted of nothing but the user control 'targetStep'. While well-intentioned, this was likely a bad call, since it makes it awkward to consider Releases generated by hand, without the control of an Application object. We can solve the immutability by introducing an admission controller, and trust our users to be smart about which fields are run-time-editable. Note: this requires a migration script to run against the management clusters between shutting down the previous version of Shipper and starting this one: the script should copy '.metadata.environment' to '.spec.environment' for all existing Releases. I decided to do this as a migration script rather than building a conversion into Shipper itself because there's currently no location in Shipper which regularly processes and updates all existing Releases. I expect this to change as we look towards merging the Schedule and Strategy controllers into the Release controller.
- Loading branch information
1 parent
3d24e21
commit c7d66b4
Showing
17 changed files
with
172 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.