sous-chefs / docker

Development repository for the docker cookbook
https://supermarket.chef.io/cookbooks/docker
Apache License 2.0
1.35k stars 794 forks source link

docker_container network_mode "container:*" leads to redeploy on every chef client run #1273

Open promisedlandt opened 2 months ago

promisedlandt commented 2 months ago

:ghost: Brief Description

Setting network_mode to container:<container_name> leads to redeploy on every chef client run.

:pancakes: Cookbook version

11.3.0

:woman_cook: Chef-Infra Version

18.3.0

:tophat: Platform details

Debian 12.5

Steps To Reproduce

docker_container "network_service_container"

docker_container "client_container" do
  network_mode "container:network_service_container"
end
* docker_container[client_container] action run
  - stopping client_container
  - deleting client_container
  - update client_container
  -   set network_mode to "container:network_service_container" (was "container:374d7208decaf73542bd241b3c50e7580af2d29dc9f3da8a26352209e702e320")
  - starting client_container

:police_car: Expected behavior

If the container ID in network_mode references a container with the given name, the property should not count as changed, so converged_if_changed should not converge.