-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes for run image extension #1134
Conversation
Will undraft once tests are added |
9fd794a
to
fdf2f9f
Compare
First fix: pack v0.30.0-pre2 has a bug where registry credentials for the run image are not provided to the restorer, we can see the failure here with broken pack and fixed lifecycle (this branch):
With fixed pack (buildpacks/pack#1815) and fixed lifecycle:
|
Signed-off-by: Natalie Arellano <narellano@vmware.com>
…ructions (vs more than one instruction) Signed-off-by: Natalie Arellano <narellano@vmware.com>
…ent 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>
Don't print `%!s(<nil>)` if nil is provided to the "parse maybe" function Signed-off-by: Natalie Arellano <narellano@vmware.com>
…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>
…port 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>
… (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>
fdf2f9f
to
07a7676
Compare
Signed-off-by: Natalie Arellano <narellano@vmware.com>
var ( | ||
remoteRunImage imgutil.Image | ||
) | ||
runImageName := analyzedMD.RunImageImage() // FIXME: if we have a digest reference available in `Reference` (e.g., in the non-daemon case) we should use it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just verifying you still want this FIXME
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be an edge case and not super important to fix right now
{ | ||
condition: "has an implicit tag and has a digest", | ||
provided: "some.registry/some-library/some-repo@sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", | ||
does: "adds an explicit tag and removes the digest", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's surprising to me that this is the desired behavior?
if err = files.DecodeBuildMetadata(launch.GetMetadataFilePath(inputs.LayersDir), inputs.PlatformAPI, buildMD); err != nil { | ||
return files.RunImageForExport{}, err | ||
} | ||
if len(buildMD.Extensions) > 0 { // FIXME: try to know for sure if extensions were used to switch the run image |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how could you know for sure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for sure without some spec changes... but I would rather tackle this in tandem with buildpacks/rfcs#285
…not found when we are only updating the reference and target data in analyzed.toml Signed-off-by: Natalie Arellano <narellano@vmware.com>
9434a2d
to
eb08a3c
Compare
Signed-off-by: Natalie Arellano <narellano@vmware.com>
60603a3
to
ff750f3
Compare
* 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>
* 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>
restore
, fail if the remote image is not foundgenerate
, set extend to true if there are any instructions (vs more than one instruction)export
i.e., “run image for rebase”)export
, continue to use run image identifier (which could be a digest reference or daemon image ID) as the run image reference instead of falling back to image name when exporting to a daemonexport
, 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