aboutsummaryrefslogtreecommitdiff
path: root/pkg/autoupdate
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2020-06-16 10:52:13 +0200
committerValentin Rothberg <rothberg@redhat.com>2020-06-16 10:52:13 +0200
commit2a565f49c2a7cfc4dbb2394d7ded786f20256234 (patch)
tree99d270b45003efe5bf98fd58b98cf861948fd79d /pkg/autoupdate
parent2c7b39ddb8961bf547a36420407adb461dd4c227 (diff)
downloadpodman-2a565f49c2a7cfc4dbb2394d7ded786f20256234.tar.gz
podman-2a565f49c2a7cfc4dbb2394d7ded786f20256234.tar.bz2
podman-2a565f49c2a7cfc4dbb2394d7ded786f20256234.zip
auto-update: use image's arch
Use the architecture of the local image when looking for a new image on a registry. It seems to be common practice on ARM to tweak the architecture choice to pull the correct image. Fixes: #6613 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'pkg/autoupdate')
-rw-r--r--pkg/autoupdate/autoupdate.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/pkg/autoupdate/autoupdate.go b/pkg/autoupdate/autoupdate.go
index eca5c342c..0ec98d3b6 100644
--- a/pkg/autoupdate/autoupdate.go
+++ b/pkg/autoupdate/autoupdate.go
@@ -251,8 +251,19 @@ func newerImageAvailable(runtime *libpod.Runtime, img *image.Image, origName str
return false, err
}
+ data, err := img.Inspect(context.Background())
+ if err != nil {
+ return false, err
+ }
+
sys := runtime.SystemContext()
sys.AuthFilePath = options.Authfile
+
+ // We need to account for the arch that the image uses. It seems
+ // common on ARM to tweak this option to pull the correct image. See
+ // github.com/containers/libpod/issues/6613.
+ sys.ArchitectureChoice = data.Architecture
+
remoteImg, err := remoteRef.NewImage(context.Background(), sys)
if err != nil {
return false, err