diff options
author | Valentin Rothberg <rothberg@redhat.com> | 2021-07-15 11:27:25 +0200 |
---|---|---|
committer | Valentin Rothberg <rothberg@redhat.com> | 2021-07-15 11:39:50 +0200 |
commit | 59f31d86acdf54019b081ca86340d5c33dbcf3b9 (patch) | |
tree | 3b243e70c88bb03880d6f1fc459d5f1d57e07cce /cmd/podman/auto-update.go | |
parent | 1568247ec8fa0c1a23bbd4631c1ea2fcfd85e281 (diff) | |
download | podman-59f31d86acdf54019b081ca86340d5c33dbcf3b9.tar.gz podman-59f31d86acdf54019b081ca86340d5c33dbcf3b9.tar.bz2 podman-59f31d86acdf54019b081ca86340d5c33dbcf3b9.zip |
auto-update: add --dry-run
Add a --dry-run flag to `podman auto-update` which will look for new
images but won't perform any pull or restart any service or container.
The "UPDATED" column will now indicate the availability of a newer image
via "pending".
```
$ podman auto-update --dry-run
UNIT CONTAINER IMAGE POLICY UPDATED
container-test.service 08fd34e533fd (test) localhost:5000/busybox registry false
```
Fixes: #9949
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'cmd/podman/auto-update.go')
-rw-r--r-- | cmd/podman/auto-update.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/cmd/podman/auto-update.go b/cmd/podman/auto-update.go index 6ccf4e167..9622088d5 100644 --- a/cmd/podman/auto-update.go +++ b/cmd/podman/auto-update.go @@ -53,6 +53,8 @@ func init() { flags.StringVar(&autoUpdateOptions.Authfile, authfileFlagName, auth.GetDefaultAuthFile(), "Path to the authentication file. Use REGISTRY_AUTH_FILE environment variable to override") _ = autoUpdateCommand.RegisterFlagCompletionFunc(authfileFlagName, completion.AutocompleteDefault) + flags.BoolVar(&autoUpdateOptions.DryRun, "dry-run", false, "Check for pending updates") + flags.StringVar(&autoUpdateOptions.format, "format", "", "Change the output format to JSON or a Go template") _ = autoUpdateCommand.RegisterFlagCompletionFunc("format", common.AutocompleteFormat(autoUpdateOutput{})) } |