summaryrefslogtreecommitdiff
path: root/pkg/autoupdate/autoupdate.go
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2021-08-30 13:28:11 +0200
committerValentin Rothberg <rothberg@redhat.com>2021-08-30 13:49:35 +0200
commitde3920c0e970324f9d5238c13caf1020efefbd7f (patch)
tree7713d545457b7d5c83a7f09da64e4ecded08c44c /pkg/autoupdate/autoupdate.go
parenta2acd04447a66027dc02a210d2961fcde6868985 (diff)
downloadpodman-de3920c0e970324f9d5238c13caf1020efefbd7f.tar.gz
podman-de3920c0e970324f9d5238c13caf1020efefbd7f.tar.bz2
podman-de3920c0e970324f9d5238c13caf1020efefbd7f.zip
auto-update: fix authfile label
Make sure that the container's authfile label is used when pulling down a new image. [NO TESTS NEEDED] since it would require some larger rewrite of the auto-update system tests that I currently have no time for. I added a reminder to have some breadcrumbs when there is more time. Fixes: #11171 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'pkg/autoupdate/autoupdate.go')
-rw-r--r--pkg/autoupdate/autoupdate.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/autoupdate/autoupdate.go b/pkg/autoupdate/autoupdate.go
index b1ebbfa8e..894178bb9 100644
--- a/pkg/autoupdate/autoupdate.go
+++ b/pkg/autoupdate/autoupdate.go
@@ -224,7 +224,7 @@ func autoUpdateRegistry(ctx context.Context, image *libimage.Image, ctr *libpod.
return report, nil
}
- if _, err := updateImage(ctx, runtime, rawImageName, options); err != nil {
+ if _, err := updateImage(ctx, runtime, rawImageName, authfile); err != nil {
return report, errors.Wrapf(err, "registry auto-updating container %q: image update for %q failed", cid, rawImageName)
}
updatedRawImages[rawImageName] = true
@@ -417,9 +417,9 @@ func newerLocalImageAvailable(runtime *libpod.Runtime, img *libimage.Image, rawI
}
// updateImage pulls the specified image.
-func updateImage(ctx context.Context, runtime *libpod.Runtime, name string, options *entities.AutoUpdateOptions) (*libimage.Image, error) {
+func updateImage(ctx context.Context, runtime *libpod.Runtime, name, authfile string) (*libimage.Image, error) {
pullOptions := &libimage.PullOptions{}
- pullOptions.AuthFilePath = options.Authfile
+ pullOptions.AuthFilePath = authfile
pullOptions.Writer = os.Stderr
pulledImages, err := runtime.LibimageRuntime().Pull(ctx, name, config.PullPolicyAlways, pullOptions)