Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9124136
docker_plugin_install_flags.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
897 B
Subscribers
None
docker_plugin_install_flags.rb
View Options
# frozen_string_literal: true
require
'shellwords'
#
# docker_plugin_install_flags.rb
#
module
Puppet::Parser::Functions
# Transforms a hash into a string of docker plugin install flags
newfunction
(
:docker_plugin_install_flags
,
type
:
:rvalue
)
do
|
args
|
opts
=
args
[
0
]
||
{}
flags
=
[]
flags
<<
"--alias
#{
opts
[
'plugin_alias'
]
}
"
if
opts
[
'plugin_alias'
]
&&
opts
[
'plugin_alias'
].
to_s
!=
'undef'
flags
<<
'--disable'
if
opts
[
'disable_on_install'
]
==
true
flags
<<
'--disable-content-trust'
if
opts
[
'disable_content_trust'
]
==
true
flags
<<
'--grant-all-permissions'
if
opts
[
'grant_all_permissions'
]
==
true
flags
<<
"'
#{
opts
[
'plugin_name'
]
}
'"
if
opts
[
'plugin_name'
]
&&
opts
[
'plugin_name'
].
to_s
!=
'undef'
if
opts
[
'settings'
].
is_a?
Array
opts
[
'settings'
].
each
do
|
setting
|
flags
<<
setting
.
to_s
end
end
flags
.
flatten
.
join
(
' '
)
end
end
File Metadata
Details
Attached
Mime Type
text/x-ruby
Expires
Sat, Jun 21, 6:43 PM (2 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3413514
Attached To
R205 puppet-puppetlabs-docker
Event Timeline
Log In to Comment