Skip to content

Commit

Permalink
Merge pull request #365 from Praqma/update-flags-options
Browse files Browse the repository at this point in the history
deprecate some cmd flags
  • Loading branch information
Sami Alajrami authored Jan 3, 2020
2 parents 630a98c + 00693e6 commit b1c3ae8
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 34 deletions.
23 changes: 10 additions & 13 deletions docs/cmd_reference.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
version: v3.0.0-beta5
version: v3.0.0-beta6
---

# CMD reference
Expand All @@ -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.
Expand Down Expand Up @@ -47,20 +50,20 @@ 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.

`--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.
Expand All @@ -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.

Expand All @@ -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.
18 changes: 8 additions & 10 deletions internal/app/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -87,20 +86,19 @@ 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")
flag.BoolVar(&c.noNs, "no-ns", false, "don't create namespaces")
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
Expand Down Expand Up @@ -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")
}
}
Expand Down
5 changes: 1 addition & 4 deletions internal/app/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -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+" ]")

Expand Down
4 changes: 2 additions & 2 deletions internal/app/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
10 changes: 5 additions & 5 deletions release-notes.md
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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.

0 comments on commit b1c3ae8

Please sign in to comment.