-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restorer changes for run image extension (#1014)
* Make a single constructor for lifecycle inputs - The logic to update the default path for TOML files was repeated across phases - In general it is safe to provide default values for inputs that might not be relevant to the current phase, as these will be ignored when constructing a new service for the phase; e.g., platform.LifecycleInputs.OrderPath will be ignored when constructing a lifecycle.Exporter - As more inputs are shared across phases (e.g., analyzed.toml is now an input to the detect phase), duplicating the logic for providing default values is becoming more cumbersome Signed-off-by: Natalie Arellano <narellano@vmware.com> * Read values from environment Signed-off-by: Natalie Arellano <narellano@vmware.com> * Buildpack API: run.Dockerfiles are allowed instructions on versions >= 0.10 Signed-off-by: Natalie Arellano <narellano@vmware.com> * Platform API: the detector accepts a new -run flag Signed-off-by: Natalie Arellano <narellano@vmware.com> * Move responsibility for validating Dockerfiles into the buildpack package Signed-off-by: Natalie Arellano <narellano@vmware.com> * When verifying Dockerfiles, return the new base image name if necessary Signed-off-by: Natalie Arellano <narellano@vmware.com> * When determining the new runtime base image, use criteria outlined in the platform spec Signed-off-by: Natalie Arellano <narellano@vmware.com> * Platform API: the schema of analyzed.toml is updated to include run-image.extend = <true or false, default false> Signed-off-by: Natalie Arellano <narellano@vmware.com> * TESTME: Update analyzed.toml with new run image if needed Signed-off-by: Natalie Arellano <narellano@vmware.com> * If extensions are used to switch the runtime base image, the detector should fail if the selected base image is not found in run.toml. Signed-off-by: Natalie Arellano <narellano@vmware.com> * Add fixture to test re-writing of analyzed.toml Signed-off-by: Natalie Arellano <narellano@vmware.com> * Move updating analyzed.toml into lifecycle package for easier testing Signed-off-by: Natalie Arellano <narellano@vmware.com> * Platform API: the restorer will update analyzed.toml with: - digest ref for run image - target data for run image Additionally the restorer will download the run image manifest & config when extend is true Signed-off-by: Natalie Arellano <narellano@vmware.com> * Update acceptance/extender_test.go Signed-off-by: Natalie Arellano <narellano@vmware.com> * Fix merge and restore selective package imgutil/layout/sparse modifies the image media types which we don't want Signed-off-by: Natalie Arellano <narellano@vmware.com> * Update analyzed.toml with digest reference or target data if needed Signed-off-by: Natalie Arellano <narellano@vmware.com> * Fix acceptance Signed-off-by: Natalie Arellano <narellano@vmware.com> * Don't redefine -layers Signed-off-by: Natalie Arellano <narellano@vmware.com> * Test organization and remove the requirement that we're exporting to a registry to use run image extensions Signed-off-by: Natalie Arellano <narellano@vmware.com> * Fix acceptance Signed-off-by: Natalie Arellano <narellano@vmware.com> * Fix acceptance Signed-off-by: Natalie Arellano <narellano@vmware.com> * Test that we don't update target data for older platforms Signed-off-by: Natalie Arellano <narellano@vmware.com> * Remove target partial and use helper function Signed-off-by: Natalie Arellano <narellano@vmware.com> * Fix acceptance Signed-off-by: Natalie Arellano <narellano@vmware.com> * Bump imgutil Signed-off-by: Natalie Arellano <narellano@vmware.com> * Fix acceptance Signed-off-by: Natalie Arellano <narellano@vmware.com> * Use imgutil/sparse package instead of internal/selective package We'll be able to fully remove internal/selective when we update tests for the extender as part of #998 Signed-off-by: Natalie Arellano <narellano@vmware.com> * Don't try to pull a builder image if it wasn't specified Ensure we write a digest reference to analyzed.toml Signed-off-by: Natalie Arellano <narellano@vmware.com> * Fix lint Signed-off-by: Natalie Arellano <narellano@vmware.com> * Add and update comment Signed-off-by: Natalie Arellano <narellano@vmware.com> --------- Signed-off-by: Natalie Arellano <narellano@vmware.com>
- Loading branch information
1 parent
1299eb8
commit 47594c2
Showing
21 changed files
with
408 additions
and
227 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
2 changes: 1 addition & 1 deletion
2
...a/restorer/container/layers/analyzed.toml → ...ontainer/layers/analyzed.toml.placeholder
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
2 changes: 2 additions & 0 deletions
2
acceptance/testdata/restorer/container/layers/some-extend-false-analyzed.toml.placeholder
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[run-image] | ||
reference = "REPLACE" |
3 changes: 3 additions & 0 deletions
3
acceptance/testdata/restorer/container/layers/some-extend-true-analyzed.toml.placeholder
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[run-image] | ||
reference = "REPLACE" | ||
extend = true |
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.