To ensure ordering of stdout and stderr in build and generate phases, send the stdout and stderr of the executing command to the same stream (stdout).
This will have an outside effect of anyone consuming `lifecycle` as what was previously in stderr is now in stdout.
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
* More fixes for target compat checking during detect
- If a buildpack fails to specify os/arch (but specifies distro) still check targets
- If the run image fails to specify os/arch (this should not happen actually as we will fail during analyze) still check targets
- Fix typo in buildpack descriptor struct so that we actually get stack information
- If we get distro information from /etc/os-release, persist this information to later invocations to that the log message
printed when errors are encountered will be accurate
- Don't override inner `i` in loop (this should not actually affect the outer loop but is confusing)
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* When stack is "any", don't infer empty target as it is not needed
Missing targets is sufficient for wildcard match
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Remove backwards compatible glue that actually causes fewer builds to succeed
Fixes https://github.com/buildpacks/lifecycle/issues/1355
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Remove exit (this was added for debugging purposes)
Signed-off-by: Natalie Arellano <narellano@vmware.com>
---------
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Always set CNB_TARGET_* variables during detect, build, and generate
when the Buildpack API version is at least 0.10.
Previously, we only set these variables when the Platform API version was at least 0.12.
But, newer Buildpack APIs expect these variables regardless of the Platform API version.
If we are on an older platform, derive the target variables from the base image OS.
Fixes https://github.com/buildpacks/lifecycle/issues/1308
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fix unit
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fix unit again
Signed-off-by: Natalie Arellano <narellano@vmware.com>
---------
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Provide context folder for extensions
Co-authored-by: Johannes Dillmann <j.dillmann@sap.com>
Signed-off-by: Pavel Busko <pavel.busko@sap.com>
* Address PR feedback
Co-authored-by: Johannes Dillmann <j.dillmann@sap.com>
Signed-off-by: Pavel Busko <pavel.busko@sap.com>
* Split tests by platform API
Co-authored-by: Pavel Busko <pavel.busko@sap.com>
Signed-off-by: Johannes Dillmann <j.dillmann@sap.com>
* Add unit test for FindContexts
Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>
Signed-off-by: Pavel Busko <pavel.busko@sap.com>
* acceptnance tests
Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>
Signed-off-by: Pavel Busko <pavel.busko@sap.com>
* Address PR feedback
Signed-off-by: Philipp Stehle <philipp.stehle@sap.com>
---------
Signed-off-by: Pavel Busko <pavel.busko@sap.com>
Signed-off-by: Johannes Dillmann <j.dillmann@sap.com>
Signed-off-by: Philipp Stehle <philipp.stehle@sap.com>
Co-authored-by: Pavel Busko <pavel.busko@sap.com>
Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>
Co-authored-by: Philipp Stehle <philipp.stehle@sap.com>
* Exporter zeroes timestamps when adding extension layers to the app image
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Update fixture to fix Windows
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Use normalizing tar reader to fix Windows
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Revert "Use normalizing tar reader to fix Windows"
This reverts commit 8c6c12c82c.
* Update fixture to fix Windows
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Update phase/exporter.go
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fix format
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Try to fix Windows
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Skip test on Windows
Signed-off-by: Natalie Arellano <narellano@vmware.com>
---------
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Consolidate methods that read and write platform spec'd TOML
in platform/files package.
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Calculate lifecycle digest and output version as part of acceptance testing
This can help us diagnose weird failures in CI
Signed-off-by: Natalie Arellano <narellano@vmware.com>
---------
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Remove buildpack APIs 0.2-0.6 according to https://github.com/buildpacks/rfcs/blob/main/text/0110-deprecate-apis.md
- Fix acceptance by updating fixtures to use newer Buildpack API version
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Remove backwards compatible glue for buildpacks missing API version
Signed-off-by: Natalie Arellano <narellano@vmware.com>
---------
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* restorer gets layers flag again
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
* add explanatory debug logs so a reader knows why the buildpacks are read twice.
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
* warn when a positional argument might have been a flag (#1147)
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
* Add test for empty digest not returned
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fix acceptance by providing a base image when we instantiate the remote run image
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* timestamp logs and phase error message cherry-picks (#1164)
* timestamp logs for entry/exit for all the top-level Lifecycle package functions
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
fixing names
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
using defer to make one-liners for fun and profit
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
and today we thank our brave linters for preventing critical defects such as unnecessary trailing newlines from being merged. Its about time somebody thought of the children.
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
* be more helpful when you dont recognize the phase
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
---------
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
* Simplifies target matching logic per spec PR review (#1166)
* Update units without updating code
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Update code
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Unpend test
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Add units for rebase without updating code
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Update rebase code
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fix lint
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* When we read the descriptor file, don't fill in "*" as a magic value as missing values are wildcard matches
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Stricter validation for rebase
Signed-off-by: Natalie Arellano <narellano@vmware.com>
---------
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Add -daemon to restorer (#1168)
This is needed when extensions were used to switch (but not extend) the run image
and we need to re-read the target data from the image config.
In such cases, we don't need the run image to exist in a registry,
because we don't need a manifest for kaniko.
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Remove CNB_TARGET_ID according to https://github.com/buildpacks/spec/pull/374 and https://github.com/buildpacks/spec/pull/375 (#1175)
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Field renames per spec review (#1170)
* Rename distributions -> distros in the buildpack spec
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Rename distributions -> distros in the platform spec
Signed-off-by: Natalie Arellano <narellano@vmware.com>
---------
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* force pack acceptance tests to build with a version of go that can still make HTTP requests to docker daemon (#1158)
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
---------
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Co-authored-by: Joe Kimmel <jkimmel@vmware.com>
Co-authored-by: Joe Kimmel <86852107+joe-kimmel-vmw@users.noreply.github.com>
* When pulling remote image data, fail if the remote image is not found
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* When validating dockerfiles, set extend to true if there are any instructions (vs more than one instruction)
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Update matching logic when considering if two image names are equivalent to ignore the digest portion of the reference if present (for the purpose of selecting data from run.toml to add to the lifecycle metadata label i.e., “run image for rebase”)
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Comments and cleanup
Don't print `%!s(<nil>)` if nil is provided to the "parse maybe" function
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* When exporting, continue to use run image identifier (which could be a digest reference or daemon image ID)
instead of falling back to image name when exporting to a daemon.
Previously, the digest reference was incorrect which caused the daemon not to find the image.
But when provided a correct digest reference the daemon can still find it.
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Add Contains method to structs that hold run image information for export
When determining if a provided reference is found in existing metadata, remove its digest -
except when setting the new run image "image" in analyzed.toml,
because we should always respect what the extension author wrote.
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* When finding the run image info for export, use the run image "image" (name)
in analyzed.toml as the search key, because the run image "reference" could be a daemon image ID
or include the digest, which isn't helpful when retrieving image names that are supposed to float.
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fix detector acceptance and add more logging
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fix: use "image" instead of "reference" and also guard against image not found
when we are only updating the reference and target data in analyzed.toml
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Add comment
Signed-off-by: Natalie Arellano <narellano@vmware.com>
---------
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Small fixes from user testing
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fixes from user acceptance
- Removes -stack flag from analyzer
- Fixes debug log message
- Removes deprecated rand.Seed
Signed-off-by: Joe Kimmel <joe-kimmel-vmw@vmware.com>
* Bump linter to a version that will work with go 1.20
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Restorer should ensure ownership of kaniko directory
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* pull the less-than case for flags out of the switch
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
* appease the windows linter
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
* Fix weird log output
Signed-off-by: Natalie Arellano <narellano@vmware.com>
---------
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Joe Kimmel <joe-kimmel-vmw@vmware.com>
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
Co-authored-by: Joe Kimmel <joe-kimmel-vmw@vmware.com>
Co-authored-by: Joe Kimmel <jkimmel@vmware.com>
* extensions get the same targets validation as buildpacks
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
* extensions default to */* for os/arch detection
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
---------
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
* Add history when adding buildpack or extension layers
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* REVERTME: point imgutil to feature branch
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Parse extension ID from history so that we can output a useful log message
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Avoid extra wrapping
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Bump imgutil
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fix acceptance by overriding imgutil methods for "caching image"
We need to add to the launch cache when adding layers so that the next build will be faster
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Add tests for layer factory
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Add acceptance test for extender should update history
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Move history methods to imgutil
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fix exporter acceptance by fixing imgutil
The digest for a remote image from imgutil
should match the digest for a remote image from ggcr
unless the user specifically requested modifications like overriding history
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Add acceptance test; fix layer name when there is only one slice
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>
* Fix acceptance
imgutil mutates the image (history) for newer platforms, so the SHA is different
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Point imgutil back to commit on main, also bump containerd
Signed-off-by: Natalie Arellano <narellano@vmware.com>
---------
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* initial changes in layermetadata.go for FIXME
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
* minor changes, var name and added TODO
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
* Added check for empty string in layermetadata.go
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
* checks in layermetadata_test.go for logger
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
* api version check - logic moved
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
* ran make format for modified files
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
* removed comments
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
* changes to DecodeLayerMetadataFile
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
* check for version shifted from layers.go to layermetadata.go
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
* resolved ineffectual assignment to err
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
* added new it block, TODO resolve failing test
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
* Fix failing test
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
* removed unnecessary fmt
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
---------
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
* 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>
* The extender accepts new -extended and -kind flags
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Bring back selective package
Because we change the media types to be oci types (vs docker types) this changes the digest of the image
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Add acceptance test for run image extension
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* WIP
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Refactor
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* WIP: break me up into separate commits
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Validate extend config during buildpack/generate
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Address some TODOs and refactor
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Set io.buildpacks.rebasable
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>
* WIP: add acceptance test
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* WIP: first assertion passes
FIXME: extended layers should be small
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* WIP
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* WIP: Second assertion passes
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Add new assertions and rename variables for clarity; fix exporter units
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Save extended run image under <extended>/run
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Check for nil config and make the loop simpler
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fix ineffectual assignment to err
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Cleanup extender tests
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fix typo
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Add positive assertion
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Make constants for asserted log lines
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Update comment
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Acceptance test passes
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fix some TODOs
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Update imgutil to point to branch commit
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Add support to extending daemon images
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* WIP
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fix image ref when exporting to daemon
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* More fixes
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Improve script to test on fork
Clarify names of cosign secrets and remove Codecov
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Cleanup extender
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Update comments
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Small fixes, units pass
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Add generator units
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fixes
- We shouldn't try to use extension layers if they exist in <layers>/extended unless experimental features are enabled
- We only know the size of the compressed layer, so we can't use io.CopyN (but we don't need to guard against decompression bomb anyway since we control the layers)
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fix test
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Rename fixture dirs so that we can check out source code on Windows
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Bring back Cleanup()
We need access to the final image after all Dockerfiles have been applied,
so we need to create the working directory outside the applier loop.
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Update imgutil branch
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fix restorer acceptance
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fix acceptance test by making it less brittle
Instead of hard-coding the run image and run image top layer SHAs,
we can derive their values
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fixups from PR review
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fix units
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Point imgutil back to main
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Update generator.go
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Update comment
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Update exporter.go
Co-authored-by: Jesse Brown <jabrown85@gmail.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Check err type when we fail to get a layer from a sparse image
Signed-off-by: Natalie Arellano <narellano@vmware.com>
---------
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Co-authored-by: Jesse Brown <jabrown85@gmail.com>
* 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>
* The extender accepts new -extended and -kind flags
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Bring back selective package
Because we change the media types to be oci types (vs docker types) this changes the digest of the image
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Add acceptance test for run image extension
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* WIP
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Refactor
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* WIP: break me up into separate commits
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Validate extend config during buildpack/generate
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Address some TODOs and refactor
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Set io.buildpacks.rebasable
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>
* Save extended run image under <extended>/run
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Check for nil config and make the loop simpler
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fix ineffectual assignment to err
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Cleanup extender tests
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fix typo
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Add positive assertion
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Make constants for asserted log lines
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Update comment
Signed-off-by: Natalie Arellano <narellano@vmware.com>
---------
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* 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 https://github.com/buildpacks/lifecycle/issues/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>
* all the bits i can do prior to imgutil getting the Variant merged
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
* upgrade imgutil and incorporate arch Variant
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
* move GetTargetFromImage to platform and move ID into just platform
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
* add wildcard stack translation to target md
move common test fns to common places
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
* only pull target metadata from runimage if we're in a newer API
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
* use the * arch when autodetecting OS only
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
* detector.go - debug logger
Co-authored-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Joe Kimmel <86852107+joe-kimmel-vmw@users.noreply.github.com>
* one wild and crazy test for wildcards
also fixes weird new linter requirement
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
* preferentially detect windows
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
---------
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
Signed-off-by: Joe Kimmel <86852107+joe-kimmel-vmw@users.noreply.github.com>
Co-authored-by: Natalie Arellano <narellano@vmware.com>
* 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>
* Fix acceptance
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Don't redefine -layers
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Revert "Replace print with logger in image_cache.go, fixes formatting (#1012)"
This reverts commit 6a10b63c67.
* Revert "Revert "Replace print with logger in image_cache.go, fixes formatting (#1012)""
This reverts commit 5780910ecf.
* Rename image -> images in run.toml
We pluralize all other list elements
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Don't enforce constraints for older extensions
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Rename function for clarity
Signed-off-by: Natalie Arellano <narellano@vmware.com>
---------
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* initial setup for toml file schemas and structs
BpDescriptor reads and populates Targets data
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
* correct-er detector for target selector
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
* TargetMetadata.Equals: tests and impl nailed down
minor cleanup
nix mixins mixup
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
* refactoring RunImage with some spillover
- RunImage has:
- Reference
- Target
While i was in there, some of the other *ImageReference types were
inconvient so I changed them to just be strings instead of structs
containing strings. This does have the effect of collapsing a table,
But as a newer contributor to this project I have the blessing and curse
of not feeling all that constrained by (nor aware of) past decisions.
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
* NewDetector respects the alphabet
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
* only replace stack with target for newer api versions
small cleanups / removal of unneeded check
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
* Equals->Satisfied and other cleanups
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
* detector logic is probably all the way working
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
* turns out the unit tests pass without the bin folders for these buildpack fixtures
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
* analyzed.toml backwards compat shims
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
* change detector to take analyzedMD struct rather than file
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
* small cleanups
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
* runImage only has one distribution and that small adjustment has someconsequences
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
* move isWildcard to private method of detector
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
* analyzed acceptance tests use ReadAnalyzed fn
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
* Updates
Update env/build.go
Update buildpack/bp_descriptor.go
Update default arch to amd64
use OS instead of Os
fixing mocks and fn calls after small change
Co-authored-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Joe Kimmel <86852107+joe-kimmel-vmw@users.noreply.github.com>
* couple more easy fixes
fix descriptor test bc we decided that we _do_ want that behavior for old versions
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
* Targets are auto-detected based on contents of buildpack/bin
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
* Change AnalyzedMetadata struct to use pointers again
This allows us to remove our custom writer, while keeping the file schema unchanged in Platform API 0.12
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fix lint
Signed-off-by: Joe Kimmel <joe-kimmel-vmw@vmware.com>
* Fix nil pointer
Signed-off-by: Natalie Arellano <narellano@vmware.com>
---------
Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
Signed-off-by: Joe Kimmel <86852107+joe-kimmel-vmw@users.noreply.github.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Joe Kimmel <joe-kimmel-vmw@vmware.com>
Co-authored-by: Natalie Arellano <narellano@vmware.com>
Co-authored-by: Joe Kimmel <joe-kimmel-vmw@vmware.com>
* Introduce -launcher-sbom as new flag to the exporter and creator
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Add unit test and update acceptance test
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fix regression in metadata.toml rendering
Moved the dynamic process serialization to a new field type and off of process. The TOML that was previously generated was not expected and the TOML library we use doesn't seem to have a way to render the table the way we expect. Making a new type for the single field `command` allows us to render the TOML the way we want.
Fixes: buildpacks/lifecycle#945
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
* Changes requested from pull request
- Minor reorganization of the code
- Fixed typos
- Removed some redundant checks in one test to not muddy the waters on what is being tested
- Updated some comments
- Removed debug code
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
* acceptance: move from io/ioutil to io and os packages
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
* archive: move from io/ioutil to io and os packages
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
* auth: move from io/ioutil to io and os packages
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
* buildpack: move from io/ioutil to io and os packages
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
* cache: move from io/ioutil to io and os packages
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
* cmd/lifecycle: move from io/ioutil to io and os packages
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
* env: move from io/ioutil to io and os packages
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
* internal: move from io/ioutil to io and os packages
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
* launch: move from io/ioutil to io and os packages
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
* layers: move from io/ioutil to io and os packages
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
* priv: move from io/ioutil to io and os packages
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
* testhelpers: move from io/ioutil to io and os packages
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
* tools: move from io/ioutil to io and os packages
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
* lifecycle: move from io/ioutil to io and os packages
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Co-authored-by: Natalie Arellano <narellano@vmware.com>
* ci(lint): auto lint fixes
Signed-off-by: Michael de Senna <desenna@gmail.com>
* fix: replace deprecated funcs
Signed-off-by: Michael de Senna <desenna@gmail.com>
* ci(lint): fix many io/ioutil staticcheck
Signed-off-by: Michael de Senna <desenna@gmail.com>
* fix: import os
Signed-off-by: Michael de Senna <desenna@gmail.com>
Signed-off-by: Michael de Senna <desenna@gmail.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Co-authored-by: Natalie Arellano <narellano@vmware.com>
* Consolidate logic in the platform package
- Remove the platform/launch package as it is not needed to avoid having the launcher depend on the lifecycle
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Reinstate platform/launch package to keep the launcher binary smaller
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fix constant
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Remove comment
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* WIP
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* WIP
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Don't mount layers fixture in container
This way changes from the first build (/layers/config/metadata.toml, /layers/sbom, etc.)
are not propagated to the second build.
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Set environment variables from the extended build image in the build context
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fix format string
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Restorer pulls builder manifest and config
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Copy extend-config.toml from extension output to /layers/generated
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Only import kaniko on linux
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* WIP: units pass
Refactor buildpack build, detect, and generate to separate data model from service
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* WIP: fixed some TODOs
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* WIP: addressed some more TODOs, units pass
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* WIP: units pass
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* WIP: acceptance tests pass
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Address some minor TODOs
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* When running extender acceptance, don't mount in /workspace directory
This leads to incorrect permissions issues when running on linux
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Don't try to check for specific curl version
This appears flaky
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* fixes from testing. (#902)
Signed-off-by: Ozzy Osborne <bardweller@gmail.com>
Signed-off-by: Ozzy Osborne <bardweller@gmail.com>
* Lint
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Add tests and TODO
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Change CNB_BUILDPACK_DIR -> CNB_EXTENSION_DIR
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fill in default generated dir
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Ensure kaniko doesn't try to pull 'oci:/kaniko/cache/base/sha256:XXX' from a remote registry
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Add test
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fix panic
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fix assertion
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Pass build_id as UUID to Dockerfile
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Add tests for selective package
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Remove kaniko fork
- Fix acceptance by adding CacheRunLayers option and moving 'ARG build_id=0' statements
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fix windows
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Dockerfile validation (#918)
* Add Dockerfile Validation
Signed-off-by: Ozzy Osborne <bardweller@gmail.com>
* use mobi buildkit dockerfile parsing
Signed-off-by: Ozzy Osborne <bardweller@gmail.com>
Signed-off-by: Ozzy Osborne <bardweller@gmail.com>
* Add units for Dockerfile validation
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fix launcher
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Minor improvements
- Test ReadGroup for extensions
- Ensure stderr is captured for acceptance test that might expect it
- Read group.toml into an accurate struct (that has extension and optional set for extensions)
and set these fields to false before writing out to TOML or JSON
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Skip image extensions tests on Windows
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Ozzy Osborne <bardweller@gmail.com>
Co-authored-by: Javier Romero <rjavier@vmware.com>
Co-authored-by: Ozzy Osborne <bardweller@gmail.com>
* Implement overridable process args
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Apply suggestions from code review
Co-authored-by: Jesse Brown <jabrown85@gmail.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* When there are no user-provided args, overridable args should be provided
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fix user provided args for newer buildpack with no always-args
When there are no always-args, we need to check the buildpack API, because
it's not clear from the process definition if the buildpack is newer or older.
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fix: user-provided args should replace overridable args only if non-empty
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fix: older platforms should always append
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Co-authored-by: Jesse Brown <jabrown85@gmail.com>
* Allow storing multiple commands instead of a single string (#900)
* Allow storing multiple commands instead of a single string
This is a first step to implementing #322. This PR is updating our internal structs to allow for a slice of commands while keeping the external API and behavior the same. A future PR will implement handling multiple commands depending on the API version and changing the behavior of the launcher and metadat file output changes.
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
* Comment on usage of cmp.Option
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
* Add comment on Matches interface usage for testing
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
* Added test for launch.toml decoding branching logic
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
* Apply suggestions from code review
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
Co-authored-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
* fixup! Apply suggestions from code review
* fixup! Apply suggestions from code review
* Fix editing daemon settings
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Co-authored-by: Natalie Arellano <narellano@vmware.com>
* WIP
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fixing up existing tests
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
* Remove now unused process specific decode paths
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
* fixup! Remove now unused process specific decode paths
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
* fixup! Remove now unused process specific decode paths
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
* fixup! Remove now unused process specific decode paths
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
* fixup! Remove now unused process specific decode paths
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
* fixup! Remove now unused process specific decode paths
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
* Clean up more serialization paths
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
* Remove toml wrapping code
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
* Added comment on UnmarshalTOML
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
* Put back code I didn't mean to remove
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
* Update launch/launch.go
Co-authored-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
* removed line
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Co-authored-by: Natalie Arellano <narellano@vmware.com>
* Allow storing multiple commands instead of a single string
This is a first step to implementing #322. This PR is updating our internal structs to allow for a slice of commands while keeping the external API and behavior the same. A future PR will implement handling multiple commands depending on the API version and changing the behavior of the launcher and metadat file output changes.
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
* Comment on usage of cmp.Option
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
* Add comment on Matches interface usage for testing
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
* Added test for launch.toml decoding branching logic
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
* Apply suggestions from code review
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
Co-authored-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
* fixup! Apply suggestions from code review
* fixup! Apply suggestions from code review
* Fix editing daemon settings
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Co-authored-by: Natalie Arellano <narellano@vmware.com>
* Ignore .tool-versions for asdf and other tooling
* Allow new buildpack API to use new launch.toml format
- Buildpacks using the newer buildpack API must use the new launch.toml format
- The older format is still allowed on older buildpack API versions
Issue: https://github.com/buildpacks/lifecycle/issues/870
* Update buildpack/build_test.go
Co-authored-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
* Update buildpack/build_test.go
Co-authored-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
* Update buildpack/build_test.go
Co-authored-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
* Added Buildpack 0.10 as valid buildpack API
Fixed tests that were now invalid due to the default buildpack being 0.10
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
* Apply suggestions from code review
Co-authored-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
Co-authored-by: Natalie Arellano <narellano@vmware.com>
* Small fixes for Dockerfiles phase 1
* Looks for pre-populated output files in nested directories (e.g., ./generate) instead of the extension root
* Extensions must satisfy all requires they enlisted to provide
* Escape extension ID when locating Dockerfiles
* Resolve analyzed path if not provided
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fix assertion
Signed-off-by: Natalie Arellano <narellano@vmware.com>
* Fix more assertions and unwrap errors
Signed-off-by: Natalie Arellano <narellano@vmware.com>