File tree Expand file tree Collapse file tree 3 files changed +14
-9
lines changed
lib/puppet/parser/functions Expand file tree Collapse file tree 3 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -46,8 +46,8 @@ module Puppet::Parser::Functions
4646 flags << '--detach=true'
4747 end
4848
49- if opts [ 'health_check_cmd' ]
50- flags << "--health-cmd ' #{ opts [ 'health_check_command ' ] } || exit 1' "
49+ if opts [ 'health_check_cmd' ] . to_s != 'undef'
50+ flags << "--health-cmd #{ opts [ 'health_check_cmd ' ] } "
5151 end
5252
5353 if opts [ 'tty' ]
Original file line number Diff line number Diff line change 211211 }
212212
213213 if $::osfamily == ' windows' {
214- $exec_environment = ' PATH=C:/Program Files/Docker/'
214+ $exec_environment = ' PATH=C:/Program Files/Docker/;C:/Windows/System32/ '
215215 $exec_timeout = 3000
216216 $exec_path = [' c:/Windows/Temp/' , ' C:/Program Files/Docker/' ]
217217 $exec_provider = ' powershell'
218218 $cidfile = " c:/Windows/Temp/${service_prefix}${sanitised_title} .cid"
219- $restart_check = " ${docker_command} inspect ${sanitised_title} -f '{{ if eq \" unhealthy\" .State.Health.Status }} {{ .Name }}{{ end }}' | findstr ${sanitised_title} "
219+ $restart_check = " ${docker_command} inspect ${sanitised_title} -f '{{ if eq \\\ " unhealthy\\ \" .State.Health.Status }} {{ .Name }}{{ end }}' | findstr ${sanitised_title} "
220220 } else {
221221 $exec_environment = ' HOME=/root'
222222 $exec_path = [' /bin' , ' /usr/bin' ]
Original file line number Diff line number Diff line change @@ -754,16 +754,21 @@ class { 'docker': #{docker_ee_arg} }
754754 it 'should restart a unhealthy container' do
755755 pp5 = <<-EOS
756756 docker::run { 'container_3_7_3':
757- image => 'base ',
757+ image => '#{ default_image } ',
758758 command => '#{ default_run_command } ',
759- health_check_cmd => 'pwd ',
759+ health_check_cmd => 'echo ',
760760 restart_on_unhealthy => true,
761+ #{ default_docker_run_arg }
761762 }
762763 EOS
763764
764- apply_manifest ( pp5 , :catch_failures => true ) do |r |
765- expect ( r . stdout ) . to match ( /docker-container_3_7_3-systemd-reload/ )
766- end
765+ if fact ( 'osfamily' ) == 'windows'
766+ apply_manifest ( pp5 , :catch_failures => true )
767+ else
768+ apply_manifest ( pp5 , :catch_failures => true ) do |r |
769+ expect ( r . stdout ) . to match ( /docker-container_3_7_3-systemd-reload/ )
770+ end
771+ end
767772 end
768773 end
769774
You can’t perform that action at this time.
0 commit comments