Skip to content

Commit 73fff74

Browse files
authored
Merge pull request #5227 from fluxcd/fix-debug-hr
Fix command debug hr not taking targetPath into account
2 parents 04d87be + 2405774 commit 73fff74

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

cmd/flux/debug_helmrelease.go

+1-13
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"fmt"
2222

2323
helmv2 "github.com/fluxcd/helm-controller/api/v2"
24-
"github.com/fluxcd/pkg/apis/meta"
2524
"github.com/fluxcd/pkg/chartutil"
2625
"github.com/go-logr/logr"
2726
"github.com/spf13/cobra"
@@ -93,23 +92,12 @@ func debugHelmReleaseCmdRun(cmd *cobra.Command, args []string) error {
9392
}
9493

9594
if debugHelmReleaseArgs.showValues {
96-
// TODO(stefan): remove the mapping when helm-controller/api v1.2.0 has been released
97-
var valuesRefs []meta.ValuesReference
98-
for _, source := range hr.Spec.ValuesFrom {
99-
valuesRefs = append(valuesRefs, meta.ValuesReference{
100-
Kind: source.Kind,
101-
Name: source.Name,
102-
ValuesKey: source.ValuesKey,
103-
Optional: source.Optional,
104-
})
105-
}
106-
10795
finalValues, err := chartutil.ChartValuesFromReferences(ctx,
10896
logr.Discard(),
10997
kubeClient,
11098
hr.GetNamespace(),
11199
hr.GetValues(),
112-
valuesRefs...)
100+
hr.Spec.ValuesFrom...)
113101
if err != nil {
114102
return err
115103
}

cmd/flux/testdata/debug_helmrelease/objects.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ spec:
3838
- kind: Secret
3939
name: test
4040
valuesKey: secrets.yaml
41+
- kind: Secret
42+
name: test
43+
valuesKey: flatValue
44+
targetPath: aFlatValue
4145
- kind: ConfigMap
4246
name: none
4347
optional: true
@@ -61,3 +65,4 @@ stringData:
6165
secrets.yaml: |
6266
secret: "test"
6367
override: "secret"
68+
flatValue: some-flat-value

cmd/flux/testdata/debug_helmrelease/values-from.golden.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
aFlatValue: some-flat-value
12
cm: test
23
image:
34
repository: stefanprodan/podinfo

0 commit comments

Comments
 (0)