diff --git a/cmd/helm/install.go b/cmd/helm/install.go index 410505ef1..134bc6d6d 100644 --- a/cmd/helm/install.go +++ b/cmd/helm/install.go @@ -262,7 +262,7 @@ func runInstall(args []string, client *action.Install, valueOpts *values.Options client.Namespace = settings.Namespace() - // validate dry-run-option flag value is one of the allowed values + // Validate DryRunOption member is one of the allowed values if err := validateDryRunOptionFlag(client.DryRunOption); err != nil { return nil, err } @@ -309,7 +309,7 @@ func compInstall(args []string, toComplete string, client *action.Install) ([]st } func validateDryRunOptionFlag(dryRunOptionFlagValue string) error { - // validate dry-run-option flag value with set of allowed value + // Validate dry-run flag value with a set of allowed value allowedDryRunValues := []string{"false", "true", "none", "client", "server"} isAllowed := false for _, v := range allowedDryRunValues { @@ -319,7 +319,7 @@ func validateDryRunOptionFlag(dryRunOptionFlagValue string) error { } } if !isAllowed { - return errors.New("Invalid dry-run flag. Flag must one of the following: false, true, none, client, sever") + return errors.New("Invalid dry-run flag. Flag must one of the following: false, true, none, client, server") } return nil } diff --git a/cmd/helm/upgrade.go b/cmd/helm/upgrade.go index 355b181e3..7c4ff473e 100644 --- a/cmd/helm/upgrade.go +++ b/cmd/helm/upgrade.go @@ -139,7 +139,7 @@ func newUpgradeCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { if err != nil { return err } - // validate dry-run flag value is one of the allowed values + // Validate dry-run flag value is one of the allowed values if err := validateDryRunOptionFlag(client.DryRunOption); err != nil { return err } diff --git a/pkg/action/action.go b/pkg/action/action.go index c19a65842..44c85ecd7 100644 --- a/pkg/action/action.go +++ b/pkg/action/action.go @@ -120,11 +120,9 @@ func (cfg *Configuration) renderResources(ch *chart.Chart, values chartutil.Valu var files map[string]string var err2 error - // A `helm template` should not talk to the remote cluster. However, commands - // with the flag `--dry-run-option` with the value of false, none, or sever - // or with the flag `--dry-run` with the value of false should try to interact with the cluster. - // It may break in interesting and exotic ways because other data (e.g. discovery) - // is mocked. + // A `helm template` should not talk to the remote cluster. However, commands with the flag + //`--dry-run` with the value of `false`, `none`, or `server` should try to interact with the cluster. + // It may break in interesting and exotic ways because other data (e.g. discovery) is mocked. if interactWithRemote && cfg.RESTClientGetter != nil { restConfig, err := cfg.RESTClientGetter.ToRESTConfig() if err != nil { diff --git a/pkg/action/install.go b/pkg/action/install.go index f4c0c6695..c09ae5420 100644 --- a/pkg/action/install.go +++ b/pkg/action/install.go @@ -204,13 +204,12 @@ func (i *Install) RunWithContext(ctx context.Context, chrt *chart.Chart, vals ma return nil, err } - // determine dry run behavior + // Determine dry run behavior if i.DryRun || i.DryRunOption == "client" || i.DryRunOption == "server" || i.DryRunOption == "true" { i.DryRun = true } var interactWithRemote bool - // `helm template` is the only command that Install.APIVersions field will not be nil. if !i.DryRun || i.DryRunOption == "server" { interactWithRemote = true } diff --git a/pkg/action/upgrade.go b/pkg/action/upgrade.go index 817486465..2d372f017 100644 --- a/pkg/action/upgrade.go +++ b/pkg/action/upgrade.go @@ -141,7 +141,7 @@ func (u *Upgrade) RunWithContext(ctx context.Context, name string, chart *chart. return nil, errors.Errorf("release name is invalid: %s", name) } - // determine dry run behavior + // Determine dry run behavior if u.DryRun || u.DryRunOption == "client" || u.DryRunOption == "server" || u.DryRunOption == "true" { u.DryRun = true } @@ -239,7 +239,7 @@ func (u *Upgrade) prepareUpgrade(name string, chart *chart.Chart, vals map[strin return nil, nil, err } - // determine whether or not to interact with remote + // Determine whether or not to interact with remote var interactWithRemote bool if !u.DryRun || u.DryRunOption == "server" { interactWithRemote = true