summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-08-31 04:16:58 -0400
committerGitHub <noreply@github.com>2021-08-31 04:16:58 -0400
commit83de22e892bf0d8efd29a73df462789e2b1418f3 (patch)
treefad0f580b75fccb9d2780f42635287fdbdec1873
parent95ac8f180f26d7ed4cf2945aa206a156b7a169ca (diff)
parentde3920c0e970324f9d5238c13caf1020efefbd7f (diff)
downloadpodman-83de22e892bf0d8efd29a73df462789e2b1418f3.tar.gz
podman-83de22e892bf0d8efd29a73df462789e2b1418f3.tar.bz2
podman-83de22e892bf0d8efd29a73df462789e2b1418f3.zip
Merge pull request #11357 from vrothberg/fix-11171
auto-update: fix authfile label
-rw-r--r--pkg/autoupdate/autoupdate.go6
-rw-r--r--test/system/255-auto-update.bats3
2 files changed, 6 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)
diff --git a/test/system/255-auto-update.bats b/test/system/255-auto-update.bats
index 7766ca3f9..b172bb917 100644
--- a/test/system/255-auto-update.bats
+++ b/test/system/255-auto-update.bats
@@ -149,6 +149,9 @@ function _confirm_update() {
}
@test "podman auto-update - label io.containers.autoupdate=image with rollback" {
+ # FIXME: this test should exercise the authfile label to have a regression
+ # test for #11171.
+
# Note: the autoupdatebroken image is empty on purpose so it cannot be
# executed and force a rollback. The rollback test for the local policy
# is exercising the case where the container doesn't send a ready message.