Skip to content

Commit

Permalink
add flags to repo list command
Browse files Browse the repository at this point in the history
  • Loading branch information
JP-Odido committed Dec 12, 2023
1 parent cf885fd commit ed87c28
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion lib/puppet/parser/functions/helm_repo_add_flags.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module Puppet::Parser::Functions
newfunction(:helm_repo_add_flags, :type => :rvalue) do |args|
opts = args[0] || {}
flags = []
flags << 'add' if opts['ensure'].to_s == 'present'
flags << "'#{opts['repo_name']}'" if opts['repo_name'] && opts['repo_name'].to_s != 'undef'
flags << "'#{opts['url']}'" if opts['url'] && opts['url'].to_s != 'undef'
flags << "--ca-file '#{opts['ca_file']}'" if opts['ca_file'] && opts['ca_file'].to_s != 'undef'
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/parser/functions/helm_repo_remove_flags.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module Puppet::Parser::Functions
newfunction(:helm_repo_remove_flags, :type => :rvalue) do |args|
opts = args[0] || {}
flags = []
flags << 'remove' if opts['ensure'].to_s == 'absent'
flags << "'#{opts['repo_name']}'" if opts['repo_name'] && opts['repo_name'].to_s != 'undef'
flags << "--home '#{opts['home']}'" if opts['home'] && opts['home'].to_s != 'undef'
flags << "--host '#{opts['host']}'" if opts['host'] && opts['host'].to_s != 'undef'
Expand Down
8 changes: 4 additions & 4 deletions manifests/repo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@
url => $url,
}
)
$exec_repo = "helm repo ${helm_repo_add_flags}"
$unless_repo = "helm repo list | awk '{if(NR>1)print \$1}' | grep -w ${repo_name}"
$exec_repo = "helm repo add ${helm_repo_add_flags}"
$unless_repo = "helm repo list ${helm_repo_add_flags} | awk '{if(NR>1)print \$1}' | grep -w ${repo_name}"
}

if $ensure == absent {
Expand All @@ -127,8 +127,8 @@
tiller_namespace => $tiller_namespace,
}
)
$exec_repo = "helm repo ${helm_repo_remove_flags}"
$unless_repo = "helm repo list | awk '{if (\$1 == \"${repo_name}\") exit 1}'"
$exec_repo = "helm repo remove ${helm_repo_remove_flags}"
$unless_repo = "helm repo list ${helm_repo_remove_flags} | awk '{if (\$1 == \"${repo_name}\") exit 1}'"
}

exec { "helm repo ${repo_name}":
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppetlabs-helm",
"version": "4.1.12",
"version": "4.1.13",
"author": "puppetlabs",
"summary": "A module to install Helm, a kubernetes package manager",
"license": "Apache-2.0",
Expand Down

0 comments on commit ed87c28

Please sign in to comment.