Skip to content

Commit

Permalink
Merge pull request #878 from david22swan/CONT-24/docker_Stack
Browse files Browse the repository at this point in the history
(CONT-24) docker_stack always redoploying
  • Loading branch information
jordanbreen28 committed Dec 2, 2022
2 parents 4c1dda4 + 8fae2aa commit 7bfc68d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/puppet/provider/docker_compose/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ def exists?
args = [compose_files, '-p', name, 'config'].insert(3, resource[:options]).compact
compose_output = YAML.safe_load(execute([command(:dockercompose)] + args, combine: false), [Symbol])

# rubocop:disable Style/StringLiterals
containers = docker([
'ps',
'--format',
"{{.Label \"com.docker.compose.service\"}}-{{.Image}}",
"'{{.Label \"com.docker.compose.service\"}}-{{.Image}}'",
'--filter',
"label=com.docker.compose.project=#{name}",
]).split("\n")
Expand All @@ -49,7 +48,7 @@ def exists?
counts = Hash[*compose_services.each.map { |key, array|
image = (array['image']) ? array['image'] : get_image(key, compose_services)
Puppet.info("Checking for compose service #{key} #{image}")
[key, compose_containers.count("#{key}-#{image}")]
[key, compose_containers.count("'#{key}-#{image}'")]
}.flatten]

# No containers found for the project
Expand Down

0 comments on commit 7bfc68d

Please sign in to comment.