Merge pull request #13600 from gjenkins8/cleanup_NewShowWithConfig

cleanup: `NewShowWithConfig` -> `NewShow`
pull/13635/head
George Jenkins 8 months ago committed by GitHub
commit 53a4a59eb9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -57,7 +57,7 @@ of the CustomResourceDefinition files
` `
func newShowCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { func newShowCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
client := action.NewShowWithConfig(action.ShowAll, cfg) client := action.NewShow(action.ShowAll, cfg)
showCommand := &cobra.Command{ showCommand := &cobra.Command{
Use: "show", Use: "show",

@ -65,16 +65,7 @@ type Show struct {
} }
// NewShow creates a new Show object with the given configuration. // NewShow creates a new Show object with the given configuration.
// Deprecated: Use NewShowWithConfig func NewShow(output ShowOutputFormat, cfg *Configuration) *Show {
// TODO Helm 4: Fold NewShowWithConfig back into NewShow
func NewShow(output ShowOutputFormat) *Show {
return &Show{
OutputFormat: output,
}
}
// NewShowWithConfig creates a new Show object with the given configuration.
func NewShowWithConfig(output ShowOutputFormat, cfg *Configuration) *Show {
sh := &Show{ sh := &Show{
OutputFormat: output, OutputFormat: output,
} }

@ -24,7 +24,7 @@ import (
func TestShow(t *testing.T) { func TestShow(t *testing.T) {
config := actionConfigFixture(t) config := actionConfigFixture(t)
client := NewShowWithConfig(ShowAll, config) client := NewShow(ShowAll, config)
client.chart = &chart.Chart{ client.chart = &chart.Chart{
Metadata: &chart.Metadata{Name: "alpine"}, Metadata: &chart.Metadata{Name: "alpine"},
Files: []*chart.File{ Files: []*chart.File{
@ -65,7 +65,8 @@ bar
} }
func TestShowNoValues(t *testing.T) { func TestShowNoValues(t *testing.T) {
client := NewShow(ShowAll) config := actionConfigFixture(t)
client := NewShow(ShowAll, config)
client.chart = new(chart.Chart) client.chart = new(chart.Chart)
// Regression tests for missing values. See issue #1024. // Regression tests for missing values. See issue #1024.
@ -81,7 +82,8 @@ func TestShowNoValues(t *testing.T) {
} }
func TestShowValuesByJsonPathFormat(t *testing.T) { func TestShowValuesByJsonPathFormat(t *testing.T) {
client := NewShow(ShowValues) config := actionConfigFixture(t)
client := NewShow(ShowValues, config)
client.JSONPathTemplate = "{$.nestedKey.simpleKey}" client.JSONPathTemplate = "{$.nestedKey.simpleKey}"
client.chart = buildChart(withSampleValues()) client.chart = buildChart(withSampleValues())
output, err := client.Run("") output, err := client.Run("")
@ -95,7 +97,8 @@ func TestShowValuesByJsonPathFormat(t *testing.T) {
} }
func TestShowCRDs(t *testing.T) { func TestShowCRDs(t *testing.T) {
client := NewShow(ShowCRDs) config := actionConfigFixture(t)
client := NewShow(ShowCRDs, config)
client.chart = &chart.Chart{ client.chart = &chart.Chart{
Metadata: &chart.Metadata{Name: "alpine"}, Metadata: &chart.Metadata{Name: "alpine"},
Files: []*chart.File{ Files: []*chart.File{
@ -123,7 +126,8 @@ bar
} }
func TestShowNoReadme(t *testing.T) { func TestShowNoReadme(t *testing.T) {
client := NewShow(ShowAll) config := actionConfigFixture(t)
client := NewShow(ShowAll, config)
client.chart = &chart.Chart{ client.chart = &chart.Chart{
Metadata: &chart.Metadata{Name: "alpine"}, Metadata: &chart.Metadata{Name: "alpine"},
Files: []*chart.File{ Files: []*chart.File{

Loading…
Cancel
Save