diff --git a/cmd/helm/rollback.go b/cmd/helm/rollback.go index c468a37af..755ab72d2 100644 --- a/cmd/helm/rollback.go +++ b/cmd/helm/rollback.go @@ -55,7 +55,7 @@ func newRollbackCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { client.Version = ver } - if _, err := client.Run(args[0]); err != nil { + if err := client.Run(args[0]); err != nil { return err } diff --git a/cmd/helm/search/search.go b/cmd/helm/search/search.go index a78f46da8..b3892f067 100644 --- a/cmd/helm/search/search.go +++ b/cmd/helm/search/search.go @@ -29,7 +29,6 @@ import ( "strings" "github.com/Masterminds/semver" - "github.com/pkg/errors" "helm.sh/helm/pkg/repo" ) @@ -178,15 +177,6 @@ func (i *Index) SearchRegexp(re string, threshold int) ([]*Result, error) { return buf, nil } -// Chart returns the ChartVersion for a particular name. -func (i *Index) Chart(name string) (*repo.ChartVersion, error) { - c, ok := i.charts[name] - if !ok { - return nil, errors.New("no such chart") - } - return c, nil -} - // SortScore does an in-place sort of the results. // // Lowest scores are highest on the list. Matching scores are subsorted alphabetically. diff --git a/cmd/helm/status_test.go b/cmd/helm/status_test.go index 167c1ed38..f277269dd 100644 --- a/cmd/helm/status_test.go +++ b/cmd/helm/status_test.go @@ -59,22 +59,6 @@ func TestStatusCmd(t *testing.T) { Status: release.StatusDeployed, Notes: "release notes", }), - }, { - name: "get status of a deployed release with resources", - cmd: "status flummoxed-chickadee", - golden: "output/status-with-resource.txt", - rels: releasesMockWithStatus(&release.Info{ - Status: release.StatusDeployed, - Resources: "resource A\nresource B\n", - }), - }, { - name: "get status of a deployed release with resources in YAML", - cmd: "status flummoxed-chickadee -o yaml", - golden: "output/status.yaml", - rels: releasesMockWithStatus(&release.Info{ - Status: release.StatusDeployed, - Resources: "resource A\nresource B\n", - }), }, { name: "get status of a deployed release with test suite", cmd: "status flummoxed-chickadee", diff --git a/cmd/helm/testdata/output/install-and-replace.txt b/cmd/helm/testdata/output/install-and-replace.txt index 21fc9db6e..2dd9e3335 100644 --- a/cmd/helm/testdata/output/install-and-replace.txt +++ b/cmd/helm/testdata/output/install-and-replace.txt @@ -2,4 +2,3 @@ NAME: aeneas LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC NAMESPACE: default STATUS: deployed - diff --git a/cmd/helm/testdata/output/install-name-template.txt b/cmd/helm/testdata/output/install-name-template.txt index 63ea1d4c3..f82687f9b 100644 --- a/cmd/helm/testdata/output/install-name-template.txt +++ b/cmd/helm/testdata/output/install-name-template.txt @@ -2,4 +2,3 @@ NAME: FOOBAR LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC NAMESPACE: default STATUS: deployed - diff --git a/cmd/helm/testdata/output/install-no-hooks.txt b/cmd/helm/testdata/output/install-no-hooks.txt index 21fc9db6e..2dd9e3335 100644 --- a/cmd/helm/testdata/output/install-no-hooks.txt +++ b/cmd/helm/testdata/output/install-no-hooks.txt @@ -2,4 +2,3 @@ NAME: aeneas LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC NAMESPACE: default STATUS: deployed - diff --git a/cmd/helm/testdata/output/install-with-multiple-values-files.txt b/cmd/helm/testdata/output/install-with-multiple-values-files.txt index 05c879353..f64fd64a8 100644 --- a/cmd/helm/testdata/output/install-with-multiple-values-files.txt +++ b/cmd/helm/testdata/output/install-with-multiple-values-files.txt @@ -2,4 +2,3 @@ NAME: virgil LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC NAMESPACE: default STATUS: deployed - diff --git a/cmd/helm/testdata/output/install-with-multiple-values.txt b/cmd/helm/testdata/output/install-with-multiple-values.txt index 05c879353..f64fd64a8 100644 --- a/cmd/helm/testdata/output/install-with-multiple-values.txt +++ b/cmd/helm/testdata/output/install-with-multiple-values.txt @@ -2,4 +2,3 @@ NAME: virgil LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC NAMESPACE: default STATUS: deployed - diff --git a/cmd/helm/testdata/output/install-with-timeout.txt b/cmd/helm/testdata/output/install-with-timeout.txt index ac2bb5550..97e3a1a95 100644 --- a/cmd/helm/testdata/output/install-with-timeout.txt +++ b/cmd/helm/testdata/output/install-with-timeout.txt @@ -2,4 +2,3 @@ NAME: foobar LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC NAMESPACE: default STATUS: deployed - diff --git a/cmd/helm/testdata/output/install-with-values-file.txt b/cmd/helm/testdata/output/install-with-values-file.txt index 05c879353..f64fd64a8 100644 --- a/cmd/helm/testdata/output/install-with-values-file.txt +++ b/cmd/helm/testdata/output/install-with-values-file.txt @@ -2,4 +2,3 @@ NAME: virgil LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC NAMESPACE: default STATUS: deployed - diff --git a/cmd/helm/testdata/output/install-with-values.txt b/cmd/helm/testdata/output/install-with-values.txt index 05c879353..f64fd64a8 100644 --- a/cmd/helm/testdata/output/install-with-values.txt +++ b/cmd/helm/testdata/output/install-with-values.txt @@ -2,4 +2,3 @@ NAME: virgil LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC NAMESPACE: default STATUS: deployed - diff --git a/cmd/helm/testdata/output/install-with-wait.txt b/cmd/helm/testdata/output/install-with-wait.txt index 0ad49af8c..a1cb43db0 100644 --- a/cmd/helm/testdata/output/install-with-wait.txt +++ b/cmd/helm/testdata/output/install-with-wait.txt @@ -2,4 +2,3 @@ NAME: apollo LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC NAMESPACE: default STATUS: deployed - diff --git a/cmd/helm/testdata/output/install.txt b/cmd/helm/testdata/output/install.txt index 21fc9db6e..2dd9e3335 100644 --- a/cmd/helm/testdata/output/install.txt +++ b/cmd/helm/testdata/output/install.txt @@ -2,4 +2,3 @@ NAME: aeneas LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC NAMESPACE: default STATUS: deployed - diff --git a/cmd/helm/testdata/output/schema.txt b/cmd/helm/testdata/output/schema.txt index f694bfdf1..945f17d42 100644 --- a/cmd/helm/testdata/output/schema.txt +++ b/cmd/helm/testdata/output/schema.txt @@ -2,4 +2,3 @@ NAME: schema LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC NAMESPACE: default STATUS: deployed - diff --git a/cmd/helm/testdata/output/status-with-notes.txt b/cmd/helm/testdata/output/status-with-notes.txt index 111c5f98a..96b06e363 100644 --- a/cmd/helm/testdata/output/status-with-notes.txt +++ b/cmd/helm/testdata/output/status-with-notes.txt @@ -2,6 +2,5 @@ NAME: flummoxed-chickadee LAST DEPLOYED: 2016-01-16 00:00:00 +0000 UTC NAMESPACE: default STATUS: deployed - NOTES: release notes diff --git a/cmd/helm/testdata/output/status-with-test-suite.txt b/cmd/helm/testdata/output/status-with-test-suite.txt index 69c9cf425..7ff195d82 100644 --- a/cmd/helm/testdata/output/status-with-test-suite.txt +++ b/cmd/helm/testdata/output/status-with-test-suite.txt @@ -2,7 +2,6 @@ NAME: flummoxed-chickadee LAST DEPLOYED: 2016-01-16 00:00:00 +0000 UTC NAMESPACE: default STATUS: deployed - TEST SUITE: passing-test Last Started: 2006-01-02 15:04:05 +0000 UTC Last Completed: 2006-01-02 15:04:07 +0000 UTC diff --git a/cmd/helm/testdata/output/status.txt b/cmd/helm/testdata/output/status.txt index a7fc22c72..94c0cf899 100644 --- a/cmd/helm/testdata/output/status.txt +++ b/cmd/helm/testdata/output/status.txt @@ -2,4 +2,3 @@ NAME: flummoxed-chickadee LAST DEPLOYED: 2016-01-16 00:00:00 +0000 UTC NAMESPACE: default STATUS: deployed - diff --git a/cmd/helm/testdata/output/subchart-schema-cli.txt b/cmd/helm/testdata/output/subchart-schema-cli.txt index f694bfdf1..945f17d42 100644 --- a/cmd/helm/testdata/output/subchart-schema-cli.txt +++ b/cmd/helm/testdata/output/subchart-schema-cli.txt @@ -2,4 +2,3 @@ NAME: schema LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC NAMESPACE: default STATUS: deployed - diff --git a/cmd/helm/testdata/output/upgrade-with-install-timeout.txt b/cmd/helm/testdata/output/upgrade-with-install-timeout.txt index 753979405..7d433a51b 100644 --- a/cmd/helm/testdata/output/upgrade-with-install-timeout.txt +++ b/cmd/helm/testdata/output/upgrade-with-install-timeout.txt @@ -3,4 +3,3 @@ NAME: crazy-bunny LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC NAMESPACE: default STATUS: deployed - diff --git a/cmd/helm/testdata/output/upgrade-with-install.txt b/cmd/helm/testdata/output/upgrade-with-install.txt index d08b923e8..98df9d332 100644 --- a/cmd/helm/testdata/output/upgrade-with-install.txt +++ b/cmd/helm/testdata/output/upgrade-with-install.txt @@ -3,4 +3,3 @@ NAME: zany-bunny LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC NAMESPACE: default STATUS: deployed - diff --git a/cmd/helm/testdata/output/upgrade-with-reset-values.txt b/cmd/helm/testdata/output/upgrade-with-reset-values.txt index 1cfe36a34..be776ed4f 100644 --- a/cmd/helm/testdata/output/upgrade-with-reset-values.txt +++ b/cmd/helm/testdata/output/upgrade-with-reset-values.txt @@ -3,4 +3,3 @@ NAME: funny-bunny LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC NAMESPACE: default STATUS: deployed - diff --git a/cmd/helm/testdata/output/upgrade-with-reset-values2.txt b/cmd/helm/testdata/output/upgrade-with-reset-values2.txt index 1cfe36a34..be776ed4f 100644 --- a/cmd/helm/testdata/output/upgrade-with-reset-values2.txt +++ b/cmd/helm/testdata/output/upgrade-with-reset-values2.txt @@ -3,4 +3,3 @@ NAME: funny-bunny LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC NAMESPACE: default STATUS: deployed - diff --git a/cmd/helm/testdata/output/upgrade-with-timeout.txt b/cmd/helm/testdata/output/upgrade-with-timeout.txt index 1cfe36a34..be776ed4f 100644 --- a/cmd/helm/testdata/output/upgrade-with-timeout.txt +++ b/cmd/helm/testdata/output/upgrade-with-timeout.txt @@ -3,4 +3,3 @@ NAME: funny-bunny LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC NAMESPACE: default STATUS: deployed - diff --git a/cmd/helm/testdata/output/upgrade-with-wait.txt b/cmd/helm/testdata/output/upgrade-with-wait.txt index 753979405..7d433a51b 100644 --- a/cmd/helm/testdata/output/upgrade-with-wait.txt +++ b/cmd/helm/testdata/output/upgrade-with-wait.txt @@ -3,4 +3,3 @@ NAME: crazy-bunny LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC NAMESPACE: default STATUS: deployed - diff --git a/cmd/helm/testdata/output/upgrade.txt b/cmd/helm/testdata/output/upgrade.txt index 1cfe36a34..be776ed4f 100644 --- a/cmd/helm/testdata/output/upgrade.txt +++ b/cmd/helm/testdata/output/upgrade.txt @@ -3,4 +3,3 @@ NAME: funny-bunny LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC NAMESPACE: default STATUS: deployed - diff --git a/internal/ignore/rules.go b/internal/ignore/rules.go index 096e75411..c9aaeacca 100644 --- a/internal/ignore/rules.go +++ b/internal/ignore/rules.go @@ -73,11 +73,6 @@ func Parse(file io.Reader) (*Rules, error) { return r, s.Err() } -// Len returns the number of patterns in this rule set. -func (r *Rules) Len() int { - return len(r.patterns) -} - // Ignore evalutes the file at the given path, and returns true if it should be ignored. // // Ignore evaluates path against the rules in order. Evaluation stops when a match diff --git a/pkg/action/list.go b/pkg/action/list.go index b42cc812c..1d5738d11 100644 --- a/pkg/action/list.go +++ b/pkg/action/list.go @@ -138,10 +138,6 @@ func NewList(cfg *Configuration) *List { } } -func (l *List) SetConfiguration(cfg *Configuration) { - l.cfg = cfg -} - // Run executes the list command, returning a set of matches. func (l *List) Run() ([]*release.Release, error) { var filter *regexp.Regexp diff --git a/pkg/action/printer.go b/pkg/action/printer.go index 128e9fb65..704ea523d 100644 --- a/pkg/action/printer.go +++ b/pkg/action/printer.go @@ -19,9 +19,7 @@ package action import ( "fmt" "io" - "regexp" "strings" - "text/tabwriter" "helm.sh/helm/pkg/release" ) @@ -37,14 +35,6 @@ func PrintRelease(out io.Writer, rel *release.Release) { } fmt.Fprintf(out, "NAMESPACE: %s\n", rel.Namespace) fmt.Fprintf(out, "STATUS: %s\n", rel.Info.Status.String()) - fmt.Fprintf(out, "\n") - if len(rel.Info.Resources) > 0 { - re := regexp.MustCompile(" +") - - w := tabwriter.NewWriter(out, 0, 0, 2, ' ', tabwriter.TabIndent) - fmt.Fprintf(w, "RESOURCES:\n%s\n", re.ReplaceAllString(rel.Info.Resources, "\t")) - w.Flush() - } executions := executionsByHookEvent(rel) if tests, ok := executions[release.HookTest]; ok { diff --git a/pkg/action/rollback.go b/pkg/action/rollback.go index 42807335b..08279acf9 100644 --- a/pkg/action/rollback.go +++ b/pkg/action/rollback.go @@ -49,33 +49,31 @@ func NewRollback(cfg *Configuration) *Rollback { } // Run executes 'helm rollback' against the given release. -func (r *Rollback) Run(name string) (*release.Release, error) { +func (r *Rollback) Run(name string) error { r.cfg.Log("preparing rollback of %s", name) currentRelease, targetRelease, err := r.prepareRollback(name) if err != nil { - return nil, err + return err } if !r.DryRun { r.cfg.Log("creating rolled back release for %s", name) if err := r.cfg.Releases.Create(targetRelease); err != nil { - return nil, err + return err } } r.cfg.Log("performing rollback of %s", name) - res, err := r.performRollback(currentRelease, targetRelease) - if err != nil { - return res, err + if _, err := r.performRollback(currentRelease, targetRelease); err != nil { + return err } if !r.DryRun { r.cfg.Log("updating status for rolled back release for %s", name) if err := r.cfg.Releases.Update(targetRelease); err != nil { - return res, err + return err } } - - return res, nil + return nil } // prepareRollback finds the previous release and prepares a new release object with diff --git a/pkg/action/upgrade.go b/pkg/action/upgrade.go index fe2839da3..001d42e42 100644 --- a/pkg/action/upgrade.go +++ b/pkg/action/upgrade.go @@ -292,7 +292,7 @@ func (u *Upgrade) failRelease(rel *release.Release, err error) (*release.Release rollin.Recreate = u.Recreate rollin.Force = u.Force rollin.Timeout = u.Timeout - if _, rollErr := rollin.Run(rel.Name); rollErr != nil { + if rollErr := rollin.Run(rel.Name); rollErr != nil { return rel, errors.Wrapf(rollErr, "an error occurred while rolling back the release. original upgrade error: %s", err) } return rel, errors.Wrapf(err, "release %s failed, and has been rolled back due to atomic being set", rel.Name) diff --git a/pkg/chart/chart.go b/pkg/chart/chart.go index 1a54c169e..618ad8289 100644 --- a/pkg/chart/chart.go +++ b/pkg/chart/chart.go @@ -81,9 +81,6 @@ func (ch *Chart) IsRoot() bool { return ch.parent == nil } // Parent returns a subchart's parent chart. func (ch *Chart) Parent() *Chart { return ch.parent } -// SetParent sets a subchart's parent chart. -func (ch *Chart) SetParent(chart *Chart) { ch.parent = chart } - // ChartPath returns the full path to this chart in dot notation. func (ch *Chart) ChartPath() string { if !ch.IsRoot() { diff --git a/pkg/release/info.go b/pkg/release/info.go index 03922360b..51b2ecf83 100644 --- a/pkg/release/info.go +++ b/pkg/release/info.go @@ -29,8 +29,6 @@ type Info struct { Description string `json:"Description,omitempty"` // Status is the current state of the release Status Status `json:"status,omitempty"` - // Cluster resources as kubectl would print them. - Resources string `json:"resources,omitempty"` // Contains the rendered templates/NOTES.txt if available Notes string `json:"notes,omitempty"` } diff --git a/pkg/release/responses.go b/pkg/release/responses.go index 10b7f2054..7ee1fc2ee 100644 --- a/pkg/release/responses.go +++ b/pkg/release/responses.go @@ -15,16 +15,6 @@ limitations under the License. package release -// GetReleaseStatusResponse is the response indicating the status of the named release. -type GetReleaseStatusResponse struct { - // Name is the name of the release. - Name string `json:"name,omitempty"` - // Info contains information about the release. - Info *Info `json:"info,omitempty"` - // Namespace the release was released into - Namespace string `json:"namespace,omitempty"` -} - // UninstallReleaseResponse represents a successful response to an uninstall request. type UninstallReleaseResponse struct { // Release is the release that was marked deleted. diff --git a/pkg/storage/driver/records.go b/pkg/storage/driver/records.go index ab2e84b46..ee05f6676 100644 --- a/pkg/storage/driver/records.go +++ b/pkg/storage/driver/records.go @@ -93,16 +93,6 @@ func (rs *records) Replace(key string, rec *record) *record { return nil } -func (rs records) FindByVersion(vers int) (int, bool) { - i := sort.Search(len(rs), func(i int) bool { - return rs[i].rls.Version == vers - }) - if i < len(rs) && rs[i].rls.Version == vers { - return i, true - } - return i, false -} - func (rs *records) removeAt(index int) *record { r := (*rs)[index] (*rs)[index] = nil diff --git a/pkg/storage/storage.go b/pkg/storage/storage.go index dea0ea8b4..7e2c1b6fc 100644 --- a/pkg/storage/storage.go +++ b/pkg/storage/storage.go @@ -100,26 +100,6 @@ func (s *Storage) ListDeployed() ([]*rspb.Release, error) { }) } -// ListFilterAll returns the set of releases satisfying the predicate -// (filter0 && filter1 && ... && filterN), i.e. a Release is included in the results -// if and only if all filters return true. -func (s *Storage) ListFilterAll(fns ...relutil.FilterFunc) ([]*rspb.Release, error) { - s.Log("listing all releases with filter") - return s.Driver.List(func(rls *rspb.Release) bool { - return relutil.All(fns...).Check(rls) - }) -} - -// ListFilterAny returns the set of releases satisfying the predicate -// (filter0 || filter1 || ... || filterN), i.e. a Release is included in the results -// if at least one of the filters returns true. -func (s *Storage) ListFilterAny(fns ...relutil.FilterFunc) ([]*rspb.Release, error) { - s.Log("listing any releases with filter") - return s.Driver.List(func(rls *rspb.Release) bool { - return relutil.Any(fns...).Check(rls) - }) -} - // Deployed returns the last deployed release with the provided release name, or // returns ErrReleaseNotFound if not found. func (s *Storage) Deployed(name string) (*rspb.Release, error) {