Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix helm-extra-set-args in YAML configuration #713

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions ct/cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,7 @@ func install(cmd *cobra.Command, _ []string) error {
return fmt.Errorf("failed loading configuration: %w", err)
}

extraSetArgs, err := cmd.Flags().GetString("helm-extra-set-args")
if err != nil {
return err
}
testing, err := chart.NewTesting(*configuration, extraSetArgs)
testing, err := chart.NewTesting(*configuration)
if err != nil {
fmt.Println(err)
}
Expand Down
3 changes: 1 addition & 2 deletions ct/cmd/lint.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ func lint(cmd *cobra.Command, _ []string) error {
return fmt.Errorf("failed loading configuration: %w", err)
}

emptyExtraSetArgs := ""
testing, err := chart.NewTesting(*configuration, emptyExtraSetArgs)
testing, err := chart.NewTesting(*configuration)
if err != nil {
return err
}
Expand Down
6 changes: 1 addition & 5 deletions ct/cmd/lintAndInstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,7 @@ func lintAndInstall(cmd *cobra.Command, _ []string) error {
return fmt.Errorf("failed loading configuration: %w", err)
}

extraSetArgs, err := cmd.Flags().GetString("helm-extra-set-args")
if err != nil {
return err
}
testing, err := chart.NewTesting(*configuration, extraSetArgs)
testing, err := chart.NewTesting(*configuration)
if err != nil {
return err
}
Expand Down
3 changes: 1 addition & 2 deletions ct/cmd/listChanged.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ func listChanged(cmd *cobra.Command, _ []string) error {
return fmt.Errorf("failed loading configuration: %w", err)
}

emptyExtraSetArgs := ""
testing, err := chart.NewTesting(*configuration, emptyExtraSetArgs)
testing, err := chart.NewTesting(*configuration)
if err != nil {
return err
}
Expand Down
5 changes: 3 additions & 2 deletions pkg/chart/chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,14 +260,15 @@ type TestResult struct {
}

// NewTesting creates a new Testing struct with the given config.
func NewTesting(config config.Configuration, extraSetArgs string) (Testing, error) {
func NewTesting(config config.Configuration) (Testing, error) {
procExec := exec.NewProcessExecutor(config.Debug)
helmExtraArgs := strings.Fields(config.HelmExtraArgs)
helmExtraSetArgs := strings.Fields(config.HelmExtraSetArgs)
helmLintExtraArgs := strings.Fields(config.HelmLintExtraArgs)

testing := Testing{
config: config,
helm: tool.NewHelm(procExec, helmExtraArgs, helmLintExtraArgs, strings.Fields(extraSetArgs)),
helm: tool.NewHelm(procExec, helmExtraArgs, helmLintExtraArgs, helmExtraSetArgs),
git: tool.NewGit(procExec),
kubectl: tool.NewKubectl(procExec, config.KubectlTimeout),
linter: tool.NewLinter(procExec),
Expand Down