Skip to content

Make it possible to use pod's network #725

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions lib/puppet/parser/functions/docker_run_flags.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ module Puppet::Parser::Functions
flags << "--restart '#{opts['restart']}'"
end

if opts['net'].is_a? String
flags << "--net #{opts['net'].shellescape}"
elsif opts['net'].is_a? Array
flags << "--net #{opts['net'].join(' --net ').shellescape}"
if opts['net']
if opts['net'].is_a? String
flags << "--net #{opts['net'].shellescape}"
elsif opts['net'].is_a? Array
flags << "--net #{opts['net'].join(' --net ').shellescape}"
end
end

if opts['memory_limit']
Expand Down
2 changes: 1 addition & 1 deletion manifests/run.pp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
Optional[Boolean] $use_name = false,
Optional[Boolean] $running = true,
Optional[Variant[String,Array]] $volumes_from = [],
Variant[String,Array] $net = 'bridge',
Variant[String,Array,Undef] $net = undef,
Variant[String,Boolean] $username = false,
Variant[String,Boolean] $hostname = false,
Optional[Variant[String,Array]] $env = [],
Expand Down