Skip to content

Commit

Permalink
Run helm dependency before helm lint (#4777)
Browse files Browse the repository at this point in the history
* Update helmExecute.go

* Update helmExecute_test.go

* Try fix format issue
  • Loading branch information
adriil authored Jan 18, 2024
1 parent 6920cad commit 61564ea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions cmd/helmExecute.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,16 @@ func runHelmExecute(config helmExecuteOptions, helmExecutor kubernetes.HelmExecu
}

func runHelmExecuteDefault(config helmExecuteOptions, helmExecutor kubernetes.HelmExecutor, commonPipelineEnvironment *helmExecuteCommonPipelineEnvironment) error {
if err := helmExecutor.RunHelmLint(); err != nil {
return fmt.Errorf("failed to execute helm lint: %v", err)
}

if len(config.Dependency) > 0 {
if err := helmExecutor.RunHelmDependency(); err != nil {
return fmt.Errorf("failed to execute helm dependency: %v", err)
}
}

if err := helmExecutor.RunHelmLint(); err != nil {
return fmt.Errorf("failed to execute helm lint: %v", err)
}

if config.Publish {
targetURL, err := helmExecutor.RunHelmPublish()
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/helmExecute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,8 @@ func TestRunHelmDefaultCommand(t *testing.T) {
for i, testCase := range testTable {
t.Run(fmt.Sprint("case ", i), func(t *testing.T) {
helmExecute := &mocks.HelmExecutor{}
helmExecute.On("RunHelmLint").Return(testCase.methodLintError)
helmExecute.On("RunHelmDependency").Return(testCase.methodPackageError)
helmExecute.On("RunHelmLint").Return(testCase.methodLintError)
helmExecute.On("RunHelmPublish").Return(testCase.methodPublishError)

err := runHelmExecute(testCase.config, helmExecute, &testCase.fileUtils, &cpe)
Expand Down

0 comments on commit 61564ea

Please sign in to comment.