Skip to content

Commit

Permalink
Merge pull request #11522 from vrothberg/backport-11171
Browse files Browse the repository at this point in the history
[v3.3.1-rhel] auto-update: fix authfile label
  • Loading branch information
openshift-merge-robot authored Sep 10, 2021
2 parents 405507a + 610695e commit 8305248
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions pkg/autoupdate/autoupdate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, "error registry auto-updating container %q: image update for %q failed", cid, rawImageName)
}
updatedRawImages[rawImageName] = true
Expand Down Expand Up @@ -379,9 +379,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)
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ registries = ['{{.Host}}:{{.Port}}']`
search := podmanTest.Podman([]string{"search", "docker.io/alpine"})
search.WaitWithDefaultTimeout()
Expect(search).Should(Exit(0))
Expect(len(search.OutputToStringArray())).To(Equal(26))
Expect(len(search.OutputToStringArray())).To(BeNumerically(">", 10))

search = podmanTest.Podman([]string{"search", "--limit", "3", "docker.io/alpine"})
search.WaitWithDefaultTimeout()
Expand Down Expand Up @@ -462,7 +462,7 @@ registries = ['{{.Host}}:{{.Port}}']`
search = podmanTest.Podman([]string{"search", "--list-tags", "docker.io/library/alpine"})
search.WaitWithDefaultTimeout()
Expect(search).Should(Exit(0))
Expect(len(search.OutputToStringArray()) > 2).To(BeTrue())
Expect(len(search.OutputToStringArray())).To(BeNumerically(">", 2))

search = podmanTest.Podman([]string{"search", "--filter=is-official", "--list-tags", "docker.io/library/alpine"})
search.WaitWithDefaultTimeout()
Expand All @@ -477,6 +477,6 @@ registries = ['{{.Host}}:{{.Port}}']`
search := podmanTest.Podman([]string{"search", "--limit", "130", "registry.redhat.io/rhel"})
search.WaitWithDefaultTimeout()
Expect(search).Should(Exit(0))
Expect(len(search.OutputToStringArray())).To(Equal(131))
Expect(len(search.OutputToStringArray())).To(BeNumerically("<=", 131))
})
})

0 comments on commit 8305248

Please sign in to comment.