Repository: helm/helm
Pull request #9795 (2021-06-11 16:50:05)

Cherry-pick off the current PRs merged for 3.6.1 release
<!--  Thanks for sending a pull request!  Here are some tips for you:
1. Make sure to read the Contributing Guide before submitting your PR: https://github.com/helm/helm/blob/main/CONTRIBUTING.md
2. If this PR closes another issue, add 'closes #<issue number>' somewhere in the PR summary. GitHub will automatically close that issue when this PR gets merged. Alternatively, adding 'refs #<issue number>' will not close the issue, but help provide the reviewer more context.-->

**What this PR does / why we need it**:

**Special notes for your reviewer**:

**If applicable**:
- [ ] this PR contains documentation
- [ ] this PR contains unit tests
- [ ] this PR has been tested for backwards compatibility



Patch:
diff --git a/OWNERS b/OWNERS
index aab2709e5..536744035 100644
--- a/OWNERS
+++ b/OWNERS
@@ -1,6 +1,7 @@
 maintainers:
   - adamreese
   - bacongobbler
+  - fibonacci1729
   - hickeyma
   - jdolitsky
   - marckhouzam
@@ -8,8 +9,8 @@ maintainers:
   - prydonius
   - SlickNik
   - technosophos
+  - viglesiasce
 emeritus:
-  - fibonacci1729
   - jascott1
   - michelleN
   - migmartri
@@ -18,4 +19,3 @@ emeritus:
   - seh
   - thomastaylor312
   - vaikas-google
-  - viglesiasce
diff --git a/cmd/helm/chart_list.go b/cmd/helm/chart_list.go
index e81882ccc..a9d01c9bd 100644
--- a/cmd/helm/chart_list.go
+++ b/cmd/helm/chart_list.go
@@ -31,18 +31,14 @@ Charts are sorted by ref name, alphabetically.
 `
 
 func newChartListCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
-	chartList := action.NewChartList(cfg)
-	cmd := &cobra.Command{
+	return &cobra.Command{
 		Use:     "list",
 		Aliases: []string{"ls"},
 		Short:   "list all saved charts",
 		Long:    chartListDesc,
 		Hidden:  !FeatureGateOCI.IsEnabled(),
 		RunE: func(cmd *cobra.Command, args []string) error {
-			return chartList.Run(out)
+			return action.NewChartList(cfg).Run(out)
 		},
 	}
-	f := cmd.Flags()
-	f.UintVar(&chartList.ColumnWidth, "max-col-width", 60, "maximum column width for output table")
-	return cmd
 }
diff --git a/cmd/helm/completion.go b/cmd/helm/completion.go
index 880e77c57..5aea0592e 100644
--- a/cmd/helm/completion.go
+++ b/cmd/helm/completion.go
@@ -33,41 +33,33 @@ const bashCompDesc = `
 Generate the autocompletion script for Helm for the bash shell.
 
 To load completions in your current shell session:
-
-    source <(helm completion bash)
+$ source <(helm completion bash)
 
 To load completions for every new session, execute once:
-- Linux:
-
-      helm completion bash > /etc/bash_completion.d/helm
-
-- MacOS:
-
-      helm completion bash > /usr/local/etc/bash_completion.d/helm
+Linux:
+  $ helm completion bash > /etc/bash_completion.d/helm
+MacOS:
+  $ helm completion bash > /usr/local/etc/bash_completion.d/helm
 `
 
 const zshCompDesc = `
 Generate the autocompletion script for Helm for the zsh shell.
 
 To load completions in your current shell session:
-
-    source <(helm completion zsh)
+$ source <(helm completion zsh)
 
 To load completions for every new session, execute once:
-
-    helm completion zsh > "${fpath[1]}/_helm"
+$ helm completion zsh > "${fpath[1]}/_helm"
 `
 
 const fishCompDesc = `
 Generate the autocompletion script for Helm for the fish shell.
 
 To load completions in your current shell session:
-
-    helm completion fish | source
+$ helm completion fish | source
 
 To load completions for every new session, execute once:
-
-    helm completion fish > ~/.config/fish/completions/helm.fish
+$ helm completion fish > ~/.config/fish/completions/helm.fish
 
 You will need to start a new shell for this setup to take effect.
 `
diff --git a/cmd/helm/dependency.go b/cmd/helm/dependency.go
index 03874742c..6bb82e217 100644
--- a/cmd/helm/dependency.go
+++ b/cmd/helm/dependency.go
@@ -100,6 +100,7 @@ func newDependencyCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
 
 func newDependencyListCmd(out io.Writer) *cobra.Command {
 	client := action.NewDependency()
+
 	cmd := &cobra.Command{
 		Use:     "list CHART",
 		Aliases: []string{"ls"},
@@ -114,9 +115,5 @@ func newDependencyListCmd(out io.Writer) *cobra.Command {
 			return client.List(chartpath, out)
 		},
 	}
-
-	f := cmd.Flags()
-
-	f.UintVar(&client.ColumnWidth, "max-col-width", 80, "maximum column width for output table")
 	return cmd
 }
diff --git a/cmd/helm/install.go b/cmd/helm/install.go
index 04419d730..fac2131c1 100644
--- a/cmd/helm/install.go
+++ b/cmd/helm/install.go
@@ -145,7 +145,7 @@ func addInstallFlags(cmd *cobra.Command, f *pflag.FlagSet, client *action.Instal
 	f.StringVar(&client.NameTemplate, "name-template", "", "specify template used to name the release")
 	f.StringVar(&client.Description, "description", "", "add a custom description")
 	f.BoolVar(&client.Devel, "devel", false, "use development versions, too. Equivalent to version '>0.0.0-0'. If --version is set, this is ignored")
-	f.BoolVar(&client.DependencyUpdate, "dependency-update", false, "update dependencies if they are missing before installing the chart")
+	f.BoolVar(&client.DependencyUpdate, "dependency-update", false, "run helm dependency update before installing the chart")
 	f.BoolVar(&client.DisableOpenAPIValidation, "disable-openapi-validation", false, "if set, the installation process will not validate rendered templates against the Kubernetes OpenAPI Schema")
 	f.BoolVar(&client.Atomic, "atomic", false, "if set, the installation process deletes the installation on failure. The --wait flag will be set automatically if --atomic is used")
 	f.BoolVar(&client.SkipCRDs, "skip-crds", false, "if set, no CRDs will be installed. By default, CRDs are installed if not already present")
diff --git a/cmd/helm/upgrade.go b/cmd/helm/upgrade.go
index 3bd392d1d..1952b8421 100644
--- a/cmd/helm/upgrade.go
+++ b/cmd/helm/upgrade.go
@@ -30,7 +30,6 @@ import (
 	"helm.sh/helm/v3/pkg/chart/loader"
 	"helm.sh/helm/v3/pkg/cli/output"
 	"helm.sh/helm/v3/pkg/cli/values"
-	"helm.sh/helm/v3/pkg/downloader"
 	"helm.sh/helm/v3/pkg/getter"
 	"helm.sh/helm/v3/pkg/storage/driver"
 )
@@ -133,8 +132,7 @@ func newUpgradeCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
 				return err
 			}
 
-			p := getter.All(settings)
-			vals, err := valueOpts.MergeValues(p)
+			vals, err := valueOpts.MergeValues(getter.All(settings))
 			if err != nil {
 				return err
 			}
@@ -146,27 +144,7 @@ func newUpgradeCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
 			}
 			if req := ch.Metadata.Dependencies; req != nil {
 				if err := action.CheckDependencies(ch, req); err != nil {
-					if client.DependencyUpdate {
-						man := &downloader.Manager{
-							Out:              out,
-							ChartPath:        chartPath,
-							Keyring:          client.ChartPathOptions.Keyring,
-							SkipUpdate:       false,
-							Getters:          p,
-							RepositoryConfig: settings.RepositoryConfig,
-							RepositoryCache:  settings.RepositoryCache,
-							Debug:            settings.Debug,
-						}
-						if err := man.Update(); err != nil {
-							return err
-						}
-						// Reload the chart with the updated Chart.lock file.
-						if ch, err = loader.Load(chartPath); err != nil {
-							return errors.Wrap(err, "failed reloading chart after repo update")
-						}
-					} else {
-						return err
-					}
+					return err
 				}
 			}
 
@@ -208,7 +186,6 @@ func newUpgradeCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
 	f.BoolVar(&client.CleanupOnFail, "cleanup-on-fail", false, "allow deletion of new resources created in this upgrade when upgrade fails")
 	f.BoolVar(&client.SubNotes, "render-subchart-notes", false, "if set, render subchart notes along with the parent")
 	f.StringVar(&client.Description, "description", "", "add a custom description")
-	f.BoolVar(&client.DependencyUpdate, "dependency-update", false, "update dependencies if they are missing before installing the chart")
 	addChartPathOptionsFlags(f, &client.ChartPathOptions)
 	addValueOptionsFlags(f, valueOpts)
 	bindOutputFlag(cmd, &outfmt)
diff --git a/cmd/helm/version.go b/cmd/helm/version.go
index d62778f7b..72f93e545 100644
--- a/cmd/helm/version.go
+++ b/cmd/helm/version.go
@@ -48,8 +48,6 @@ the template:
 - .GitCommit is the git commit
 - .GitTreeState is the state of the git tree when Helm was built
 - .GoVersion contains the version of Go that Helm was compiled with
-
-For example, --template='Version: {{.Version}}' outputs 'Version: v3.2.1'.
 `
 
 type versionOptions struct {
diff --git a/internal/experimental/registry/client.go b/internal/experimental/registry/client.go
index 26556533c..c889ee913 100644
--- a/internal/experimental/registry/client.go
+++ b/internal/experimental/registry/client.go
@@ -51,7 +51,6 @@ type (
 		authorizer      *Authorizer
 		resolver        *Resolver
 		cache           *Cache
-		columnWidth     uint
 	}
 )
 
@@ -96,10 +95,6 @@ func NewClient(opts ...ClientOption) (*Client, error) {
 		}
 		client.cache = cache
 	}
-
-	if client.columnWidth == 0 {
-		client.columnWidth = 60
-	}
 	return client, nil
 }
 
@@ -284,7 +279,7 @@ func (c *Client) RemoveChart(ref *Reference) error {
 // PrintChartTable prints a list of locally stored charts
 func (c *Client) PrintChartTable() error {
 	table := uitable.New()
-	table.MaxColWidth = c.columnWidth
+	table.MaxColWidth = 60
 	table.AddRow("REF", "NAME", "VERSION", "DIGEST", "SIZE", "CREATED")
 	rows, err := c.getChartTableRows()
 	if err != nil {
diff --git a/internal/experimental/registry/client_opts.go b/internal/experimental/registry/client_opts.go
index 266cf3f6f..e2f742aec 100644
--- a/internal/experimental/registry/client_opts.go
+++ b/internal/experimental/registry/client_opts.go
@@ -67,10 +67,3 @@ func ClientOptCredentialsFile(credentialsFile string) ClientOption {
 		client.credentialsFile = credentialsFile
 	}
 }
-
-// ClientOptColumnWidth returns a function that sets the column width on a client options set
-func ClientOptColumnWidth(columnWidth uint) ClientOption {
-	return func(client *Client) {
-		client.columnWidth = columnWidth
-	}
-}
diff --git a/pkg/action/action.go b/pkg/action/action.go
index f093ed7f8..38ba638e4 100644
--- a/pkg/action/action.go
+++ b/pkg/action/action.go
@@ -102,11 +102,11 @@ type Configuration struct {
 // TODO: This function is badly in need of a refactor.
 // TODO: As part of the refactor the duplicate code in cmd/helm/template.go should be removed
 //       This code has to do with writing files to disk.
-func (cfg *Configuration) renderResources(ch *chart.Chart, values chartutil.Values, releaseName, outputDir string, subNotes, useReleaseName, includeCrds bool, pr postrender.PostRenderer, dryRun bool) ([]*release.Hook, *bytes.Buffer, string, error) {
+func (c *Configuration) renderResources(ch *chart.Chart, values chartutil.Values, releaseName, outputDir string, subNotes, useReleaseName, includeCrds bool, pr postrender.PostRenderer, dryRun bool) ([]*release.Hook, *bytes.Buffer, string, error) {
 	hs := []*release.Hook{}
 	b := bytes.NewBuffer(nil)
 
-	caps, err := cfg.getCapabilities()
+	caps, err := c.getCapabilities()
 	if err != nil {
 		return hs, b, "", err
 	}
@@ -125,12 +125,12 @@ func (cfg *Configuration) renderResources(ch *chart.Chart, values chartutil.Valu
 	// is mocked. It is not up to the template author to decide when the user wants to
 	// connect to the cluster. So when the user says to dry run, respect the user's
 	// wishes and do not connect to the cluster.
-	if !dryRun && cfg.RESTClientGetter != nil {
-		restConfig, err := cfg.RESTClientGetter.ToRESTConfig()
+	if !dryRun && c.RESTClientGetter != nil {
+		rest, err := c.RESTClientGetter.ToRESTConfig()
 		if err != nil {
 			return hs, b, "", err
 		}
-		files, err2 = engine.RenderWithClient(ch, values, restConfig)
+		files, err2 = engine.RenderWithClient(ch, values, rest)
 	} else {
 		files, err2 = engine.Render(ch, values)
 	}
@@ -236,11 +236,11 @@ type RESTClientGetter interface {
 type DebugLog func(format string, v ...interface{})
 
 // capabilities builds a Capabilities from discovery information.
-func (cfg *Configuration) getCapabilities() (*chartutil.Capabilities, error) {
-	if cfg.Capabilities != nil {
-		return cfg.Capabilities, nil
+func (c *Configuration) getCapabilities() (*chartutil.Capabilities, error) {
+	if c.Capabilities != nil {
+		return c.Capabilities, nil
 	}
-	dc, err := cfg.RESTClientGetter.ToDiscoveryClient()
+	dc, err := c.RESTClientGetter.ToDiscoveryClient()
 	if err != nil {
 		return nil, errors.Wrap(err, "could not get Kubernetes discovery client")
 	}
@@ -258,14 +258,14 @@ func (cfg *Configuration) getCapabilities() (*chartutil.Capabilities, error) {
 	apiVersions, err := GetVersionSet(dc)
 	if err != nil {
 		if discovery.IsGroupDiscoveryFailedError(err) {
-			cfg.Log("WARNING: The Kubernetes server has an orphaned API service. Server reports: %s", err)
-			cfg.Log("WARNING: To fix this, kubectl delete apiservice <service-name>")
+			c.Log("WARNING: The Kubernetes server has an orphaned API service. Server reports: %s", err)
+			c.Log("WARNING: To fix this, kubectl delete apiservice <service-name>")
 		} else {
 			return nil, errors.Wrap(err, "could not get apiVersions from Kubernetes")
 		}
 	}
 
-	cfg.Capabilities = &chartutil.Capabilities{
+	c.Capabilities = &chartutil.Capabilities{
 		APIVersions: apiVersions,
 		KubeVersion: chartutil.KubeVersion{
 			Version: kubeVersion.GitVersion,
@@ -273,12 +273,12 @@ func (cfg *Configuration) getCapabilities() (*chartutil.Capabilities, error) {
 			Minor:   kubeVersion.Minor,
 		},
 	}
-	return cfg.Capabilities, nil
+	return c.Capabilities, nil
 }
 
 // KubernetesClientSet creates a new kubernetes ClientSet based on the configuration
-func (cfg *Configuration) KubernetesClientSet() (kubernetes.Interface, error) {
-	conf, err := cfg.RESTClientGetter.ToRESTConfig()
+func (c *Configuration) KubernetesClientSet() (kubernetes.Interface, error) {
+	conf, err := c.RESTClientGetter.ToRESTConfig()
 	if err != nil {
 		return nil, errors.Wrap(err, "unable to generate config for kubernetes client")
 	}
@@ -290,20 +290,20 @@ func (cfg *Configuration) KubernetesClientSet() (kubernetes.Interface, error) {
 //
 // If the configuration has a Timestamper on it, that will be used.
 // Otherwise, this will use time.Now().
-func (cfg *Configuration) Now() time.Time {
+func (c *Configuration) Now() time.Time {
 	return Timestamper()
 }
 
-func (cfg *Configuration) releaseContent(name string, version int) (*release.Release, error) {
+func (c *Configuration) releaseContent(name string, version int) (*release.Release, error) {
 	if err := chartutil.ValidateReleaseName(name); err != nil {
 		return nil, errors.Errorf("releaseContent: Release name is invalid: %s", name)
 	}
 
 	if version <= 0 {
-		return cfg.Releases.Last(name)
+		return c.Releases.Last(name)
 	}
 
-	return cfg.Releases.Get(name, version)
+	return c.Releases.Get(name, version)
 }
 
 // GetVersionSet retrieves a set of available k8s API versions
@@ -355,14 +355,14 @@ func GetVersionSet(client discovery.ServerResourcesInterface) (chartutil.Version
 }
 
 // recordRelease with an update operation in case reuse has been set.
-func (cfg *Configuration) recordRelease(r *release.Release) {
-	if err := cfg.Releases.Update(r); err != nil {
-		cfg.Log("warning: Failed to update release %s: %s", r.Name, err)
+func (c *Configuration) recordRelease(r *release.Release) {
+	if err := c.Releases.Update(r); err != nil {
+		c.Log("warning: Failed to update release %s: %s", r.Name, err)
 	}
 }
 
 // Init initializes the action configuration
-func (cfg *Configuration) Init(getter genericclioptions.RESTClientGetter, namespace, helmDriver string, log DebugLog) error {
+func (c *Configuration) Init(getter genericclioptions.RESTClientGetter, namespace, helmDriver string, log DebugLog) error {
 	kc := kube.New(getter)
 	kc.Log = log
 
@@ -383,8 +383,8 @@ func (cfg *Configuration) Init(getter genericclioptions.RESTClientGetter, namesp
 		store = storage.Init(d)
 	case "memory":
 		var d *driver.Memory
-		if cfg.Releases != nil {
-			if mem, ok := cfg.Releases.Driver.(*driver.Memory); ok {
+		if c.Releases != nil {
+			if mem, ok := c.Releases.Driver.(*driver.Memory); ok {
 				// This function can be called more than once (e.g., helm list --all-namespaces).
 				// If a memory driver was already initialized, re-use it but set the possibly new namespace.
 				// We re-use it in case some releases where already created in the existing memory driver.
@@ -411,10 +411,10 @@ func (cfg *Configuration) Init(getter genericclioptions.RESTClientGetter, namesp
 		panic("Unknown driver in HELM_DRIVER: " + helmDriver)
 	}
 
-	cfg.RESTClientGetter = getter
-	cfg.KubeClient = kc
-	cfg.Releases = store
-	cfg.Log = log
+	c.RESTClientGetter = getter
+	c.KubeClient = kc
+	c.Releases = store
+	c.Log = log
 
 	return nil
 }
diff --git a/pkg/action/chart_list.go b/pkg/action/chart_list.go
index ba49a887d..db764b3a3 100644
--- a/pkg/action/chart_list.go
+++ b/pkg/action/chart_list.go
@@ -18,14 +18,11 @@ package action
 
 import (
 	"io"
-
-	"helm.sh/helm/v3/internal/experimental/registry"
 )
 
 // ChartList performs a chart list operation.
 type ChartList struct {
-	cfg         *Configuration
-	ColumnWidth uint
+	cfg *Configuration
 }
 
 // NewChartList creates a new ChartList object with the given configuration.
@@ -37,8 +34,5 @@ func NewChartList(cfg *Configuration) *ChartList {
 
 // Run executes the chart list operation
 func (a *ChartList) Run(out io.Writer) error {
-	client := a.cfg.RegistryClient
-	opt := registry.ClientOptColumnWidth(a.ColumnWidth)
-	opt(client)
-	return client.PrintChartTable()
+	return a.cfg.RegistryClient.PrintChartTable()
 }
diff --git a/pkg/action/dependency.go b/pkg/action/dependency.go
index 6a284d762..578a46aec 100644
--- a/pkg/action/dependency.go
+++ b/pkg/action/dependency.go
@@ -37,14 +37,11 @@ type Dependency struct {
 	Verify      bool
 	Keyring     string
 	SkipRefresh bool
-	ColumnWidth uint
 }
 
 // NewDependency creates a new Dependency object with the given configuration.
 func NewDependency() *Dependency {
-	return &Dependency{
-		ColumnWidth: 80,
-	}
+	return &Dependency{}
 }
 
 // List executes 'helm dependency list'.
@@ -184,7 +181,7 @@ func statArchiveForStatus(archive string, dep *chart.Dependency) string {
 // printDependencies prints all of the dependencies in the yaml file.
 func (d *Dependency) printDependencies(chartpath string, out io.Writer, c *chart.Chart) {
 	table := uitable.New()
-	table.MaxColWidth = d.ColumnWidth
+	table.MaxColWidth = 80
 	table.AddRow("NAME", "VERSION", "REPOSITORY", "STATUS")
 	for _, row := range c.Metadata.Dependencies {
 		table.AddRow(row.Name, row.Version, row.Repository, d.dependencyStatus(chartpath, row, c))
diff --git a/pkg/action/install.go b/pkg/action/install.go
index c33d6bf3c..af99717d1 100644
--- a/pkg/action/install.go
+++ b/pkg/action/install.go
@@ -225,7 +225,7 @@ func (i *Install) Run(chrt *chart.Chart, vals map[string]interface{}) (*release.
 		return nil, err
 	}
 
-	// special case for helm template --is-upgrade
+	//special case for helm template --is-upgrade
 	isUpgrade := i.IsUpgrade && i.DryRun
 	options := chartutil.ReleaseOptions{
 		Name:      i.ReleaseName,
diff --git a/pkg/action/upgrade.go b/pkg/action/upgrade.go
index 07d9cb40e..3b3dd3f1c 100644
--- a/pkg/action/upgrade.go
+++ b/pkg/action/upgrade.go
@@ -98,8 +98,6 @@ type Upgrade struct {
 	PostRenderer postrender.PostRenderer
 	// DisableOpenAPIValidation controls whether OpenAPI validation is enforced.
 	DisableOpenAPIValidation bool
-	// Get missing dependencies
-	DependencyUpdate bool
 }
 
 // NewUpgrade creates a new Upgrade object with the given configuration.
diff --git a/pkg/chartutil/coalesce.go b/pkg/chartutil/coalesce.go
index 7b1ee1d80..e086d8b6e 100644
--- a/pkg/chartutil/coalesce.go
+++ b/pkg/chartutil/coalesce.go
@@ -127,10 +127,9 @@ func coalesceGlobals(dest, src map[string]interface{}) {
 			// It's not clear if this condition can actually ever trigger.
 			log.Printf("key %s is table. Skipping", key)
 			continue
-		} else {
-			// TODO: Do we need to do any additional checking on the value?
-			dg[key] = val
 		}
+		// TODO: Do we need to do any additional checking on the value?
+		dg[key] = val
 	}
 	dest[GlobalKey] = dg
 }
diff --git a/pkg/downloader/manager.go b/pkg/downloader/manager.go
index 2dedc5757..49b3d317c 100644
--- a/pkg/downloader/manager.go
+++ b/pkg/downloader/manager.go
@@ -276,21 +276,21 @@ func (m *Manager) downloadAll(deps []*chart.Dependency) error {
 			chartPath := filepath.Join(tmpPath, dep.Name)
 			ch, err := loader.LoadDir(chartPath)
 			if err != nil {
-				return fmt.Errorf("unable to load chart: %v", err)
+				return fmt.Errorf("Unable to load chart: %v", err)
 			}
 
 			constraint, err := semver.NewConstraint(dep.Version)
 			if err != nil {
-				return fmt.Errorf("dependency %s has an invalid version/constraint format: %s", dep.Name, err)
+				return fmt.Errorf("Dependency %s has an invalid version/constraint format: %s", dep.Name, err)
 			}
 
 			v, err := semver.NewVersion(ch.Metadata.Version)
 			if err != nil {
-				return fmt.Errorf("invalid version %s for dependency %s: %s", dep.Version, dep.Name, err)
+				return fmt.Errorf("Invalid version %s for dependency %s: %s", dep.Version, dep.Name, err)
 			}
 
 			if !constraint.Check(v) {
-				saveError = fmt.Errorf("dependency %s at version %s does not satisfy the constraint %s", dep.Name, ch.Metadata.Version, dep.Version)
+				saveError = fmt.Errorf("Dependency %s at version %s does not satisfy the constraint %s", dep.Name, ch.Metadata.Version, dep.Version)
 				break
 			}
 			continue
diff --git a/pkg/engine/lookup_func.go b/pkg/engine/lookup_func.go
index d1bf1105a..cd3883c0f 100644
--- a/pkg/engine/lookup_func.go
+++ b/pkg/engine/lookup_func.go
@@ -63,7 +63,7 @@ func NewLookupFunction(config *rest.Config) lookupFunc {
 			}
 			return obj.UnstructuredContent(), nil
 		}
-		// this will return a list
+		//this will return a list
 		obj, err := client.List(context.Background(), metav1.ListOptions{})
 		if err != nil {
 			if apierrors.IsNotFound(err) {
@@ -112,7 +112,7 @@ func getAPIResourceForGVK(gvk schema.GroupVersionKind, config *rest.Config) (met
 		return res, err
 	}
 	for _, resource := range resList.APIResources {
-		// if a resource contains a "/" it's referencing a subresource. we don't support suberesource for now.
+		//if a resource contains a "/" it's referencing a subresource. we don't support suberesource for now.
 		if resource.Kind == gvk.Kind && !strings.Contains(resource.Name, "/") {
 			res = resource
 			res.Group = gvk.Group
diff --git a/pkg/getter/httpgetter.go b/pkg/getter/httpgetter.go
index 9920cf14c..bd60629ae 100644
--- a/pkg/getter/httpgetter.go
+++ b/pkg/getter/httpgetter.go
@@ -33,7 +33,7 @@ type HTTPGetter struct {
 	opts options
 }
 
-// Get performs a Get from repo.Getter and returns the body.
+//Get performs a Get from repo.Getter and returns the body.
 func (g *HTTPGetter) Get(href string, options ...Option) (*bytes.Buffer, error) {
 	for _, opt := range options {
 		opt(&g.opts)
diff --git a/pkg/lint/rules/template.go b/pkg/lint/rules/template.go
index daeab4cfc..f70c997cf 100644
--- a/pkg/lint/rules/template.go
+++ b/pkg/lint/rules/template.go
@@ -113,7 +113,7 @@ func Templates(linter *support.Linter, values map[string]interface{}, namespace
 
 		// NOTE: disabled for now, Refs https://github.com/helm/helm/issues/1463
 		// Check that all the templates have a matching value
-		// linter.RunLinterRule(support.WarningSev, fpath, validateNoMissingValues(templatesPath, valuesToRender, preExecutedTemplate))
+		//linter.RunLinterRule(support.WarningSev, fpath, validateNoMissingValues(templatesPath, valuesToRender, preExecutedTemplate))
 
 		// NOTE: disabled for now, Refs https://github.com/helm/helm/issues/1037
 		// linter.RunLinterRule(support.WarningSev, fpath, validateQuotes(string(preExecutedTemplate)))
diff --git a/pkg/plugin/plugin.go b/pkg/plugin/plugin.go
index 1399b7116..9ead561b2 100644
--- a/pkg/plugin/plugin.go
+++ b/pkg/plugin/plugin.go
@@ -152,7 +152,7 @@ func (p *Plugin) PrepareCommand(extraArgs []string) (string, []string, error) {
 		parts = strings.Split(os.ExpandEnv(p.Metadata.Command), " ")
 	}
 	if len(parts) == 0 || parts[0] == "" {
-		return "", nil, fmt.Errorf("no plugin command is applicable")
+		return "", nil, fmt.Errorf("No plugin command is applicable")
 	}
 
 	main := parts[0]
diff --git a/scripts/get b/scripts/get
index 8ad10459a..38c791223 100755
--- a/scripts/get
+++ b/scripts/get
@@ -76,8 +76,14 @@ verifySupported() {
 # checkDesiredVersion checks if the desired version is available.
 checkDesiredVersion() {
   if [ "x$DESIRED_VERSION" == "x" ]; then
-    # Pinning tag to v2.17.0 as per https://github.com/helm/helm/issues/9607
-    TAG=v2.17.0
+    # Get tag from release URL
+    local release_url="https://github.com/helm/helm/releases"
+    if type "curl" > /dev/null; then
+
+      TAG=$(curl -Ls $release_url | grep 'href="/helm/helm/releases/tag/v2.[0-9]*.[0-9]*\"' | grep -v no-underline | head -n 1 | cut -d '"' -f 2 | awk '{n=split($NF,a,"/");print a[n]}' | awk 'a !~ $0{print}; {a=$0}')
+    elif type "wget" > /dev/null; then
+      TAG=$(wget $release_url -O - 2>&1 | grep 'href="/helm/helm/releases/tag/v2.[0-9]*.[0-9]*\"' | grep -v no-underline | head -n 1 | cut -d '"' -f 2 | awk '{n=split($NF,a,"/");print a[n]}' | awk 'a !~ $0{print}; {a=$0}')
+    fi
   else
     TAG=$DESIRED_VERSION
   fi


Test patch:
diff --git a/cmd/helm/testdata/output/upgrade-with-dependency-update.txt b/cmd/helm/testdata/output/upgrade-with-dependency-update.txt
deleted file mode 100644
index 0e7e5842e..000000000
--- a/cmd/helm/testdata/output/upgrade-with-dependency-update.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-Release "funny-bunny" has been upgraded. Happy Helming!
-NAME: funny-bunny
-LAST DEPLOYED: Fri Sep  2 22:04:05 1977
-NAMESPACE: default
-STATUS: deployed
-REVISION: 3
-TEST SUITE: None
-NOTES:
-PARENT NOTES
diff --git a/cmd/helm/testdata/testcharts/chart-with-subchart-update/Chart.lock b/cmd/helm/testdata/testcharts/chart-with-subchart-update/Chart.lock
deleted file mode 100644
index 31cda6bd6..000000000
--- a/cmd/helm/testdata/testcharts/chart-with-subchart-update/Chart.lock
+++ /dev/null
@@ -1,6 +0,0 @@
-dependencies:
-- name: subchart-with-notes
-  repository: file://../chart-with-subchart-notes/charts/subchart-with-notes
-  version: 0.0.1
-digest: sha256:8ca45f73ae3f6170a09b64a967006e98e13cd91eb51e5ab0599bb87296c7df0a
-generated: "2021-05-02T15:07:22.1099921+02:00"
diff --git a/cmd/helm/upgrade_test.go b/cmd/helm/upgrade_test.go
index fc2a22d7d..e952a5933 100644
--- a/cmd/helm/upgrade_test.go
+++ b/cmd/helm/upgrade_test.go
@@ -32,7 +32,6 @@ import (
 )
 
 func TestUpgradeCmd(t *testing.T) {
-
 	tmpChart := ensure.TempDir(t)
 	cfile := &chart.Chart{
 		Metadata: &chart.Metadata{
@@ -80,7 +79,6 @@ func TestUpgradeCmd(t *testing.T) {
 
 	missingDepsPath := "testdata/testcharts/chart-missing-deps"
 	badDepsPath := "testdata/testcharts/chart-bad-requirements"
-	presentDepsPath := "testdata/testcharts/chart-with-subchart-update"
 
 	relWithStatusMock := func(n string, v int, ch *chart.Chart, status release.Status) *release.Release {
 		return release.Mock(&release.MockReleaseOptions{Name: n, Version: v, Chart: ch, Status: status})
@@ -151,12 +149,6 @@ func TestUpgradeCmd(t *testing.T) {
 			golden:    "output/upgrade-with-bad-dependencies.txt",
 			wantError: true,
 		},
-		{
-			name:   "upgrade a release with resolving missing dependencies",
-			cmd:    fmt.Sprintf("upgrade --dependency-update funny-bunny %s", presentDepsPath),
-			golden: "output/upgrade-with-dependency-update.txt",
-			rels:   []*release.Release{relMock("funny-bunny", 2, ch2)},
-		},
 		{
 			name:      "upgrade a non-existent release",
 			cmd:       fmt.Sprintf("upgrade funny-bunny '%s'", chartPath),
diff --git a/pkg/chartutil/coalesce_test.go b/pkg/chartutil/coalesce_test.go
index fc55e0a25..5a4656d71 100644
--- a/pkg/chartutil/coalesce_test.go
+++ b/pkg/chartutil/coalesce_test.go
@@ -87,9 +87,6 @@ func TestCoalesceValues(t *testing.T) {
 			&chart.Chart{
 				Metadata: &chart.Metadata{Name: "ahab"},
 				Values: map[string]interface{}{
-					"global": map[string]interface{}{
-						"nested": map[string]interface{}{"foo": "bar"},
-					},
 					"scope":  "ahab",
 					"name":   "ahab",
 					"boat":   true,
@@ -138,11 +135,9 @@ func TestCoalesceValues(t *testing.T) {
 		{"{{.pequod.ahab.scope}}", "whale"},
 		{"{{.pequod.ahab.nested.foo}}", "true"},
 		{"{{.pequod.ahab.global.name}}", "Ishmael"},
-		{"{{.pequod.ahab.global.nested.foo}}", "bar"},
 		{"{{.pequod.ahab.global.subject}}", "Queequeg"},
 		{"{{.pequod.ahab.global.harpooner}}", "Tashtego"},
 		{"{{.pequod.global.name}}", "Ishmael"},
-		{"{{.pequod.global.nested.foo}}", "<no value>"},
 		{"{{.pequod.global.subject}}", "Queequeg"},
 		{"{{.spouter.global.name}}", "Ishmael"},
 		{"{{.spouter.global.harpooner}}", "<no value>"},