From 8b0ad72e77d718ba4758b870f16349e499a8ff72 Mon Sep 17 00:00:00 2001 From: Viktor Oreshkin Date: Thu, 1 Sep 2022 02:14:40 +0300 Subject: [PATCH 1/7] feat: dont prepare on list This changes list command so it doesn't run withPreparedCharts, and just lists releases instead Signed-off-by: Viktor Oreshkin --- pkg/app/app.go | 79 ++++++++++++++++++++++---------------------------- 1 file changed, 34 insertions(+), 45 deletions(-) diff --git a/pkg/app/app.go b/pkg/app/app.go index d3067c4a..04f028cd 100644 --- a/pkg/app/app.go +++ b/pkg/app/app.go @@ -547,53 +547,42 @@ func (a *App) ListReleases(c ListConfigProvider) error { var releases []*HelmRelease err := a.ForEachState(func(run *Run) (_ bool, errs []error) { - err := run.withPreparedCharts("list", state.ChartPrepareOptions{ - SkipRepos: true, - SkipDeps: true, - Concurrency: 2, - }, func() { - // var releases m - for _, r := range run.state.Releases { - labels := "" - if r.Labels == nil { - r.Labels = map[string]string{} - } - for k, v := range run.state.CommonLabels { - r.Labels[k] = v - } - - var keys []string - for k := range r.Labels { - keys = append(keys, k) - } - sort.Strings(keys) - - for _, k := range keys { - v := r.Labels[k] - labels = fmt.Sprintf("%s,%s:%s", labels, k, v) - } - labels = strings.Trim(labels, ",") - - enabled, err := state.ConditionEnabled(r, run.state.Values()) - if err != nil { - panic(err) - } - - installed := r.Installed == nil || *r.Installed - releases = append(releases, &HelmRelease{ - Name: r.Name, - Namespace: r.Namespace, - Installed: installed, - Enabled: enabled, - Labels: labels, - Chart: r.Chart, - Version: r.Version, - }) + for _, r := range run.state.Releases { + labels := "" + if r.Labels == nil { + r.Labels = map[string]string{} + } + for k, v := range run.state.CommonLabels { + r.Labels[k] = v } - }) - if err != nil { - errs = append(errs, err) + var keys []string + for k := range r.Labels { + keys = append(keys, k) + } + sort.Strings(keys) + + for _, k := range keys { + v := r.Labels[k] + labels = fmt.Sprintf("%s,%s:%s", labels, k, v) + } + labels = strings.Trim(labels, ",") + + enabled, err := state.ConditionEnabled(r, run.state.Values()) + if err != nil { + panic(err) + } + + installed := r.Installed == nil || *r.Installed + releases = append(releases, &HelmRelease{ + Name: r.Name, + Namespace: r.Namespace, + Installed: installed, + Enabled: enabled, + Labels: labels, + Chart: r.Chart, + Version: r.Version, + }) } return From f3788249e485223a9652afbee8c633299df7a981 Mon Sep 17 00:00:00 2001 From: Viktor Oreshkin Date: Mon, 5 Sep 2022 14:04:05 +0300 Subject: [PATCH 2/7] feat: add flag to list to skip prepare Signed-off-by: Viktor Oreshkin --- cmd/list.go | 1 + pkg/app/app.go | 98 ++++++++++++++++++++++++++-------------- pkg/app/app_list_test.go | 25 ++++++---- pkg/app/app_test.go | 5 ++ pkg/app/config.go | 1 + pkg/config/list.go | 7 +++ 6 files changed, 95 insertions(+), 42 deletions(-) diff --git a/cmd/list.go b/cmd/list.go index e16a8695..201da3e5 100644 --- a/cmd/list.go +++ b/cmd/list.go @@ -32,6 +32,7 @@ func NewListCmd(globalCfg *config.GlobalImpl) *cobra.Command { f := cmd.Flags() f.BoolVar(&listOptions.KeepTempDir, "keep-temp-dir", false, "Keep temporary directory") + f.BoolVar(&listOptions.WithPreparedCharts, "with-prepared-charts", true, "prepare charts when listing releases") f.StringVar(&listOptions.Output, "output", "", "output releases list as a json string") return cmd diff --git a/pkg/app/app.go b/pkg/app/app.go index 04f028cd..7070c2f9 100644 --- a/pkg/app/app.go +++ b/pkg/app/app.go @@ -547,44 +547,30 @@ func (a *App) ListReleases(c ListConfigProvider) error { var releases []*HelmRelease err := a.ForEachState(func(run *Run) (_ bool, errs []error) { - for _, r := range run.state.Releases { - labels := "" - if r.Labels == nil { - r.Labels = map[string]string{} - } - for k, v := range run.state.CommonLabels { - r.Labels[k] = v - } + var stateReleases []*HelmRelease + var err error - var keys []string - for k := range r.Labels { - keys = append(keys, k) - } - sort.Strings(keys) - - for _, k := range keys { - v := r.Labels[k] - labels = fmt.Sprintf("%s,%s:%s", labels, k, v) - } - labels = strings.Trim(labels, ",") - - enabled, err := state.ConditionEnabled(r, run.state.Values()) - if err != nil { - panic(err) - } - - installed := r.Installed == nil || *r.Installed - releases = append(releases, &HelmRelease{ - Name: r.Name, - Namespace: r.Namespace, - Installed: installed, - Enabled: enabled, - Labels: labels, - Chart: r.Chart, - Version: r.Version, + if c.WithPreparedCharts() { + err = run.withPreparedCharts("list", state.ChartPrepareOptions{ + SkipRepos: true, + SkipDeps: true, + }, func() { + rel, err := a.list(run) + if err != nil { + panic(err) + } + stateReleases = rel }) + } else { + stateReleases, err = a.list(run) } + if err != nil { + errs = append(errs, err) + } + + releases = append(releases, stateReleases...) + return }, false, SetFilter(true)) @@ -601,6 +587,50 @@ func (a *App) ListReleases(c ListConfigProvider) error { return err } +func (a *App) list(run *Run) ([]*HelmRelease, error) { + var releases []*HelmRelease + + for _, r := range run.state.Releases { + labels := "" + if r.Labels == nil { + r.Labels = map[string]string{} + } + for k, v := range run.state.CommonLabels { + r.Labels[k] = v + } + + var keys []string + for k := range r.Labels { + keys = append(keys, k) + } + sort.Strings(keys) + + for _, k := range keys { + v := r.Labels[k] + labels = fmt.Sprintf("%s,%s:%s", labels, k, v) + } + labels = strings.Trim(labels, ",") + + enabled, err := state.ConditionEnabled(r, run.state.Values()) + if err != nil { + return nil, err + } + + installed := r.Installed == nil || *r.Installed + releases = append(releases, &HelmRelease{ + Name: r.Name, + Namespace: r.Namespace, + Installed: installed, + Enabled: enabled, + Labels: labels, + Chart: r.Chart, + Version: r.Version, + }) + } + + return releases, nil +} + func (a *App) within(dir string, do func() error) error { if dir == "." { return do() diff --git a/pkg/app/app_list_test.go b/pkg/app/app_list_test.go index 0ec63bba..4ed6c603 100644 --- a/pkg/app/app_list_test.go +++ b/pkg/app/app_list_test.go @@ -17,7 +17,7 @@ import ( "github.com/helmfile/helmfile/pkg/testutil" ) -func TestListWithEnvironment(t *testing.T) { +func testListWithConfig(t *testing.T, cfg configImpl) { type testcase struct { environment string ns string @@ -26,7 +26,7 @@ func TestListWithEnvironment(t *testing.T) { expected string } - check := func(t *testing.T, tc testcase) { + check := func(t *testing.T, tc testcase, cfg configImpl) { t.Helper() bs := &bytes.Buffer{} @@ -164,7 +164,7 @@ releases: var listErr error out := testutil.CaptureStdout(func() { - listErr = app.ListReleases(configImpl{}) + listErr = app.ListReleases(cfg) }) var gotErr string @@ -197,14 +197,14 @@ cache my-app true true app:test bitnami/redis database my-app true true bitnami/postgres 11.6.22 global kube-system true true incubator/raw `, - }) + }, cfg) }) t.Run("fail on unknown environment", func(t *testing.T) { check(t, testcase{ environment: "staging", error: `err: no releases found that matches specified selector() and environment(staging), in any helmfile`, - }) + }, cfg) }) t.Run("list releases matching selector and environment", func(t *testing.T) { @@ -215,7 +215,7 @@ global kube-system true true incubator/raw external-secrets default true true app:test,chart:raw,name:external-secrets,namespace:default incubator/raw my-release default true true app:test,chart:raw,name:my-release,namespace:default incubator/raw `, - }) + }, cfg) }) t.Run("filters releases for environment used in one file only", func(t *testing.T) { @@ -225,7 +225,7 @@ my-release default true true app:test,chart:raw,name:my-release, cache my-app true true app:test bitnami/redis 17.0.7 database my-app true true bitnami/postgres 11.6.22 `, - }) + }, cfg) }) t.Run("filters releases for environment used in multiple files", func(t *testing.T) { @@ -243,6 +243,15 @@ test3 true true incubator/raw cache my-app true true app:test bitnami/redis 17.0.7 database my-app true true bitnami/postgres 11.6.22 `, - }) + }, cfg) + }) +} + +func TestListWithEnvironment(t *testing.T) { + t.Run("with prepared charts", func(t *testing.T) { + testListWithConfig(t, configImpl{withPreparedCharts: true}) + }) + t.Run("without prepared charts", func(t *testing.T) { + testListWithConfig(t, configImpl{withPreparedCharts: false}) }) } diff --git a/pkg/app/app_test.go b/pkg/app/app_test.go index 3bd91916..d2ed95ec 100644 --- a/pkg/app/app_test.go +++ b/pkg/app/app_test.go @@ -2220,6 +2220,7 @@ type configImpl struct { skipNeeds bool includeNeeds bool includeTransitiveNeeds bool + withPreparedCharts bool } func (c configImpl) Selectors() []string { @@ -2294,6 +2295,10 @@ func (c configImpl) Output() string { return c.output } +func (c configImpl) WithPreparedCharts() bool { + return c.withPreparedCharts +} + type applyConfig struct { args string values []string diff --git a/pkg/app/config.go b/pkg/app/config.go index 30e2053e..1e268508 100644 --- a/pkg/app/config.go +++ b/pkg/app/config.go @@ -236,6 +236,7 @@ type interactive interface { type ListConfigProvider interface { Output() string + WithPreparedCharts() bool } type CacheConfigProvider interface{} diff --git a/pkg/config/list.go b/pkg/config/list.go index 1529a742..64645847 100644 --- a/pkg/config/list.go +++ b/pkg/config/list.go @@ -6,6 +6,8 @@ type ListOptions struct { Output string // KeepTempDir is the keep temp dir flag KeepTempDir bool + // WithPreparedCharts makes list call `withPreparedCharts` when listing + WithPreparedCharts bool } // NewListOptions creates a new Apply @@ -36,3 +38,8 @@ func (c *ListImpl) Args() string { func (c *ListImpl) Output() string { return c.ListOptions.Output } + +// WithPreparedCharts returns withPreparedCharts flag +func (c *ListImpl) WithPreparedCharts() bool { + return c.ListOptions.WithPreparedCharts +} From cb780be6bdb6e346b9aeeea80441ee7568de084d Mon Sep 17 00:00:00 2001 From: Viktor Oreshkin Date: Mon, 5 Sep 2022 18:09:47 +0300 Subject: [PATCH 3/7] fix: rename with-prepared-charts to skip-charts Signed-off-by: Viktor Oreshkin --- cmd/list.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/list.go b/cmd/list.go index 201da3e5..a1fbbb4d 100644 --- a/cmd/list.go +++ b/cmd/list.go @@ -9,6 +9,7 @@ import ( // NewListCmd returns list subcmd func NewListCmd(globalCfg *config.GlobalImpl) *cobra.Command { + var skipCharts bool listOptions := config.NewListOptions() listImpl := config.NewListImpl(globalCfg, listOptions) @@ -16,6 +17,8 @@ func NewListCmd(globalCfg *config.GlobalImpl) *cobra.Command { Use: "list", Short: "List releases defined in state file", RunE: func(cmd *cobra.Command, args []string) error { + listOptions.WithPreparedCharts = !skipCharts + err := config.NewCLIConfigImpl(listImpl.GlobalImpl) if err != nil { return err @@ -32,7 +35,7 @@ func NewListCmd(globalCfg *config.GlobalImpl) *cobra.Command { f := cmd.Flags() f.BoolVar(&listOptions.KeepTempDir, "keep-temp-dir", false, "Keep temporary directory") - f.BoolVar(&listOptions.WithPreparedCharts, "with-prepared-charts", true, "prepare charts when listing releases") + f.BoolVar(&skipCharts, "skip-charts", false, "don't prepare charts when listing releases") f.StringVar(&listOptions.Output, "output", "", "output releases list as a json string") return cmd From ebf0f370a18debc9e942b902ba8ac8aaacc16051 Mon Sep 17 00:00:00 2001 From: Viktor Oreshkin Date: Tue, 6 Sep 2022 09:43:46 +0300 Subject: [PATCH 4/7] fix: add missing concurrency option to List Signed-off-by: Viktor Oreshkin --- pkg/app/app.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/app/app.go b/pkg/app/app.go index 7070c2f9..4bdf4a39 100644 --- a/pkg/app/app.go +++ b/pkg/app/app.go @@ -552,8 +552,9 @@ func (a *App) ListReleases(c ListConfigProvider) error { if c.WithPreparedCharts() { err = run.withPreparedCharts("list", state.ChartPrepareOptions{ - SkipRepos: true, - SkipDeps: true, + SkipRepos: true, + SkipDeps: true, + Concurrency: 2, }, func() { rel, err := a.list(run) if err != nil { From 1838ec0a11e4e38feb6ccb2e59eaceafdd90a24f Mon Sep 17 00:00:00 2001 From: Viktor Oreshkin Date: Tue, 6 Sep 2022 09:46:05 +0300 Subject: [PATCH 5/7] fix: make func names in app_list_test consistent Signed-off-by: Viktor Oreshkin --- pkg/app/app_list_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/app/app_list_test.go b/pkg/app/app_list_test.go index 4ed6c603..bfb08b04 100644 --- a/pkg/app/app_list_test.go +++ b/pkg/app/app_list_test.go @@ -17,7 +17,7 @@ import ( "github.com/helmfile/helmfile/pkg/testutil" ) -func testListWithConfig(t *testing.T, cfg configImpl) { +func testListWithEnvironment(t *testing.T, cfg configImpl) { type testcase struct { environment string ns string @@ -249,9 +249,9 @@ database my-app true true bitnami/postg func TestListWithEnvironment(t *testing.T) { t.Run("with prepared charts", func(t *testing.T) { - testListWithConfig(t, configImpl{withPreparedCharts: true}) + testListWithEnvironment(t, configImpl{withPreparedCharts: true}) }) t.Run("without prepared charts", func(t *testing.T) { - testListWithConfig(t, configImpl{withPreparedCharts: false}) + testListWithEnvironment(t, configImpl{withPreparedCharts: false}) }) } From 4dd73d4efb6963fa528e13c0f74ae545fd616afc Mon Sep 17 00:00:00 2001 From: Viktor Oreshkin Date: Tue, 6 Sep 2022 09:47:58 +0300 Subject: [PATCH 6/7] test: move TestListWithJSONOutput to app_list_test Signed-off-by: Viktor Oreshkin --- pkg/app/app_list_test.go | 68 ++++++++++++++++++++++++++++++++++++++++ pkg/app/app_test.go | 58 ---------------------------------- 2 files changed, 68 insertions(+), 58 deletions(-) diff --git a/pkg/app/app_list_test.go b/pkg/app/app_list_test.go index bfb08b04..05b6b543 100644 --- a/pkg/app/app_list_test.go +++ b/pkg/app/app_list_test.go @@ -4,6 +4,7 @@ import ( "bufio" "bytes" "io" + "os" "sync" "testing" @@ -255,3 +256,70 @@ func TestListWithEnvironment(t *testing.T) { testListWithEnvironment(t, configImpl{withPreparedCharts: false}) }) } + +func testListWithJSONOutput(t *testing.T, cfg configImpl) { + cfg.output = "json" + + files := map[string]string{ + "/path/to/helmfile.d/first.yaml": ` +environments: + default: + values: + - myrelease2: + enabled: false +releases: +- name: myrelease1 + chart: mychart1 + installed: no + labels: + id: myrelease1 +- name: myrelease2 + chart: mychart1 + condition: myrelease2.enabled +`, + "/path/to/helmfile.d/second.yaml": ` +releases: +- name: myrelease3 + chart: mychart1 + installed: yes +- name: myrelease4 + chart: mychart1 + labels: + id: myrelease1 +`, + } + stdout := os.Stdout + defer func() { os.Stdout = stdout }() + + var buffer bytes.Buffer + logger := helmexec.NewLogger(&buffer, "debug") + + app := appWithFs(&App{ + OverrideHelmBinary: DefaultHelmBinary, + fs: ffs.DefaultFileSystem(), + OverrideKubeContext: "default", + Env: "default", + Logger: logger, + Namespace: "testNamespace", + }, files) + + expectNoCallsToHelm(app) + + out := testutil.CaptureStdout(func() { + err := app.ListReleases(cfg) + assert.Nil(t, err) + }) + + expected := `[{"name":"myrelease1","namespace":"","enabled":true,"installed":false,"labels":"id:myrelease1","chart":"mychart1","version":""},{"name":"myrelease2","namespace":"","enabled":false,"installed":true,"labels":"","chart":"mychart1","version":""},{"name":"myrelease3","namespace":"","enabled":true,"installed":true,"labels":"","chart":"mychart1","version":""},{"name":"myrelease4","namespace":"","enabled":true,"installed":true,"labels":"id:myrelease1","chart":"mychart1","version":""}] +` + assert.Equal(t, expected, out) +} + +func TestListWithJSONOutput(t *testing.T) { + t.Run("with prepared charts", func(t *testing.T) { + testListWithJSONOutput(t, configImpl{withPreparedCharts: true}) + }) + t.Run("without prepared charts", func(t *testing.T) { + testListWithJSONOutput(t, configImpl{withPreparedCharts: false}) + }) +} diff --git a/pkg/app/app_test.go b/pkg/app/app_test.go index d2ed95ec..15bfe67a 100644 --- a/pkg/app/app_test.go +++ b/pkg/app/app_test.go @@ -4627,64 +4627,6 @@ myrelease4 true true id:myrelease1 mychart1 assert.Equal(t, expected, out) } -func TestListWithJsonOutput(t *testing.T) { - files := map[string]string{ - "/path/to/helmfile.d/first.yaml": ` -environments: - default: - values: - - myrelease2: - enabled: false -releases: -- name: myrelease1 - chart: mychart1 - installed: no - labels: - id: myrelease1 -- name: myrelease2 - chart: mychart1 - condition: myrelease2.enabled -`, - "/path/to/helmfile.d/second.yaml": ` -releases: -- name: myrelease3 - chart: mychart1 - installed: yes -- name: myrelease4 - chart: mychart1 - labels: - id: myrelease1 -`, - } - stdout := os.Stdout - defer func() { os.Stdout = stdout }() - - var buffer bytes.Buffer - logger := helmexec.NewLogger(&buffer, "debug") - - app := appWithFs(&App{ - OverrideHelmBinary: DefaultHelmBinary, - fs: ffs.DefaultFileSystem(), - OverrideKubeContext: "default", - Env: "default", - Logger: logger, - Namespace: "testNamespace", - }, files) - - expectNoCallsToHelm(app) - - out := testutil.CaptureStdout(func() { - err := app.ListReleases(configImpl{ - output: "json", - }) - assert.Nil(t, err) - }) - - expected := `[{"name":"myrelease1","namespace":"","enabled":true,"installed":false,"labels":"id:myrelease1","chart":"mychart1","version":""},{"name":"myrelease2","namespace":"","enabled":false,"installed":true,"labels":"","chart":"mychart1","version":""},{"name":"myrelease3","namespace":"","enabled":true,"installed":true,"labels":"","chart":"mychart1","version":""},{"name":"myrelease4","namespace":"","enabled":true,"installed":true,"labels":"id:myrelease1","chart":"mychart1","version":""}] -` - assert.Equal(t, expected, out) -} - func TestSetValuesTemplate(t *testing.T) { files := map[string]string{ "/path/to/helmfile.yaml": ` From af52c960f4da9ff401d3e9739d4051f91ddc588a Mon Sep 17 00:00:00 2001 From: Viktor Oreshkin Date: Tue, 6 Sep 2022 09:54:51 +0300 Subject: [PATCH 7/7] chore: list: withPreparedCharts -> skipCharts Signed-off-by: Viktor Oreshkin --- cmd/list.go | 5 +---- pkg/app/app.go | 2 +- pkg/app/app_list_test.go | 16 ++++++++-------- pkg/app/app_test.go | 6 +++--- pkg/app/config.go | 2 +- pkg/config/list.go | 10 +++++----- 6 files changed, 19 insertions(+), 22 deletions(-) diff --git a/cmd/list.go b/cmd/list.go index a1fbbb4d..26488d41 100644 --- a/cmd/list.go +++ b/cmd/list.go @@ -9,7 +9,6 @@ import ( // NewListCmd returns list subcmd func NewListCmd(globalCfg *config.GlobalImpl) *cobra.Command { - var skipCharts bool listOptions := config.NewListOptions() listImpl := config.NewListImpl(globalCfg, listOptions) @@ -17,8 +16,6 @@ func NewListCmd(globalCfg *config.GlobalImpl) *cobra.Command { Use: "list", Short: "List releases defined in state file", RunE: func(cmd *cobra.Command, args []string) error { - listOptions.WithPreparedCharts = !skipCharts - err := config.NewCLIConfigImpl(listImpl.GlobalImpl) if err != nil { return err @@ -35,7 +32,7 @@ func NewListCmd(globalCfg *config.GlobalImpl) *cobra.Command { f := cmd.Flags() f.BoolVar(&listOptions.KeepTempDir, "keep-temp-dir", false, "Keep temporary directory") - f.BoolVar(&skipCharts, "skip-charts", false, "don't prepare charts when listing releases") + f.BoolVar(&listOptions.SkipCharts, "skip-charts", false, "don't prepare charts when listing releases") f.StringVar(&listOptions.Output, "output", "", "output releases list as a json string") return cmd diff --git a/pkg/app/app.go b/pkg/app/app.go index 4bdf4a39..32ed2b60 100644 --- a/pkg/app/app.go +++ b/pkg/app/app.go @@ -550,7 +550,7 @@ func (a *App) ListReleases(c ListConfigProvider) error { var stateReleases []*HelmRelease var err error - if c.WithPreparedCharts() { + if !c.SkipCharts() { err = run.withPreparedCharts("list", state.ChartPrepareOptions{ SkipRepos: true, SkipDeps: true, diff --git a/pkg/app/app_list_test.go b/pkg/app/app_list_test.go index 05b6b543..528810ee 100644 --- a/pkg/app/app_list_test.go +++ b/pkg/app/app_list_test.go @@ -249,11 +249,11 @@ database my-app true true bitnami/postg } func TestListWithEnvironment(t *testing.T) { - t.Run("with prepared charts", func(t *testing.T) { - testListWithEnvironment(t, configImpl{withPreparedCharts: true}) + t.Run("with skipCharts=false", func(t *testing.T) { + testListWithEnvironment(t, configImpl{skipCharts: false}) }) - t.Run("without prepared charts", func(t *testing.T) { - testListWithEnvironment(t, configImpl{withPreparedCharts: false}) + t.Run("with skipCharts=true", func(t *testing.T) { + testListWithEnvironment(t, configImpl{skipCharts: true}) }) } @@ -316,10 +316,10 @@ releases: } func TestListWithJSONOutput(t *testing.T) { - t.Run("with prepared charts", func(t *testing.T) { - testListWithJSONOutput(t, configImpl{withPreparedCharts: true}) + t.Run("with skipCharts=false", func(t *testing.T) { + testListWithJSONOutput(t, configImpl{skipCharts: false}) }) - t.Run("without prepared charts", func(t *testing.T) { - testListWithJSONOutput(t, configImpl{withPreparedCharts: false}) + t.Run("with skipCharts=true", func(t *testing.T) { + testListWithJSONOutput(t, configImpl{skipCharts: true}) }) } diff --git a/pkg/app/app_test.go b/pkg/app/app_test.go index 15bfe67a..97954f7e 100644 --- a/pkg/app/app_test.go +++ b/pkg/app/app_test.go @@ -2220,7 +2220,7 @@ type configImpl struct { skipNeeds bool includeNeeds bool includeTransitiveNeeds bool - withPreparedCharts bool + skipCharts bool } func (c configImpl) Selectors() []string { @@ -2295,8 +2295,8 @@ func (c configImpl) Output() string { return c.output } -func (c configImpl) WithPreparedCharts() bool { - return c.withPreparedCharts +func (c configImpl) SkipCharts() bool { + return c.skipCharts } type applyConfig struct { diff --git a/pkg/app/config.go b/pkg/app/config.go index 1e268508..a66eff6b 100644 --- a/pkg/app/config.go +++ b/pkg/app/config.go @@ -236,7 +236,7 @@ type interactive interface { type ListConfigProvider interface { Output() string - WithPreparedCharts() bool + SkipCharts() bool } type CacheConfigProvider interface{} diff --git a/pkg/config/list.go b/pkg/config/list.go index 64645847..b4e76f8a 100644 --- a/pkg/config/list.go +++ b/pkg/config/list.go @@ -6,8 +6,8 @@ type ListOptions struct { Output string // KeepTempDir is the keep temp dir flag KeepTempDir bool - // WithPreparedCharts makes list call `withPreparedCharts` when listing - WithPreparedCharts bool + // SkipCharts makes List skip `withPreparedCharts` + SkipCharts bool } // NewListOptions creates a new Apply @@ -39,7 +39,7 @@ func (c *ListImpl) Output() string { return c.ListOptions.Output } -// WithPreparedCharts returns withPreparedCharts flag -func (c *ListImpl) WithPreparedCharts() bool { - return c.ListOptions.WithPreparedCharts +// SkipCharts returns skipCharts flag +func (c *ListImpl) SkipCharts() bool { + return c.ListOptions.SkipCharts }