mirror of
https://github.com/containers/podman.git
synced 2025-06-24 11:28:24 +08:00
auto-update: make restarted unit more obvious
The output of auto-update leaves quite some space for improvements. One thing is to make it more obvious which systemd units were restarted. With this change, the output looks as follows: ``` $ podman auto-update Trying to pull... Restarted the following systemd units: $unit-1 $unit-2 $unit-3 ``` Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
@ -50,7 +50,9 @@ func autoUpdate(cmd *cobra.Command, args []string) error {
|
||||
return errors.Errorf("`%s` takes no arguments", cmd.CommandPath())
|
||||
}
|
||||
report, failures := registry.ContainerEngine().AutoUpdate(registry.GetContext(), autoUpdateOptions)
|
||||
if report != nil {
|
||||
if report != nil && len(report.Units) > 0 {
|
||||
// Make it more obvious to users what the output means.
|
||||
fmt.Println("\nRestarted the following systemd units:")
|
||||
for _, unit := range report.Units {
|
||||
fmt.Println(unit)
|
||||
}
|
||||
|
@ -123,6 +123,8 @@ function _confirm_update() {
|
||||
_wait_service_ready container-$cname.service
|
||||
run_podman auto-update
|
||||
is "$output" "Trying to pull.*" "Image is updated."
|
||||
is "$output" ".*Restarted the following systemd units:
|
||||
container-$cname.service" "Systemd unit has been restarted"
|
||||
_confirm_update $cname $ori_image
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user