1
1
<# PSScriptInfo
2
2
.VERSION 1.3.1
3
3
.GUID 04273f72-e001-415b-add0-e5e95e378355
4
- .AUTHOR Code Dx
4
+ .AUTHOR Black Duck
5
+ .COPYRIGHT Copyright 2024 Black Duck Software, Inc. All rights reserved.
5
6
.DESCRIPTION Includes Helm-related helpers
6
7
#>
7
8
@@ -150,6 +151,19 @@ function Get-HelmVersionMajorMinor() {
150
151
}
151
152
152
153
function Get-HelmChartFullname ([string ] $releaseName , [string ] $chartName ) {
154
+ Get-HelmChartFullnameEquals $releaseName $chartName
155
+ }
156
+
157
+ function Get-HelmChartFullnameContains ([string ] $releaseName , [string ] $chartName ) {
158
+
159
+ $fullname = $releaseName
160
+ if (-not ($releaseName.Contains ($chartName ))) {
161
+ $fullname = " $releaseName -$chartName "
162
+ }
163
+ Get-CommonName $fullname
164
+ }
165
+
166
+ function Get-HelmChartFullnameEquals ([string ] $releaseName , [string ] $chartName ) {
153
167
154
168
$fullname = $releaseName
155
169
if ($releaseName -cne $chartName ) {
@@ -158,6 +172,10 @@ function Get-HelmChartFullname([string] $releaseName, [string] $chartName) {
158
172
Get-CommonName $fullname
159
173
}
160
174
175
+ function Get-HelmChartFullnameConcat ([string ] $releaseName , [string ] $chartName ) {
176
+ Get-CommonName " $releaseName -$chartName "
177
+ }
178
+
161
179
function Get-CommonName ([string ] $name ) {
162
180
163
181
# note: matches chart "sanitize" helper
@@ -166,3 +184,12 @@ function Get-CommonName([string] $name) {
166
184
}
167
185
$name.TrimEnd (' -' )
168
186
}
187
+
188
+ function Get-AllHelmValues ([string ] $namespace , [string ] $releaseName ) {
189
+
190
+ $values = helm - n $namespace get values $releaseName - a - o json
191
+ if ($LASTEXITCODE -ne 0 ) {
192
+ throw " Unable to get release values, helm exited with code $LASTEXITCODE ."
193
+ }
194
+ ConvertFrom-Json $values
195
+ }
0 commit comments