summaryrefslogtreecommitdiff
path: root/pkg/autoupdate/autoupdate.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-05-18 21:39:34 +0200
committerGitHub <noreply@github.com>2020-05-18 21:39:34 +0200
commit1332c8b3abe814795c60c4dce7ee708470fc6177 (patch)
treeca8685f95c2fd8545d1f99298ae1522284967c45 /pkg/autoupdate/autoupdate.go
parent50ceb261ef538e0071c2c99edb5e0ecd524d5dbd (diff)
parent9177c89eddb0b7e392c60614eb30073bd7859401 (diff)
downloadpodman-1332c8b3abe814795c60c4dce7ee708470fc6177.tar.gz
podman-1332c8b3abe814795c60c4dce7ee708470fc6177.tar.bz2
podman-1332c8b3abe814795c60c4dce7ee708470fc6177.zip
Merge pull request #6188 from neVERberleRfellerER/autoupdate-systemd-envvar
Give `auto-update` ability to use per-container authfile specified by label.
Diffstat (limited to 'pkg/autoupdate/autoupdate.go')
-rw-r--r--pkg/autoupdate/autoupdate.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/pkg/autoupdate/autoupdate.go b/pkg/autoupdate/autoupdate.go
index 1b0419892..eca5c342c 100644
--- a/pkg/autoupdate/autoupdate.go
+++ b/pkg/autoupdate/autoupdate.go
@@ -23,6 +23,10 @@ import (
// container labels.
const Label = "io.containers.autoupdate"
+// Label denotes the container label key to specify authfile in
+// container labels.
+const AuthfileLabel = "io.containers.autoupdate.authfile"
+
// Policy represents an auto-update policy.
type Policy string
@@ -144,6 +148,11 @@ func AutoUpdate(runtime *libpod.Runtime, options Options) ([]string, []error) {
if rawImageName == "" {
errs = append(errs, errors.Errorf("error auto-updating container %q: raw-image name is empty", ctr.ID()))
}
+ labels := ctr.Labels()
+ authFilePath, exists := labels[AuthfileLabel]
+ if exists {
+ options.Authfile = authFilePath
+ }
needsUpdate, err := newerImageAvailable(runtime, image, rawImageName, options)
if err != nil {
errs = append(errs, errors.Wrapf(err, "error auto-updating container %q: image check for %q failed", ctr.ID(), rawImageName))