mirror of https://github.com/containers/podman.git
Merge pull request #26631 from Luap99/autoupdate-error
podman auto-update: include container in invalid policy message
This commit is contained in:
commit
6b9a3066b6
|
@ -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…
Reference in New Issue