From 2a22ff769a33d4528251999f4015ed81d3ef9fd2 Mon Sep 17 00:00:00 2001 From: Matt Butcher Date: Tue, 8 Jan 2019 09:46:47 -0700 Subject: [PATCH] fix: fixed duplicates inserted during a rebase Signed-off-by: Matt Butcher --- cmd/helm/install.go | 35 ------------------------------- pkg/action/action.go | 49 -------------------------------------------- 2 files changed, 84 deletions(-) diff --git a/cmd/helm/install.go b/cmd/helm/install.go index 76433fed7..a0b23a829 100644 --- a/cmd/helm/install.go +++ b/cmd/helm/install.go @@ -308,41 +308,6 @@ func (o *installOptions) printRelease(out io.Writer, rel *release.Release) { } } -// printRelease prints info about a release if the Debug is true. -func (o *installOptions) printRelease(out io.Writer, rel *release.Release) { - if rel == nil { - return - } - fmt.Fprintf(out, "NAME: %s\n", rel.Name) - if settings.Debug { - printRelease(out, rel) - } - if !rel.Info.LastDeployed.IsZero() { - fmt.Fprintf(out, "LAST DEPLOYED: %s\n", rel.Info.LastDeployed) - } - 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() - } - if rel.Info.LastTestSuiteRun != nil { - lastRun := rel.Info.LastTestSuiteRun - fmt.Fprintf(out, "TEST SUITE:\n%s\n%s\n\n%s\n", - fmt.Sprintf("Last Started: %s", lastRun.StartedAt), - fmt.Sprintf("Last Completed: %s", lastRun.CompletedAt), - formatTestResults(lastRun.Results)) - } - - if len(rel.Info.Notes) > 0 { - fmt.Fprintf(out, "NOTES:\n%s\n", rel.Info.Notes) - } -} - // Merges source and destination map, preferring values from the source map func mergeValues(dest, src map[string]interface{}) map[string]interface{} { for k, v := range src { diff --git a/pkg/action/action.go b/pkg/action/action.go index 2ecbb5be2..ad417cc08 100644 --- a/pkg/action/action.go +++ b/pkg/action/action.go @@ -46,55 +46,6 @@ type Configuration struct { KubeClient environment.KubeClient Log func(string, ...interface{}) - - Timestamper Timestamper -} - -// capabilities builds a Capabilities from discovery information. -func (c *Configuration) capabilities() (*chartutil.Capabilities, error) { - sv, err := c.Discovery.ServerVersion() - if err != nil { - return nil, err - } - vs, err := GetVersionSet(c.Discovery) - if err != nil { - return nil, errors.Wrap(err, "could not get apiVersions from Kubernetes") - } - return &chartutil.Capabilities{ - APIVersions: vs, - KubeVersion: sv, - HelmVersion: version.GetBuildInfo(), - }, nil -} - -// Now generates a timestamp -// -// If the configuration has a Timestamper on it, that will be used. -// Otherwise, this will use time.Now(). -func (c *Configuration) Now() time.Time { - if c.Timestamper != nil { - return c.Timestamper() - } - return time.Now() -} - -// GetVersionSet retrieves a set of available k8s API versions -func GetVersionSet(client discovery.ServerGroupsInterface) (chartutil.VersionSet, error) { - groups, err := client.ServerGroups() - if err != nil { - return chartutil.DefaultVersionSet, err - } - - // FIXME: The Kubernetes test fixture for cli appears to always return nil - // for calls to Discovery().ServerGroups(). So in this case, we return - // the default API list. This is also a safe value to return in any other - // odd-ball case. - if groups.Size() == 0 { - return chartutil.DefaultVersionSet, nil - } - - versions := metav1.ExtractGroupVersions(groups) - return chartutil.NewVersionSet(versions...), nil } // capabilities builds a Capabilities from discovery information.