Puppet Function: docker_exec_flags

Defined in:
lib/puppet/parser/functions/docker_exec_flags.rb
Function type:
Ruby 3.x API

Overview

docker_exec_flags()Any

Transforms a hash into a string of docker exec flags

Returns:

  • (Any)


5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/puppet/parser/functions/docker_exec_flags.rb', line 5

newfunction(:docker_exec_flags, :type => :rvalue) do |args|
  opts = args[0] || {}
  flags = []

  if opts['detach']
    flags << '--detach=true'
  end

  if opts['interactive']
    flags << '--interactive=true'
  end

  if opts['tty']
    flags << '--tty=true'
  end

  flags.flatten.join(" ")
end