Commit Graph

7 Commits

Author SHA1 Message Date
Natalie Arellano 84a94d59df
Fixes for run image extension (#1134)
* 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>
2023-07-05 16:23:20 -04:00
Natalie Arellano 7f4666ed2b
Fixes for rebase and log message improvements (#1122)
- Fix daemon invocation by trying to read app image after we have a docker client
- Don't do stack validation for images built on newer platforms

Signed-off-by: Natalie Arellano <narellano@vmware.com>
2023-06-14 15:19:20 -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
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 2e739d6de5
Dockerfiles phase 1 (detect changes) (#860)
Detect changes to support Dockerfiles feature

Signed-off-by: Natalie Arellano <narellano@vmware.com>
2022-06-08 10:09:31 -04:00
Natalie Arellano 828906b144
Write sbom.legacy.json files for newer platform api (#825)
* Write sbom.legacy.json files for newer platform api

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

* Don't print empty bom for platform 0.9

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

* Fix function name

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

* Return empty bom for newer platform

Due to limitations of our TOML library, we can't add MarshalTOML to the top-level struct.

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

* Use standard capitalization for sbom

Signed-off-by: Natalie Arellano <narellano@vmware.com>
2022-03-21 17:30:48 -04:00
Yael Harel 2186200870
Move the layer metadata restorer and the layer sha store to a new package (#724)
* Move the layer metadata restorer and the layer sha store to a new package

Signed-off-by: Yael Harel <yharel@vmware.com>

* Remove code duplication of WriteTOML

Signed-off-by: Yael Harel <yharel@vmware.com>

* Create a utils package

Move most of utils.go and the function WriteTOML there

Signed-off-by: Yael Harel <yharel@vmware.com>

* Refactor the new utils package

Signed-off-by: Yael Harel <yharel@vmware.com>

* Make layermetadata an internal package

Signed-off-by: Yael Harel <yharel@vmware.com>

* Move the imageutils files to the image package

Signed-off-by: Yael Harel <yharel@vmware.com>

* Make encoding an internal package

Signed-off-by: Yael Harel <yharel@vmware.com>

* Add the ReadGroup test

Signed-off-by: Yael Harel <yharel@vmware.com>

* Delete image/utils_test.go

WriteTOML that was tested there  moved to the internal/encoding package

Signed-off-by: Yael Harel <yharel@vmware.com>

* Updates to #724 (layer metadata restorer) (#753)

* Merge main

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

* Rename layermetadata to layer

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

* Rename layer metadata restorer

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

* WIP - layers.go has all dependencies on buildpack

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

* WIP

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

* Fix imports

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

* Move some things back to lifecycle package and make str package internal

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

* Rename variable

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

* Make helper function private

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

* Small fix

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

* Fix

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

* Make structs and interface private

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

* Consolidate logic for layer metadata file

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

* Remove unneeded file

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

Co-authored-by: Natalie Arellano <narellano@vmware.com>
2021-12-01 15:04:19 -05:00