Skip to content

Commit

Permalink
Merge pull request #6615 from vrothberg/auto-update-variant
Browse files Browse the repository at this point in the history
auto-update: use image's arch
  • Loading branch information
openshift-merge-robot authored Jun 16, 2020
2 parents e0dd227 + af3c4d8 commit 0968f25
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/api/handlers/compat/images_build.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func BuildImage(w http.ResponseWriter, r *http.Request) {
}
}

anchorDir, err := extractTarFile(r, w)
anchorDir, err := extractTarFile(r)
if err != nil {
utils.InternalServerError(w, err)
return
Expand Down Expand Up @@ -241,7 +241,7 @@ func BuildImage(w http.ResponseWriter, r *http.Request) {
})
}

func extractTarFile(r *http.Request, w http.ResponseWriter) (string, error) {
func extractTarFile(r *http.Request) (string, error) {
// build a home for the request body
anchorDir, err := ioutil.TempDir("", "libpod_builder")
if err != nil {
Expand Down
11 changes: 11 additions & 0 deletions pkg/autoupdate/autoupdate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0968f25

Please sign in to comment.