Use pullOptions.systemContext in getDestArtifact

Right now, this correctly handles pullOptions.credentials
which were ignored previously (admittedly that field is never set
by anything...); in the future, it will ensure the two c/image users
won't get out of sync again.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
Miloslav Trmač
2026-02-27 19:57:16 +01:00
parent 5946f7afcf
commit fd86c3c25f

View File

@@ -229,8 +229,9 @@ func (o *OCIArtifactDisk) getDestArtifact() (types.ImageReference, digest.Digest
return nil, "", err
}
fmt.Printf("Looking up Podman Machine image at %s to create VM\n", imgRef.DockerReference())
sysCtx := &types.SystemContext{
DockerInsecureSkipTLSVerify: o.pullOptions.skipTLSVerify,
sysCtx, err := o.pullOptions.systemContext()
if err != nil {
return nil, "", err
}
imgSrc, err := imgRef.NewImageSource(o.ctx, sysCtx)
if err != nil {