Use a different info message when image changed
This commit is contained in:
parent
d8c56be510
commit
aaef5da41d
|
@ -59,9 +59,14 @@ module VagrantPlugins
|
|||
id = "$(cat #{config[:cidfile]})"
|
||||
|
||||
if container_exists?(id)
|
||||
|
||||
if container_args_changed?(config) or container_img_changed?(config)
|
||||
@machine.ui.info(I18n.t("vagrant.docker_restarting_container",
|
||||
if container_args_changed?(config)
|
||||
@machine.ui.info(I18n.t("vagrant.docker_restarting_container_args",
|
||||
name: config[:name],
|
||||
))
|
||||
stop_container(id)
|
||||
create_container(config)
|
||||
elsif container_image_changed?(config)
|
||||
@machine.ui.info(I18n.t("vagrant.docker_restarting_container_image",
|
||||
name: config[:name],
|
||||
))
|
||||
stop_container(id)
|
||||
|
@ -95,7 +100,7 @@ module VagrantPlugins
|
|||
lookup_container(id)
|
||||
end
|
||||
|
||||
def container_img_changed?(config)
|
||||
def container_image_changed?(config)
|
||||
# Returns true if there is a container running with the given :name,
|
||||
# and the container is not using the latest :image.
|
||||
|
||||
|
|
|
@ -135,8 +135,10 @@ en:
|
|||
Building Docker images...
|
||||
docker_running: |-
|
||||
-- Container: %{name}
|
||||
docker_restarting_container: |-
|
||||
-- Detected changes to container '%{name}', restarting...
|
||||
docker_restarting_container_args: |-
|
||||
-- Detected changes to container '%{name}' args, restarting...
|
||||
docker_restarting_container_image: |-
|
||||
-- Detected newer image for container '%{name}', restarting...
|
||||
docker_starting_containers: |-
|
||||
Starting Docker containers...
|
||||
inserted_key: |-
|
||||
|
|
Loading…
Reference in New Issue