File tree 3 files changed +14
-9
lines changed
lib/puppet/parser/functions
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
46
46
flags << '--detach=true'
47
47
end
48
48
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 ' ] } "
51
51
end
52
52
53
53
if opts [ 'tty' ]
Original file line number Diff line number Diff line change 211
211
}
212
212
213
213
if $::osfamily == ' windows' {
214
- $exec_environment = ' PATH=C:/Program Files/Docker/'
214
+ $exec_environment = ' PATH=C:/Program Files/Docker/;C:/Windows/System32/ '
215
215
$exec_timeout = 3000
216
216
$exec_path = [' c:/Windows/Temp/' , ' C:/Program Files/Docker/' ]
217
217
$exec_provider = ' powershell'
218
218
$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} "
220
220
} else {
221
221
$exec_environment = ' HOME=/root'
222
222
$exec_path = [' /bin' , ' /usr/bin' ]
Original file line number Diff line number Diff line change @@ -754,16 +754,21 @@ class { 'docker': #{docker_ee_arg} }
754
754
it 'should restart a unhealthy container' do
755
755
pp5 = <<-EOS
756
756
docker::run { 'container_3_7_3':
757
- image => 'base ',
757
+ image => '#{ default_image } ',
758
758
command => '#{ default_run_command } ',
759
- health_check_cmd => 'pwd ',
759
+ health_check_cmd => 'echo ',
760
760
restart_on_unhealthy => true,
761
+ #{ default_docker_run_arg }
761
762
}
762
763
EOS
763
764
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
767
772
end
768
773
end
769
774
You can’t perform that action at this time.
0 commit comments