Puppet Function: helm_repo_update_flags
- Defined in:
- lib/puppet/parser/functions/helm_repo_update_flags.rb
- Function type:
- Ruby 3.x API
Overview
Transforms a hash into a string of helm repo update flags
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/puppet/parser/functions/helm_repo_update_flags.rb', line 7 newfunction(:helm_repo_update_flags, :type => :rvalue) do |args| opts = args[0] || {} flags = [] flags << '--debug' if opts['debug'] flags << "--home '#{opts['home']}'" if opts['home'] && opts['home'].to_s != 'undef' flags << "--host '#{opts['host']}'" if opts['host'] && opts['host'].to_s != 'undef' flags << "--kube-context '#{opts['kube_context']}'" if opts['kube_context'] && opts['kube_context'].to_s != 'undef' flags << "--tiller-namespace '#{opts['tiller_namespace']}'" if opts['tiller_namespace'] && opts['tiller_namespace'].to_s != 'undef' flags << 'update' if opts['update'] flags.flatten.join(' ') end |