Skip to content

Commit

Permalink
backport of commit 370b062
Browse files Browse the repository at this point in the history
  • Loading branch information
hanshasselberg committed May 4, 2023
1 parent 01e4667 commit 3008ac4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
5 changes: 2 additions & 3 deletions cli/cmd/config/read/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,9 @@ func (c *ReadCommand) checkHelmInstallation(settings *helmCLI.EnvSettings, uiLog

valuesYaml, err := yaml.Marshal(rel.Config)
if err != nil {
c.UI.Output("%+v", err, terminal.WithErrorStyle())
} else {
c.UI.Output(string(valuesYaml))
return err
}
c.UI.Output(string(valuesYaml))

return nil
}
Expand Down
13 changes: 12 additions & 1 deletion cli/cmd/config/read/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package read
import (
"bytes"
"context"
"errors"
"flag"
"fmt"
"io"
Expand Down Expand Up @@ -45,8 +46,18 @@ func TestConfigRead(t *testing.T) {
},
expectedReturnCode: 0,
},
"error": {
messages: []string{"error", "\n"},

helmActionsRunner: &helm.MockActionRunner{
GetStatusFunc: func(status *action.Status, name string) (*helmRelease.Release, error) {
return nil, errors.New("error")
},
},
expectedReturnCode: 1,
},
"some config": {
messages: []string{"\n"},
messages: []string{"global: \"true\"", "\n"},

helmActionsRunner: &helm.MockActionRunner{
GetStatusFunc: func(status *action.Status, name string) (*helmRelease.Release, error) {
Expand Down

0 comments on commit 3008ac4

Please sign in to comment.