Skip to content

Commit c57e911

Browse files
committed
Fix helm-extra-set-args in YAML configuration
Currently, `helm-extra-set-args` is only available as a command-line flag, despite being part of the config object. This does not appear to be documented. This changes sources the value `extraSetArgs` via the `config` object rather than the cmd.Flags() only. Signed-off-by: Dylan Arbour <[email protected]>
1 parent e3ee8b5 commit c57e911

File tree

5 files changed

+7
-16
lines changed

5 files changed

+7
-16
lines changed

ct/cmd/install.go

+1-5
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,7 @@ func install(cmd *cobra.Command, _ []string) error {
9393
return fmt.Errorf("failed loading configuration: %w", err)
9494
}
9595

96-
extraSetArgs, err := cmd.Flags().GetString("helm-extra-set-args")
97-
if err != nil {
98-
return err
99-
}
100-
testing, err := chart.NewTesting(*configuration, extraSetArgs)
96+
testing, err := chart.NewTesting(*configuration)
10197
if err != nil {
10298
fmt.Println(err)
10399
}

ct/cmd/lint.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ func lint(cmd *cobra.Command, _ []string) error {
9090
return fmt.Errorf("failed loading configuration: %w", err)
9191
}
9292

93-
emptyExtraSetArgs := ""
94-
testing, err := chart.NewTesting(*configuration, emptyExtraSetArgs)
93+
testing, err := chart.NewTesting(*configuration)
9594
if err != nil {
9695
return err
9796
}

ct/cmd/lintAndInstall.go

+1-5
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,7 @@ func lintAndInstall(cmd *cobra.Command, _ []string) error {
5151
return fmt.Errorf("failed loading configuration: %w", err)
5252
}
5353

54-
extraSetArgs, err := cmd.Flags().GetString("helm-extra-set-args")
55-
if err != nil {
56-
return err
57-
}
58-
testing, err := chart.NewTesting(*configuration, extraSetArgs)
54+
testing, err := chart.NewTesting(*configuration)
5955
if err != nil {
6056
return err
6157
}

ct/cmd/listChanged.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ func listChanged(cmd *cobra.Command, _ []string) error {
5050
return fmt.Errorf("failed loading configuration: %w", err)
5151
}
5252

53-
emptyExtraSetArgs := ""
54-
testing, err := chart.NewTesting(*configuration, emptyExtraSetArgs)
53+
testing, err := chart.NewTesting(*configuration)
5554
if err != nil {
5655
return err
5756
}

pkg/chart/chart.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -260,14 +260,15 @@ type TestResult struct {
260260
}
261261

262262
// NewTesting creates a new Testing struct with the given config.
263-
func NewTesting(config config.Configuration, extraSetArgs string) (Testing, error) {
263+
func NewTesting(config config.Configuration) (Testing, error) {
264264
procExec := exec.NewProcessExecutor(config.Debug)
265265
helmExtraArgs := strings.Fields(config.HelmExtraArgs)
266+
helmExtraSetArgs := strings.Fields(config.HelmExtraSetArgs)
266267
helmLintExtraArgs := strings.Fields(config.HelmLintExtraArgs)
267268

268269
testing := Testing{
269270
config: config,
270-
helm: tool.NewHelm(procExec, helmExtraArgs, helmLintExtraArgs, strings.Fields(extraSetArgs)),
271+
helm: tool.NewHelm(procExec, helmExtraArgs, helmLintExtraArgs, helmExtraSetArgs),
271272
git: tool.NewGit(procExec),
272273
kubectl: tool.NewKubectl(procExec, config.KubectlTimeout),
273274
linter: tool.NewLinter(procExec),

0 commit comments

Comments
 (0)