stale-issue-message:'This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.'
// Concurrent `helm upgrade`s will either fail here with `errPending` or when creating the release with "already exists". This should act as a pessimistic lock.
// TemplatesWithSkipSchemaValidation lints the templates in the Linter, allowing to specify the kubernetes version and if schema validation is enabled or not.
// - Not set means no dry run and server is contacted.
// - Set with no value, a value of client, or a value of true and the server is not contacted
// - Set with a value of false, none, or false and the server is contacted
// The true/false part is meant to reflect some legacy behavior while none is equal to "".
f:=cmd.Flags()
f.String(
"dry-run",
"none",
`simulates the operation without persisting changes. Must be one of: "none" (default), "client", or "server". '--dry-run=none' executes the operation normally and persists changes (no simulation). '--dry-run=client' simulates the operation client-side only and avoids cluster connections. '--dry-run=server' simulates the operation on the server, requiring cluster connectivity.`)
f.Lookup("dry-run").NoOptDefVal="unset"
}
// Determine the `action.DryRunStrategy` given -dry-run=<value>` flag (or absence of)
// Legacy usage of the flag: boolean values, and `--dry-run` (without value) are supported, and log warnings emitted
f.BoolVar(&client.CreateNamespace,"create-namespace",false,"create the release namespace if not present")
// --dry-run options with expected outcome:
// - Not set means no dry run and server is contacted.
// - Set with no value, a value of client, or a value of true and the server is not contacted
// - Set with a value of false, none, or false and the server is contacted
// The true/false part is meant to reflect some legacy behavior while none is equal to "".
f.StringVar(&client.DryRunOption,"dry-run","","simulate an install. If --dry-run is set with no option being specified or as '--dry-run=client', it will not attempt cluster connections. Setting '--dry-run=server' allows attempting cluster connections.")
f.Lookup("dry-run").NoOptDefVal="client"
f.BoolVar(&client.ForceReplace,"force-replace",false,"force resource updates by replacement")
// We only return an error if we weren't even able to get the
// release, otherwise we keep going so we can print status and logs
// if requested
ifrunErr!=nil&&rel==nil{
ifrunErr!=nil&&reli==nil{
returnrunErr
}
rel,err:=releaserToV1Release(reli)
iferr!=nil{
returnerr
}
iferr:=outfmt.Write(out,&statusPrinter{
release:rel,
debug:settings.Debug,
showMetadata:false,
hideNotes:client.HideNotes,
hideNotes:true,
noColor:settings.ShouldDisableColor(),
});err!=nil{
returnerr
@ -99,7 +103,6 @@ func newReleaseTestCmd(cfg *action.Configuration, out io.Writer) *cobra.Command
f.DurationVar(&client.Timeout,"timeout",300*time.Second,"time to wait for any individual Kubernetes operation (like Jobs for hooks)")
f.BoolVar(&outputLogs,"logs",false,"dump the logs from test pods (this runs after all tests are complete, but before any cleanup)")
f.StringSliceVar(&filter,"filter",[]string{},"specify tests by attribute (currently \"name\") using attribute=value syntax or '!attribute=value' to exclude a test (can specify multiple or separate values with commas: name=test1,name=test2)")
f.BoolVar(&client.HideNotes,"hide-notes",false,"if set, do not show notes in test output. Does not affect presence in chart metadata")
f.BoolVar(&client.WaitForJobs,"wait-for-jobs",false,"if set and --wait enabled, will wait until all Jobs have been completed before marking the release as successful. It will wait for as long as --timeout")
f.BoolVar(&client.CleanupOnFail,"cleanup-on-fail",false,"allow deletion of new resources created in this rollback when rollback fails")
f.IntVar(&client.MaxHistory,"history-max",settings.MaxHistory,"limit the maximum number of revisions saved per release. Use 0 for no limit")
f.StringArrayVarP(&showFiles,"show-only","s",[]string{},"only show manifests rendered from the given templates")
f.StringVar(&client.OutputDir,"output-dir","","writes the executed templates to files in output-dir instead of stdout")
f.BoolVar(&validate,"validate",false,"validate your manifests against the Kubernetes cluster you are currently pointing at. This is the same validation performed on an install")
f.BoolVar(&includeCrds,"include-crds",false,"include CRDs in the templated output")
f.BoolVar(&skipTests,"skip-tests",false,"skip tests from templated output")
f.BoolVar(&client.IsUpgrade,"is-upgrade",false,"set .Release.IsUpgrade instead of .Release.IsInstall")
f.StringVar(&kubeVersion,"kube-version","","Kubernetes version used for Capabilities.KubeVersion")
f.StringSliceVarP(&extraAPIs,"api-versions","a",[]string{},"Kubernetes api versions used for Capabilities.APIVersions (multiple can be specified)")
f.BoolVar(&client.UseReleaseName,"release-name",false,"use release name in the output-dir path.")
f.String(
"dry-run",
"client",
`simulates the operation either client-side or server-side. Must be either: "client", or "server". '--dry-run=client simulates the operation client-side only and avoids cluster connections. '--dry-run=server' simulates/validates the operation on the server, requiring cluster connectivity.`)
f.BoolVar(&createNamespace,"create-namespace",false,"if --install is set, create the release namespace if not present")
f.BoolVarP(&client.Install,"install","i",false,"if a release by this name doesn't already exist, run an install")
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.StringVar(&client.DryRunOption,"dry-run","","simulate an install. If --dry-run is set with no option being specified or as '--dry-run=client', it will not attempt cluster connections. Setting '--dry-run=server' allows attempting cluster connections.")
f.BoolVar(&client.HideSecret,"hide-secret",false,"hide Kubernetes Secrets when also using the --dry-run flag")
f.Lookup("dry-run").NoOptDefVal="client"
f.BoolVar(&client.ForceReplace,"force-replace",false,"force resource updates by replacement")
f.BoolVar(&client.DependencyUpdate,"dependency-update",false,"update dependencies if they are missing before installing the chart")
f.BoolVar(&client.EnableDNS,"enable-dns",false,"enable DNS lookups when rendering templates")
f.BoolVar(&client.TakeOwnership,"take-ownership",false,"if set, upgrade will ignore the check for helm annotations and take ownership of the existing resources")