f.VarP(&inst.valueFiles,"values","f","specify values in a YAML file or a URL(can specify multiple)")
f.StringVarP(&inst.name,"name","","","release name. If unspecified, it will autogenerate one for you")
f.BoolVar(&inst.dryRun,"dry-run",false,"simulate an install")
f.BoolVar(&inst.disableHooks,"no-hooks",false,"prevent hooks from running during install")
f.BoolVar(&inst.replace,"replace",false,"re-use the given name, even if that name is already used. This is unsafe in production")
f.StringArrayVar(&inst.values,"set",[]string{},"set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)")
f.StringArrayVar(&inst.stringValues,"set-string",[]string{},"set STRING values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)")
f.StringVar(&inst.nameTemplate,"name-template","","specify template used to name the release")
f.BoolVar(&inst.verify,"verify",false,"verify the package before installing it")
f.StringVar(&inst.keyring,"keyring",defaultKeyring(),"location of public keys used for verification")
f.StringVar(&inst.version,"version","","specify the exact chart version to install. If this is not specified, the latest version is installed")
f.Int64Var(&inst.timeout,"timeout",300,"time in seconds to wait for any individual Kubernetes operation (like Jobs for hooks)")
f.BoolVar(&inst.wait,"wait",false,"if set, will wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment are in a ready state before marking the release as successful. It will wait for as long as --timeout")
f.StringVar(&inst.repoURL,"repo","","chart repository url where to locate the requested chart")
f.StringVar(&inst.username,"username","","chart repository username where to locate the requested chart")
f.StringVar(&inst.password,"password","","chart repository password where to locate the requested chart")
f.StringVar(&inst.certFile,"cert-file","","identify HTTPS client using this SSL certificate file")
f.StringVar(&inst.keyFile,"key-file","","identify HTTPS client using this SSL key file")
f.StringVar(&inst.caFile,"ca-file","","verify certificates of HTTPS-enabled servers using this CA bundle")
f.BoolVar(&inst.devel,"devel",false,"use development versions, too. Equivalent to version '>0.0.0-0'. If --version is set, this is ignored.")
f.BoolVar(&inst.depUp,"dep-up",false,"run helm dependency update before installing the chart")
f.VarP(&o.valueFiles,"values","f","specify values in a YAML file or a URL(can specify multiple)")
f.StringVarP(&o.name,"name","","","release name. If unspecified, it will autogenerate one for you")
f.BoolVar(&o.dryRun,"dry-run",false,"simulate an install")
f.BoolVar(&o.disableHooks,"no-hooks",false,"prevent hooks from running during install")
f.BoolVar(&o.replace,"replace",false,"re-use the given name, even if that name is already used. This is unsafe in production")
f.StringArrayVar(&o.values,"set",[]string{},"set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)")
f.StringArrayVar(&o.stringValues,"set-string",[]string{},"set STRING values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)")
f.StringVar(&o.nameTemplate,"name-template","","specify template used to name the release")
f.BoolVar(&o.verify,"verify",false,"verify the package before installing it")
f.StringVar(&o.keyring,"keyring",defaultKeyring(),"location of public keys used for verification")
f.StringVar(&o.version,"version","","specify the exact chart version to install. If this is not specified, the latest version is installed")
f.Int64Var(&o.timeout,"timeout",300,"time in seconds to wait for any individual Kubernetes operation (like Jobs for hooks)")
f.BoolVar(&o.wait,"wait",false,"if set, will wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment are in a ready state before marking the release as successful. It will wait for as long as --timeout")
f.StringVar(&o.repoURL,"repo","","chart repository url where to locate the requested chart")
f.StringVar(&o.username,"username","","chart repository username where to locate the requested chart")
f.StringVar(&o.password,"password","","chart repository password where to locate the requested chart")
f.StringVar(&o.certFile,"cert-file","","identify HTTPS client using this SSL certificate file")
f.StringVar(&o.keyFile,"key-file","","identify HTTPS client using this SSL key file")
f.StringVar(&o.caFile,"ca-file","","verify certificates of HTTPS-enabled servers using this CA bundle")
f.BoolVar(&o.devel,"devel",false,"use development versions, too. Equivalent to version '>0.0.0-0'. If --version is set, this is ignored.")
f.BoolVar(&o.depUp,"dep-up",false,"run helm dependency update before installing the chart")
cmd.Flags().VarP(&l.valueFiles,"values","f","specify values in a YAML file (can specify multiple)")
cmd.Flags().StringArrayVar(&l.values,"set",[]string{},"set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)")
cmd.Flags().StringArrayVar(&l.sValues,"set-string",[]string{},"set STRING values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)")
cmd.Flags().BoolVar(&l.strict,"strict",false,"fail on lint warnings")
cmd.Flags().VarP(&o.valueFiles,"values","f","specify values in a YAML file (can specify multiple)")
cmd.Flags().StringArrayVar(&o.values,"set",[]string{},"set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)")
cmd.Flags().StringArrayVar(&o.sValues,"set-string",[]string{},"set STRING values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)")
cmd.Flags().BoolVar(&o.strict,"strict",false,"fail on lint warnings")
returncmd
}
varerrLintNoChart=errors.New("No chart found for linting (missing Chart.yaml)")
f.VarP(&pkg.valueFiles,"values","f","specify values in a YAML file or a URL(can specify multiple)")
f.StringArrayVar(&pkg.values,"set",[]string{},"set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)")
f.StringArrayVar(&pkg.stringValues,"set-string",[]string{},"set STRING values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)")
f.BoolVar(&pkg.sign,"sign",false,"use a PGP private key to sign this package")
f.StringVar(&pkg.key,"key","","name of the key to use when signing. Used if --sign is true")
f.StringVar(&pkg.keyring,"keyring",defaultKeyring(),"location of a public keyring")
f.StringVar(&pkg.version,"version","","set the version on the chart to this semver version")
f.StringVar(&pkg.appVersion,"app-version","","set the appVersion on the chart to this version")
f.StringVarP(&pkg.destination,"destination","d",".","location to write the chart.")
f.BoolVarP(&pkg.dependencyUpdate,"dependency-update","u",false,`update dependencies from "requirements.yaml" to dir "charts/" before packaging`)
f.VarP(&o.valueFiles,"values","f","specify values in a YAML file or a URL(can specify multiple)")
f.StringArrayVar(&o.values,"set",[]string{},"set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)")
f.StringArrayVar(&o.stringValues,"set-string",[]string{},"set STRING values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)")
f.BoolVar(&o.sign,"sign",false,"use a PGP private key to sign this package")
f.StringVar(&o.key,"key","","name of the key to use when signing. Used if --sign is true")
f.StringVar(&o.keyring,"keyring",defaultKeyring(),"location of a public keyring")
f.StringVar(&o.version,"version","","set the version on the chart to this semver version")
f.StringVar(&o.appVersion,"app-version","","set the appVersion on the chart to this version")
f.StringVarP(&o.destination,"destination","d",".","location to write the chart.")
f.BoolVarP(&o.dependencyUpdate,"dependency-update","u",false,`update dependencies from "requirements.yaml" to dir "charts/" before packaging`)
f.BoolVar(&rollback.dryRun,"dry-run",false,"simulate a rollback")
f.BoolVar(&rollback.recreate,"recreate-pods",false,"performs pods restart for the resource if applicable")
f.BoolVar(&rollback.force,"force",false,"force resource update through delete/recreate if needed")
f.BoolVar(&rollback.disableHooks,"no-hooks",false,"prevent hooks from running during rollback")
f.Int64Var(&rollback.timeout,"timeout",300,"time in seconds to wait for any individual Kubernetes operation (like Jobs for hooks)")
f.BoolVar(&rollback.wait,"wait",false,"if set, will wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment are in a ready state before marking the release as successful. It will wait for as long as --timeout")
f.BoolVar(&o.dryRun,"dry-run",false,"simulate a rollback")
f.BoolVar(&o.recreate,"recreate-pods",false,"performs pods restart for the resource if applicable")
f.BoolVar(&o.force,"force",false,"force resource update through delete/recreate if needed")
f.BoolVar(&o.disableHooks,"no-hooks",false,"prevent hooks from running during rollback")
f.Int64Var(&o.timeout,"timeout",300,"time in seconds to wait for any individual Kubernetes operation (like Jobs for hooks)")
f.BoolVar(&o.wait,"wait",false,"if set, will wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment are in a ready state before marking the release as successful. It will wait for as long as --timeout")
f.StringArrayVarP(&t.renderFiles,"execute","x",[]string{},"only execute the given templates")
f.VarP(&t.valueFiles,"values","f","specify values in a YAML file (can specify multiple)")
f.StringArrayVar(&t.values,"set",[]string{},"set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)")
f.StringArrayVar(&t.stringValues,"set-string",[]string{},"set STRING values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)")
f.StringVar(&t.nameTemplate,"name-template","","specify template used to name the release")
f.StringVar(&t.kubeVersion,"kube-version",defaultKubeVersion,"kubernetes version used as Capabilities.KubeVersion.Major/Minor")
f.StringVar(&t.outputDir,"output-dir","","writes the executed templates to files in output-dir instead of stdout")
f.BoolVar(&o.showNotes,"notes",false,"show the computed NOTES.txt file as well")
f.StringArrayVarP(&o.renderFiles,"execute","x",[]string{},"only execute the given templates")
f.VarP(&o.valueFiles,"values","f","specify values in a YAML file (can specify multiple)")
f.StringArrayVar(&o.values,"set",[]string{},"set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)")
f.StringArrayVar(&o.stringValues,"set-string",[]string{},"set STRING values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)")
f.StringVar(&o.nameTemplate,"name-template","","specify template used to name the release")
f.StringVar(&o.kubeVersion,"kube-version",defaultKubeVersion,"kubernetes version used as Capabilities.KubeVersion.Major/Minor")
f.StringVar(&o.outputDir,"output-dir","","writes the executed templates to files in output-dir instead of stdout")
returncmd
}
func(t *templateCmd)run(outio.Writer)error{
func(o *templateOptions)run(outio.Writer)error{
// verify specified templates exist relative to chart
rf:=[]string{}
varafstring
varerrerror
iflen(t.renderFiles)>0{
for_,f:=ranget.renderFiles{
iflen(o.renderFiles)>0{
for_,f:=rangeo.renderFiles{
if!filepath.IsAbs(f){
af,err=filepath.Abs(filepath.Join(t.chartPath,f))
af,err=filepath.Abs(filepath.Join(o.chartPath,f))
iferr!=nil{
returnfmt.Errorf("could not resolve template path: %s",err)
f.VarP(&upgrade.valueFiles,"values","f","specify values in a YAML file or a URL(can specify multiple)")
f.BoolVar(&upgrade.dryRun,"dry-run",false,"simulate an upgrade")
f.BoolVar(&upgrade.recreate,"recreate-pods",false,"performs pods restart for the resource if applicable")
f.BoolVar(&upgrade.force,"force",false,"force resource update through delete/recreate if needed")
f.StringArrayVar(&upgrade.values,"set",[]string{},"set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)")
f.StringArrayVar(&upgrade.stringValues,"set-string",[]string{},"set STRING values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)")
f.BoolVar(&upgrade.disableHooks,"disable-hooks",false,"disable pre/post upgrade hooks. DEPRECATED. Use no-hooks")
f.BoolVar(&upgrade.verify,"verify",false,"verify the provenance of the chart before upgrading")
f.StringVar(&upgrade.keyring,"keyring",defaultKeyring(),"path to the keyring that contains public signing keys")
f.BoolVarP(&upgrade.install,"install","i",false,"if a release by this name doesn't already exist, run an install")
f.StringVar(&upgrade.version,"version","","specify the exact chart version to use. If this is not specified, the latest version is used")
f.Int64Var(&upgrade.timeout,"timeout",300,"time in seconds to wait for any individual Kubernetes operation (like Jobs for hooks)")
f.BoolVar(&upgrade.resetValues,"reset-values",false,"when upgrading, reset the values to the ones built into the chart")
f.BoolVar(&upgrade.reuseValues,"reuse-values",false,"when upgrading, reuse the last release's values and merge in any overrides from the command line via --set and -f. If '--reset-values' is specified, this is ignored.")
f.BoolVar(&upgrade.wait,"wait",false,"if set, will wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment are in a ready state before marking the release as successful. It will wait for as long as --timeout")
f.StringVar(&upgrade.repoURL,"repo","","chart repository url where to locate the requested chart")
f.StringVar(&upgrade.username,"username","","chart repository username where to locate the requested chart")
f.StringVar(&upgrade.password,"password","","chart repository password where to locate the requested chart")
f.StringVar(&upgrade.certFile,"cert-file","","identify HTTPS client using this SSL certificate file")
f.StringVar(&upgrade.keyFile,"key-file","","identify HTTPS client using this SSL key file")
f.StringVar(&upgrade.caFile,"ca-file","","verify certificates of HTTPS-enabled servers using this CA bundle")
f.BoolVar(&upgrade.devel,"devel",false,"use development versions, too. Equivalent to version '>0.0.0-0'. If --version is set, this is ignored.")
f.VarP(&o.valueFiles,"values","f","specify values in a YAML file or a URL(can specify multiple)")
f.BoolVar(&o.dryRun,"dry-run",false,"simulate an upgrade")
f.BoolVar(&o.recreate,"recreate-pods",false,"performs pods restart for the resource if applicable")
f.BoolVar(&o.force,"force",false,"force resource update through delete/recreate if needed")
f.StringArrayVar(&o.values,"set",[]string{},"set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)")
f.StringArrayVar(&o.stringValues,"set-string",[]string{},"set STRING values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)")
f.BoolVar(&o.disableHooks,"disable-hooks",false,"disable pre/post upgrade hooks. DEPRECATED. Use no-hooks")
f.BoolVar(&o.verify,"verify",false,"verify the provenance of the chart before upgrading")
f.StringVar(&o.keyring,"keyring",defaultKeyring(),"path to the keyring that contains public signing keys")
f.BoolVarP(&o.install,"install","i",false,"if a release by this name doesn't already exist, run an install")
f.StringVar(&o.version,"version","","specify the exact chart version to use. If this is not specified, the latest version is used")
f.Int64Var(&o.timeout,"timeout",300,"time in seconds to wait for any individual Kubernetes operation (like Jobs for hooks)")
f.BoolVar(&o.resetValues,"reset-values",false,"when upgrading, reset the values to the ones built into the chart")
f.BoolVar(&o.reuseValues,"reuse-values",false,"when upgrading, reuse the last release's values and merge in any overrides from the command line via --set and -f. If '--reset-values' is specified, this is ignored.")
f.BoolVar(&o.wait,"wait",false,"if set, will wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment are in a ready state before marking the release as successful. It will wait for as long as --timeout")
f.StringVar(&o.repoURL,"repo","","chart repository url where to locate the requested chart")
f.StringVar(&o.username,"username","","chart repository username where to locate the requested chart")
f.StringVar(&o.password,"password","","chart repository password where to locate the requested chart")
f.StringVar(&o.certFile,"cert-file","","identify HTTPS client using this SSL certificate file")
f.StringVar(&o.keyFile,"key-file","","identify HTTPS client using this SSL key file")
f.StringVar(&o.caFile,"ca-file","","verify certificates of HTTPS-enabled servers using this CA bundle")
f.BoolVar(&o.devel,"devel",false,"use development versions, too. Equivalent to version '>0.0.0-0'. If --version is set, this is ignored.")