mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-08-05 00:15:44 +00:00
podman auto-update: include container in invalid policy message
I noticed recently when I made a typo that then auto-update errored but it did not tell me which container was incorrect so I had to check all containers myself. Include the container ID in the error to make it clear which container has the issue. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
parent
76b70b630c
commit
e55270a51a
2 changed files with 3 additions and 4 deletions
|
|
@ -393,7 +393,7 @@ func (u *updater) assembleTasks(ctx context.Context) []error {
|
|||
}
|
||||
policy, err := LookupPolicy(value)
|
||||
if err != nil {
|
||||
errs = append(errs, err)
|
||||
errs = append(errs, fmt.Errorf("auto-updating container %q: %w", ctr.ID(), err))
|
||||
continue
|
||||
}
|
||||
if policy == PolicyDefault {
|
||||
|
|
|
|||
|
|
@ -267,7 +267,7 @@ function _confirm_update() {
|
|||
|
||||
_wait_service_ready container-$cname.service
|
||||
run_podman 125 auto-update
|
||||
is "$output" ".*invalid auto-update policy.*" "invalid policy setup"
|
||||
assert "$output" =~ 'auto-updating container "[0-9a-f]{64}": invalid auto-update policy "'"$fakevalue"'": valid policies are \["disabled" "image" "local" "registry"\]' "invalid policy setup"
|
||||
|
||||
run_podman inspect --format "{{.Image}}" $cname
|
||||
is "$output" "$ori_image" "Image ID should not change"
|
||||
|
|
@ -384,8 +384,7 @@ EOF
|
|||
# Exit code is expected, due to invalid 'fakevalue'
|
||||
run_podman 125 auto-update --rollback=false
|
||||
update_log=$output
|
||||
is "$update_log" ".*invalid auto-update policy.*" "invalid policy setup"
|
||||
is "$update_log" ".*Error: invalid auto-update policy.*" "invalid policy setup"
|
||||
assert "$update_log" =~ '.*Error: auto-updating container "[0-9a-f]{64}": invalid auto-update policy.*' "invalid policy setup"
|
||||
|
||||
local n_updated=$(grep -c 'Trying to pull' <<<"$update_log")
|
||||
is "$n_updated" "2" "Number of images updated from registry."
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue