diff --git a/docs/cmd_reference.md b/docs/cmd_reference.md index 955fdc6b..f301b23d 100644 --- a/docs/cmd_reference.md +++ b/docs/cmd_reference.md @@ -1,5 +1,5 @@ --- -version: v3.0.0-beta5 +version: v3.0.0-beta6 --- # CMD reference @@ -12,7 +12,10 @@ This lists available CMD options in Helmsman: apply the plan directly. `--debug` - show execution logs. + show the debug execution logs and actual helm/kubectl commands. This can log secrets and should only be used for debugging purposes. + + `--verbose` + show verbose execution logs. `--destroy` delete all deployed releases. @@ -47,8 +50,8 @@ This lists available CMD options in Helmsman: `--no-env-subst` turn off environment substitution globally. - `--no-env-values-subst` - turn off environment substitution in values files only. (default true). + `--subst-env-values` + turn on environment substitution in values files. `--no-fancy` don't display the banner and don't use colors. @@ -56,11 +59,11 @@ This lists available CMD options in Helmsman: `--no-ns` don't create namespaces. - `-no-ssm-subst` + `--no-ssm-subst` turn off SSM parameter substitution globally. - `-no-ssm-values-subst` - turn off SSM parameter substitution in values files only (default true). + `--subst-ssm-values` + turn on SSM parameter substitution in values files. `--ns-override string` override defined namespaces with this one. @@ -71,9 +74,6 @@ This lists available CMD options in Helmsman: `--skip-validation` skip desired state validation. - `--suppress-diff-secrets` - don't show secrets in helm diff output. (default true). - `--target` limit execution to specific app. @@ -84,6 +84,3 @@ This lists available CMD options in Helmsman: run 'helm dep up' for local chart `--v` show the version. - - `--verbose` - show verbose execution logs. diff --git a/internal/app/cli.go b/internal/app/cli.go index 46749355..e372c572 100644 --- a/internal/app/cli.go +++ b/internal/app/cli.go @@ -53,12 +53,11 @@ type cli struct { skipValidation bool keepUntrackedReleases bool showDiff bool - suppressDiffSecrets bool diffContext int noEnvSubst bool - noEnvValuesSubst bool + substEnvValues bool noSSMSubst bool - noSSMValuesSubst bool + substSSMValues bool updateDeps bool forceUpgrades bool version bool @@ -87,8 +86,8 @@ func (c *cli) parse() { flag.BoolVar(&c.dryRun, "dry-run", false, "apply the dry-run option for helm commands.") flag.BoolVar(&c.destroy, "destroy", false, "delete all deployed releases.") flag.BoolVar(&c.version, "v", false, "show the version") - flag.BoolVar(&c.debug, "debug", false, "show the execution logs") - flag.BoolVar(&c.verbose, "verbose", false, "show verbose execution logs") + flag.BoolVar(&c.debug, "debug", false, "show the debug execution logs and actual helm/kubectl commands. This can log secrets and should only be used for debugging purposes.") + flag.BoolVar(&c.verbose, "verbose", false, "show verbose execution logs.") flag.BoolVar(&c.noBanner, "no-banner", false, "don't show the banner") flag.BoolVar(&c.noColors, "no-color", false, "don't use colors") flag.BoolVar(&c.noFancy, "no-fancy", false, "don't display the banner and don't use colors") @@ -96,11 +95,10 @@ func (c *cli) parse() { flag.BoolVar(&c.skipValidation, "skip-validation", false, "skip desired state validation") flag.BoolVar(&c.keepUntrackedReleases, "keep-untracked-releases", false, "keep releases that are managed by Helmsman from the used DSFs in the command, and are no longer tracked in your desired state.") flag.BoolVar(&c.showDiff, "show-diff", false, "show helm diff results. Can expose sensitive information.") - flag.BoolVar(&c.suppressDiffSecrets, "suppress-diff-secrets", true, "don't show secrets in helm diff output. (default true).") flag.BoolVar(&c.noEnvSubst, "no-env-subst", false, "turn off environment substitution globally") - flag.BoolVar(&c.noEnvValuesSubst, "no-env-values-subst", true, "turn off environment substitution in values files only. (default true).") + flag.BoolVar(&c.substEnvValues, "subst-env-values", false, "turn on environment substitution in values files.") flag.BoolVar(&c.noSSMSubst, "no-ssm-subst", false, "turn off SSM parameter substitution globally") - flag.BoolVar(&c.noSSMValuesSubst, "no-ssm-values-subst", true, "turn off SSM parameter substitution in values files only") + flag.BoolVar(&c.substSSMValues, "subst-ssm-values", false, "turn on SSM parameter substitution in values files.") flag.BoolVar(&c.updateDeps, "update-deps", false, "run 'helm dep up' for local chart") flag.BoolVar(&c.forceUpgrades, "force-upgrades", false, "use --force when upgrading helm releases. May cause resources to be recreated.") flag.Usage = printUsage @@ -172,13 +170,13 @@ func (c *cli) parse() { if !c.noEnvSubst { log.Verbose("Substitution of env variables enabled") - if !c.noEnvValuesSubst { + if c.substEnvValues { log.Verbose("Substitution of env variables in values enabled") } } if !c.noSSMSubst { log.Verbose("Substitution of SSM variables enabled") - if !c.noSSMValuesSubst { + if c.substSSMValues { log.Verbose("Substitution of SSM variables in values enabled") } } diff --git a/internal/app/release.go b/internal/app/release.go index 6a30d2af..f926b26e 100644 --- a/internal/app/release.go +++ b/internal/app/release.go @@ -262,16 +262,13 @@ func (r *release) uninstall(p *plan) { func (r *release) diff() string { colorFlag := "" diffContextFlag := []string{} - suppressDiffSecretsFlag := "" + suppressDiffSecretsFlag := "--suppress-secrets" if flags.noColors { colorFlag = "--no-color" } if flags.diffContext != -1 { diffContextFlag = []string{"--context", strconv.Itoa(flags.diffContext)} } - if flags.suppressDiffSecrets { - suppressDiffSecretsFlag = "--suppress-secrets" - } cmd := helmCmd(concat([]string{"diff", colorFlag, suppressDiffSecretsFlag}, diffContextFlag, r.getHelmArgsFor("upgrade")), "Diffing release [ "+r.Name+" ] in namespace [ "+r.Namespace+" ]") diff --git a/internal/app/utils.go b/internal/app/utils.go index e4d79b2b..4b78d058 100644 --- a/internal/app/utils.go +++ b/internal/app/utils.go @@ -166,10 +166,10 @@ func substituteVarsInYaml(file string) string { } yamlFile := string(rawYamlFile) - if !flags.noEnvSubst && !flags.noEnvValuesSubst { + if !flags.noEnvSubst && flags.substEnvValues { yamlFile = substituteEnv(yamlFile) } - if !flags.noSSMSubst && !flags.noSSMValuesSubst { + if !flags.noSSMSubst && flags.substSSMValues { yamlFile = substituteSSM(yamlFile) } diff --git a/release-notes.md b/release-notes.md index 771f5faf..6e2fc6fd 100644 --- a/release-notes.md +++ b/release-notes.md @@ -1,4 +1,4 @@ -# v3.0.0-beta5 +# v3.0.0-beta6 This is a major release to support Helm v3. It is recommended you read the [Helm 3 migration guide](https://helm.sh/docs/topics/v2_v3_migration/) before using this release. @@ -8,13 +8,13 @@ It is recommended you read the [Helm 3 migration guide](https://helm.sh/docs/top The following are the most important changes: - A new and improved logger. - Restructuring the code. -- Parallelized decision making +- Parallelized decision making. - Introducing the `context` stanza to define a context for each DSF. More details [here](docs/misc/merge_desired_state_files). - Deprecating all the DSF stanzas related to Tiller. - Deprecating the `purge` option for releases. - The default value for `storageBackend` is now `secret`. - The `stable` and `incubator` repos are no longer added by default and the `--no-default-repos` flag is deprecated. -- The `--suppress-diff-secrets` cmd flag is enabled by default. -- The `--no-env-values-subst` cmd flag is enabled by default. -- The `--no-ssm-values-subst` cmd flag is enabled by default. +- The `--suppress-diff-secrets` is deprecated. Diff secrets are suppressed by default. +- The `--no-env-values-subst` cmd flag is deprecated. Env vars substitution in values files is disabled by default. `--subst-env-values` is introduced to enable it when needed. +- The `--no-ssm-values-subst` cmd flag is deprecated. SSM vars substitution in values files is disabled by default. `--subst-ssm-values` is introduced to enable it when needed.