Skip to content

Commit 275dfb0

Browse files
florindragosdavejrt
authored andcommitted
Receive osfamily as parameter in docker_run_flags (#317)
1 parent 12e6a17 commit 275dfb0

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/puppet/parser/functions/docker_run_flags.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,12 @@ module Puppet::Parser::Functions
6161
if opts['read_only']
6262
flags << '--read-only=true'
6363
end
64-
params_join_char = Facter.value(:osfamily).casecmp('windows').zero? ? ' ' : " \\\n"
64+
65+
params_join_char = if opts['osfamily'].to_s != 'undef'
66+
opts['osfamily'].casecmp('windows').zero? ? " `\n" : " \\\n"
67+
else
68+
" \\\n"
69+
end
6570

6671
multi_flags = lambda { |values, format|
6772
filtered = [values].flatten.compact

manifests/run.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@
199199
health_check_cmd => $health_check_cmd,
200200
restart_on_unhealthy => $restart_on_unhealthy,
201201
health_check_interval => $health_check_interval,
202+
osfamily => $::osfamily,
202203
})
203204

204205
$sanitised_title = regsubst($title, '[^0-9A-Za-z.\-_]', '-', 'G')

0 commit comments

Comments
 (0)