Commit Graph

96 Commits

Author SHA1 Message Date
Jesse Brown aab8470d64
remove deprecations
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
2025-12-12 11:03:58 -06:00
Jesse Brown c3f04af101
more test fixes 2025-12-12 10:59:12 -06:00
Jesse Brown 6de3f86b90
debugging exports 2025-12-09 13:28:08 -06:00
Jesse Brown e539765383
fixup! Updating to moby libs to satisfy imgutil moby changes
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
2025-11-24 14:10:00 -06:00
Jesse Brown 2bbc5ab206
Updating to moby libs to satisfy imgutil moby changes
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
2025-11-24 14:06:32 -06:00
Jesse Brown 1f8b24c756
more retries
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
2025-11-07 08:36:52 -06:00
Jesse Brown b260d2122e
more retries
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
2025-11-07 08:23:23 -06:00
Jesse Brown 702d60bcdb
fixup! trying to improve test flappiness 2025-11-07 08:13:49 -06:00
Jesse Brown fd3130a721
trying to improve test flappiness 2025-11-07 08:04:41 -06:00
Jesse Brown c121049b41
bump imgutil 2025-05-28 10:00:00 -05:00
Jesse Brown 60bf07f8de
Remove Windows Support
I took a swing at removing any and all references to windows in this reference implementation.

Lifecycle no longer outputs a windows binary as a release artifact
Lifecycle no longer operates against windows containers

https://github.com/buildpacks/rfcs/pull/311
https://medium.com/buildpacks/deprecation-announcement-windows-container-feature-in-cloud-native-buildpacks-bbb70351343d

Signed-off-by: Jesse Brown <jabrown85@gmail.com>
2024-12-10 16:56:29 -06:00
Robert Gogolok eea0ba6a02 Remove obsolete // +build lines
https://tip.golang.org/doc/go1.18#go-build-lines

Signed-off-by: Robert Gogolok <robert.gogolok@stackit.cloud>
2024-12-02 16:26:34 +01:00
dependabot[bot] 4a52e3c9e7
Bump the go-dependencies group across 1 directory with 7 updates (#1409)
* Bump the go-dependencies group across 1 directory with 7 updates

Bumps the go-dependencies group with 5 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [github.com/GoogleContainerTools/kaniko](https://github.com/GoogleContainerTools/kaniko) | `1.23.1` | `1.23.2` |
| [github.com/containerd/containerd](https://github.com/containerd/containerd) | `1.7.19` | `1.7.23` |
| [github.com/google/go-containerregistry](https://github.com/google/go-containerregistry) | `0.20.0` | `0.20.2` |
| [golang.org/x/sync](https://github.com/golang/sync) | `0.7.0` | `0.8.0` |
| [golang.org/x/sys](https://github.com/golang/sys) | `0.22.0` | `0.26.0` |



Updates `github.com/GoogleContainerTools/kaniko` from 1.23.1 to 1.23.2
- [Release notes](https://github.com/GoogleContainerTools/kaniko/releases)
- [Changelog](https://github.com/GoogleContainerTools/kaniko/blob/main/CHANGELOG.md)
- [Commits](https://github.com/GoogleContainerTools/kaniko/compare/v1.23.1...v1.23.2)

Updates `github.com/containerd/containerd` from 1.7.19 to 1.7.23
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v1.7.19...v1.7.23)

Updates `github.com/docker/docker` from 26.1.5+incompatible to 27.0.3+incompatible
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v26.1.5...v27.0.3)

Updates `github.com/google/go-containerregistry` from 0.20.0 to 0.20.2
- [Release notes](https://github.com/google/go-containerregistry/releases)
- [Changelog](https://github.com/google/go-containerregistry/blob/main/.goreleaser.yml)
- [Commits](https://github.com/google/go-containerregistry/compare/v0.20.0...v0.20.2)

Updates `github.com/moby/buildkit` from 0.13.2 to 0.14.1
- [Release notes](https://github.com/moby/buildkit/releases)
- [Commits](https://github.com/moby/buildkit/compare/v0.13.2...v0.14.1)

Updates `golang.org/x/sync` from 0.7.0 to 0.8.0
- [Commits](https://github.com/golang/sync/compare/v0.7.0...v0.8.0)

Updates `golang.org/x/sys` from 0.22.0 to 0.26.0
- [Commits](https://github.com/golang/sys/compare/v0.22.0...v0.26.0)

---
updated-dependencies:
- dependency-name: github.com/GoogleContainerTools/kaniko
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-dependencies
- dependency-name: github.com/containerd/containerd
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-dependencies
- dependency-name: github.com/docker/docker
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: go-dependencies
- dependency-name: github.com/google/go-containerregistry
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-dependencies
- dependency-name: github.com/moby/buildkit
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-dependencies
- dependency-name: golang.org/x/sync
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-dependencies
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix errors

Signed-off-by: Natalie Arellano <narellano@vmware.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Natalie Arellano <narellano@vmware.com>
2024-10-28 12:53:04 -04:00
Natalie Arellano 33c5b89004
Consolidate methods that read and write platform spec'd TOML (#1236)
* 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>
2023-11-03 14:17:52 -04:00
Domenico Luciani 7ffcd58e74
Support insecure registries (#1140)
* Add the support to the new --insecure-registry parameter

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* Add the support to the new --insecure-registry parameter in the creator command

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* Add keychain mock and handler test

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* Add support for a single insecure registry

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* Add support to multiple insecure registries

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* Adjusted flag name

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* Fix problem with the mock

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* InsecureRegistry to InsecureRegistries

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* Address comment on FlagTags parity

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* Parse the InsecureRegistry env variable with comma separated values

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* Changed InsecureRegistry to InsecureRegistries

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* Changing name at the env variable

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* Exporter now accept insecure registries

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* Bump up toward the latest version of imgutil

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* Remove legacy guard

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* Add WithRegistrySetting with insecure registries into restorer

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* Add support for insecure registries to the rebaser

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* Add rebaser testdata directory to .gitignore

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* Cleaned testdata directory

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* Remove testdata rebaser entries from .gitignore

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* Add support to insecure registies for the read-write registry check

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* Move registryHandler into its own file into the image package

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* Add dockerfile.windows

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* Introducing GetInsecureRegistryOptions

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* Fix linter problems

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* Remove legacy guards and add test support to arm64

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* Remove duplication and utilize new GetInsecureRegistryOptions function

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* Extract common code for getting insecure registry options from imageRef

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* Added cli flags behind proper guards

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* Bumped up to the imgutil latest version with the insecure adjustment and renamed the getInsecureRegistryOptions function

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* Make the getInsecureOptions a static method as a temporary solution to remove duplications

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* Added insecure registry to the runImage in the rebaser

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* Bump up to the latest version of imgutil with the multiple registries fix

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* Go mod tidy

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* Remove insecure-registry filter based on the imageRef

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* Remove reduntant for loop and added a test for multiple GetInsecureOptions

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* Don't remove whitespaces between buildpacks names

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

* Add FlagInsecureRegistries behind 0.13 guards

Signed-off-by: Domenico Luciani <dluciani@vmware.com>

---------

Signed-off-by: Domenico Luciani <dluciani@vmware.com>
2023-09-22 12:29:58 -04:00
Juan Bustamante 03ee829704
Implement the capability to the phases to handle input/output images in OCI layout format (#969)
* Implementation of the new flag to export to OCI layout format

Signed-off-by: Juan Bustamante <jbustamante@vmware.com>

* Adding reference to imgUtil for OCI layout

Signed-off-by: Juan Bustamante <jbustamante@vmware.com>

* Adding test coverage

Signed-off-by: Juan Bustamante <jbustamante@vmware.com>

* updating to imgutil librery with the name.ref annotation

Signed-off-by: Juan Bustamante <jbustamante@vmware.com>

* base on review feedback, I am removing the layout-repo configuration, now platforms must take care of mounting the inputs according to the image ref to path rules described in the RFC

Signed-off-by: Juan Bustamante <jbustamante@vmware.com>

* reverting the change to remove the layout-dir

Signed-off-by: Juan Bustamante <jbustamante@vmware.com>

* fixing dockerfile error for the acceptance tests

Signed-off-by: Juan Bustamante <jbustamante@vmware.com>

* removing chmod validation on /layout-repo

Signed-off-by: Juan Bustamante <jbustamante@vmware.com>

* pointing to the latest imgutil commit

Signed-off-by: Juan Bustamante <jbustamante@vmware.com>

* Update cmd/lifecycle/analyzer.go

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Fix lint

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Apply suggestions from code review

Co-authored-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Juan Bustamante <jbustamante@vmware.com>

* Fixing formatting issue

Signed-off-by: Juan Bustamante <jbustamante@vmware.com>

* fixing errors after later refactor

Signed-off-by: Juan Bustamante <jbustamante@vmware.com>

* Apply suggestions from code review

Co-authored-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Juan Bustamante <jbustamante@vmware.com>

* Using method layout.ParseIdentifier from imgUtil, and removing test case

Signed-off-by: Juan Bustamante <jbustamante@vmware.com>

* simplifying the image_layout test cases

Signed-off-by: Juan Bustamante <jbustamante@vmware.com>

* bumping imgutil version to 4cf98dd677d28557679e4f08941e891f640410cd

Signed-off-by: Juan Bustamante <jbustamante@vmware.com>

---------

Signed-off-by: Juan Bustamante <jbustamante@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Co-authored-by: Natalie Arellano <narellano@vmware.com>
2023-02-21 14:24:43 -05:00
Joey Brown 4be1c1c5ed
updated tests
Signed-off-by: Joey Brown <brown.joseph@salesforce.com>
2023-01-09 11:08:20 -06:00
Eng Zer Jun 5a4df34080
refactor: move from io/ioutil to io and os packages (#941)
* 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>
2022-10-31 10:56:33 -04:00
Michael de Senna 6a2b4bfd54
ci(lint): address most staticcheck alarms (#940)
* 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>
2022-10-25 17:48:29 -04:00
Natalie Arellano 8cf3678b28
Remove <image> as an argument to the extender (#926)
* Remove <image> as an argument to the extender

Favors passing the reference via analyzed.toml

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Fix confusing error messaging when failing to pull oci layout image

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Fix error expectation

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Fix selective write test

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Guard nil build image in extender factory

Signed-off-by: Natalie Arellano <narellano@vmware.com>

Signed-off-by: Natalie Arellano <narellano@vmware.com>
2022-10-24 11:57:29 -04:00
Natalie Arellano 4b33990e43
Fix creator restore bug (#929)
* When platform API is at least 0.10, run the restore phase always but pass
-skip-restore as skip layers to skip layer metadata and SBOM restoration

This ensures:
- In the 5 phase invocation, the restorer can always run (for extension purposes)
- The 5 phase invocation will match the creator invocation

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Fix selective write test

Signed-off-by: Natalie Arellano <narellano@vmware.com>

Signed-off-by: Natalie Arellano <narellano@vmware.com>
2022-10-19 16:51:36 -04:00
Natalie Arellano 2f8a818959
Dockerfiles phase 2 (#896)
* 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>
2022-10-07 11:09:58 -04:00
Jesse Brown 68a937bb0a
Allow storing multiple commands instead of a single string (#920)
* 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>
2022-09-30 13:54:33 -04:00
Natalie Arellano 52e7885192
Revert "Allow storing multiple commands instead of a single string (#900)" (#919)
Signed-off-by: Natalie Arellano <narellano@vmware.com>

Signed-off-by: Natalie Arellano <narellano@vmware.com>
2022-09-29 14:01:46 -04:00
Jesse Brown 5fa84a4c38
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>
2022-09-22 15:40:41 -04:00
Natalie Arellano 86d84b37ee
Move logic out of cmd/lifecycle/analyzer.go (#805)
* Acceptance tests pass with creator commented out

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Fix creator

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Add unit tests for analyze inputs

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Add scaffold for analyzer builder unit tests

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Add many unit tests, still have some TODOs

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Address most TODOs

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Acceptance tests pass

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* A few more TODOs

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Bring back go 1.16

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Add unit test

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Fix acceptance tests

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Fix units

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Remove nolint

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Remove unneeded things

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Use operations pattern

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Refactor tests to take advantage of operations pattern

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Add missing tests

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Fix lint

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Analyzer factory assigns "nop" services by default

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Try to fix registry handler test

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Move new package from cmd/lifecycle/platform to platform/inputs

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Updates per PR review

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Test the platform instead of the exiter

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Combine cmd/lifecycle/platform and platform

With some small changes to avoid an import cycle, we can make a meaningful platform package

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Clean up constructors

Eventually only the platform package should switch on platform api

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Remove ForAnalyzer struct

Having the analyzer factory take a list of args will ensure we don't forget
to update the creator when things change.

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Combine cmd/launcher/platform and platform

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Remove comment

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Remove spec alias

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Move cache metadata back to platform

The lifecycle shouldn't have to depend on the cache package, just the interface

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Add comment and remove unused vars

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Add test for buildpack incompatibility error

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Fix typo

Signed-off-by: Natalie Arellano <narellano@vmware.com>
2022-05-04 11:45:26 -04:00
Mikey Boldt aaf097aa25
Get `make lint` to work out of the box with Go 1.17 (#748)
* Update golangci-lint to the latest version, and fix lint errors.

Signed-off-by: Mikey Boldt <mboldt@vmware.com>

* Exit upon error getting the lifecycle layer.

Signed-off-by: Mikey Boldt <mboldt@vmware.com>

* Formatting and linting cleanup.

Signed-off-by: Mikey Boldt <mboldt@vmware.com>
2021-11-03 11:44:12 -04:00
Natalie Arellano 9b72550dd3
Merge release/0.12.0 into main (#739)
* Run image should be locked to a digest in analyzed.toml (#720)

* Run image should be locked to a digest in analyzed.toml

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Use more flexible matcher for other test

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Update github actions to use cosign v1.2.0 (#708)

* Introduce new api version helpers (#705)

* Introduce new api version helpers

This makes the code a little easier to read.

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Fix

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Remove comment

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Fix lint

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Update github actions to use cosign v1.2.0

Signed-off-by: Sambhav Kothari <skothari44@bloomberg.net>

Co-authored-by: Natalie Arellano <narellano@vmware.com>

* Add information about buildpacksio/lifecycle (#707)

* Introduce new api version helpers (#705)

* Introduce new api version helpers

This makes the code a little easier to read.

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Fix

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Remove comment

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Fix lint

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Add information about buildpacksio/lifecycle

This information should be copied to the Docker Hub repo "about" section.

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Small fix

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Small fix

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Update steps for verifying SBOM

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Update the README for platform 0.7 (#704)

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Fix umask race (#722)

* Set umask before extracting layers to avoid race condition

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Add comment

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Update archive/extract.go

Signed-off-by: Natalie Arellano <narellano@vmware.com>

Co-authored-by: Anthony Emengo <aemengo@vmware.com>

* Don't try to set the umask outside of extract

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Don't try to read umask in extract

Signed-off-by: Natalie Arellano <narellano@vmware.com>

Co-authored-by: Anthony Emengo <aemengo@vmware.com>

* Buildpack api 0.7 is not supported (#726)

* Buildpack api 0.7 is not supported

We missed this when backing out asset packages.

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Fix

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Use the correct tag when signing the sbom (#729)

* Use the correct tag when signing the sbom

Also there is no need to parse the digest from `crane tag` because it does not change.
This will make the code less brittle.

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Add manifest sha when validating semver

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Fix

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Fix

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Ensure umask is unset when extracting archive (#727)

* Ensure umask is unset when extracting archive

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Add test

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Fix

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Get the current umask without changing it

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Fix

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Fix windows

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Fix windows

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Update per review comments

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Less confusing wording

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Reduce the diff

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Fix

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Added comments

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Better wording

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Add test that system umask is used to create non existent directory not in tar file

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Variable names and formatting

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Try to fix windows

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Avoid direct dependency on archive

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Make test setup simpler and update comment

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Add build directive

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Apply suggestions from code review

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Fix Codecov

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Fix lint

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Set Umask as part of archive.Extract

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Move the unlock methods to be under defer
instead at the end of the function in case setUmask will panic.

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Bump imgutil (#731)

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Fix merge

Signed-off-by: Natalie Arellano <narellano@vmware.com>

Co-authored-by: Sambhav Kothari <skothari44@bloomberg.net>
Co-authored-by: Anthony Emengo <aemengo@vmware.com>
Co-authored-by: Yael Harel <yharel@vmware.com>
Co-authored-by: Yael Harel <43007598+yaelharel@users.noreply.github.com>
2021-10-26 12:27:59 -04:00
Natalie Arellano 7af70d23f8
Add minimal exporter and creator acceptance tests (#698)
* Create scaffold

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Check output image in registry

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Check output image in daemon

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Fix

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Check output cache image

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Fix

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Skip cache image check

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Add minimal creator tests

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Introduce "phase" acceptance test helpers and update analyze tests to use them

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Acceptance tests are all passing maybe

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Tests are passing

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Remove unused functions

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Remove TODO

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Remove TODOs

Signed-off-by: Natalie Arellano <narellano@vmware.com>

* Try to fix Windows

Signed-off-by: Juan Bustamante <jbustamante@vmware.com>

Co-authored-by: Juan Bustamante <jbustamante@vmware.com>
2021-08-30 13:08:43 -04:00
Jason Hall e0d2b69e1f Build lifecycle binaries and images for linux/arm64
This changes make build to build for linux/amd64, windows/amd64, and
newly, linux/arm64. Binaries are built to paths like
out/$GOOS-$GOARCH/lifecycle, etc.

This also changes the CI image build process to build and attach the
amd64 binary to the build, and to include the linux/arm64 image in the
manifest list.

Acceptance tests were updated to build arch-specific binaries and to
look for them in the new correct place.

Signed-off-by: Jason Hall <jasonhall@redhat.com>
2021-07-12 13:37:37 -04:00
Sonia Singla 28ac71b7e6 Fix G204 by adding comment
Signed-off-by: Sonia Singla <soniasingla.1812@gmail.com>
2021-05-06 18:05:46 +00:00
Micah Young 072b3d5ddd Fixes sec
Signed-off-by: Micah Young <ymicah@vmware.com>
2021-03-25 11:23:11 -04:00
Micah Young b592348df2
Merge branch 'main' into fix/analyzer-acceptance-windows 2021-03-25 11:16:25 -04:00
Natalie Arellano 4624a8a5bf Skip only specific errors
Signed-off-by: Natalie Arellano <narellano@vmware.com>
2021-03-24 16:55:12 -04:00
Micah Young a39a06edb4
Update testhelpers/docker.go
Signed-off-by: Micah Young <ymicah@vmware.com>

Co-authored-by: Natalie Arellano <narellano@vmware.com>
2021-03-23 06:33:29 -04:00
Natalie Arellano ab0c8e9351 Turn on gosec
- test-only changes + nolint

Signed-off-by: Natalie Arellano <narellano@vmware.com>
2021-03-18 13:51:46 -04:00
Micah Young dc000fe7af Fixes acceptance analyzer tests to run on WCOW
* Changes test helper signature to group related args
* Adds GHA step to add insecure-registries entry
  * Test helpers will use the field to determine registry host
* Changes to use imgutil for authorized/readonly registries

Signed-off-by: Micah Young <ymicah@vmware.com>
2021-03-16 07:58:09 -04:00
Natalie Arellano d9d94adf1c Pass file handle to exec.d on Windows
Signed-off-by: Natalie Arellano <narellano@vmware.com>
2021-02-24 14:56:06 -05:00
Natalie Arellano 1e2b2d69a5 Move buildpack code into own package
Signed-off-by: Natalie Arellano <narellano@vmware.com>
2021-02-16 09:57:48 -05:00
Emily Casey 58a5f5a066
Merge pull request #409 from buildpacks/fix/339-auth-config
Resolve auth before dropping privileges
2020-12-14 18:47:02 -05:00
Natalie Arellano 962fa27b15 Update from PR review
Signed-off-by: Natalie Arellano <narellano@vmware.com>
2020-12-14 16:59:51 -05:00
Yael Harel 0207fb5f86 Resolve auth before dropping privileges
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Yael Harel <yharel@vmware.com>
2020-12-10 16:39:18 -05:00
Emily Casey e461c2ccfb Fixes test cleanup error on windows
* Ensures all opened files are properly closed.
* Bumps imgutil

Signed-off-by: Emily Casey <ecasey@vmware.com>
2020-10-08 11:30:24 -04:00
Yael Harel c5adecf0fd Move the containerName and copyDir initialization and deletion
to one place for all of the analyzer acceptance tests

Signed-off-by: Yael Harel <yharel@vmware.com>
2020-08-12 14:56:38 -04:00
Yael Harel 62f13cfb32 Delete container, volume and temp directory as part of it.After
Everything will be deleted even if the docker run command failed

Signed-off-by: Yael Harel <yharel@vmware.com>
2020-08-11 21:18:34 -04:00
Yael Harel a2767f276c Review feedback
Signed-off-by: Yael Harel <yharel@vmware.com>
2020-08-11 19:55:43 -04:00
Emily Casey cddc9b9a43 Multi-API lifecycle descriptor
Signed-off-by: Emily Casey <ecasey@vmware.com>
2020-07-30 12:13:16 -04:00
Emily Casey 46f9ad01df Remove duplicaiton in test helpers
Signed-off-by: Emily Casey <ecasey@vmware.com>
2020-07-23 17:24:45 -04:00
Emily Casey e2140ef330 Merge remote-tracking branch 'origin' into merge-slice-fix 2020-07-23 17:19:30 -04:00
Emily Casey 0766151ace merge slice fixes from 0.8.1 into main
refactors windows logic to use new layers package

Signed-off-by: Emily Casey <ecasey@vmware.com>
2020-07-20 17:55:40 -04:00