move interactive option to global (#370)
Fixes #366 Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
parent
7d88370310
commit
18eee1fa47
|
|
@ -54,7 +54,6 @@ func NewApplyCmd(globalCfg *config.GlobalImpl) *cobra.Command {
|
|||
f.BoolVar(&applyOptions.NoHooks, "no-hooks", false, "do not diff changes made by hooks.")
|
||||
f.BoolVar(&applyOptions.SuppressDiff, "suppress-diff", false, "suppress diff in the output. Usable in new installs")
|
||||
f.BoolVar(&applyOptions.SkipDeps, "skip-deps", false, `skip running "helm repo update" and "helm dependency build"`)
|
||||
f.BoolVarP(&applyOptions.Interactive, "interactive", "i", false, "Request confirmation before attempting to modify clusters")
|
||||
f.BoolVar(&applyOptions.Wait, "wait", false, `Override helmDefaults.wait setting "helm upgrade --install --wait"`)
|
||||
f.BoolVar(&applyOptions.WaitForJobs, "wait-for-jobs", false, `Override helmDefaults.waitForJobs setting "helm upgrade --install --wait-for-jobs"`)
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ func NewDeleteCmd(globalCfg *config.GlobalImpl) *cobra.Command {
|
|||
f.IntVar(&deleteOptions.Concurrency, "concurrency", 0, "maximum number of concurrent helm processes to run, 0 is unlimited")
|
||||
f.BoolVar(&deleteOptions.Purge, "purge", false, "purge releases i.e. free release names and histories")
|
||||
f.BoolVar(&deleteOptions.SkipDeps, "skip-deps", false, `skip running "helm repo update" and "helm dependency build"`)
|
||||
f.BoolVarP(&deleteOptions.Interactive, "interactive", "i", false, "Request confirmation before attempting to modify clusters")
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@ func NewDestroyCmd(globalCfg *config.GlobalImpl) *cobra.Command {
|
|||
f.StringVar(&destroyOptions.Args, "args", "", "pass args to helm exec")
|
||||
f.IntVar(&destroyOptions.Concurrency, "concurrency", 0, "maximum number of concurrent helm processes to run, 0 is unlimited")
|
||||
f.BoolVar(&destroyOptions.SkipDeps, "skip-deps", false, `skip running "helm repo update" and "helm dependency build"`)
|
||||
f.BoolVarP(&destroyOptions.Interactive, "interactive", "i", false, "Request confirmation before attempting to modify clusters")
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,6 +116,7 @@ The name of a release can be used as a label: "--selector name=myrelease"`)
|
|||
fs.BoolVar(&globalOptions.AllowNoMatchingRelease, "allow-no-matching-release", false, `Do not exit with an error code if the provided selector has no matching releases.`)
|
||||
fs.BoolVar(&globalOptions.EnableLiveOutput, "enable-live-output", globalOptions.EnableLiveOutput, `Show live output from the Helm binary Stdout/Stderr into Helmfile own Stdout/Stderr.
|
||||
It only applies for the Helm CLI commands, Stdout/Stderr for Hooks are still displayed only when it's execution finishes.`)
|
||||
fs.BoolVarP(&globalOptions.Interactive, "interactive", "i", false, "Request confirmation before attempting to modify clusters")
|
||||
// avoid 'pflag: help requested' error (#251)
|
||||
fs.BoolP("help", "h", false, "help for helmfile")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ func NewSyncCmd(globalCfg *config.GlobalImpl) *cobra.Command {
|
|||
f.BoolVar(&syncOptions.SkipDeps, "skip-deps", false, `skip running "helm repo update" and "helm dependency build"`)
|
||||
f.BoolVar(&syncOptions.Wait, "wait", false, `Override helmDefaults.wait setting "helm upgrade --install --wait"`)
|
||||
f.BoolVar(&syncOptions.WaitForJobs, "wait-for-jobs", false, `Override helmDefaults.waitForJobs setting "helm upgrade --install --wait-for-jobs"`)
|
||||
f.BoolVarP(&syncOptions.Interactive, "interactive", "i", false, "Request confirmation before attempting to modify clusters")
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,8 +52,6 @@ type ApplyOptions struct {
|
|||
Wait bool
|
||||
// WaitForJobs is true if the helm command should wait for the jobs to be completed
|
||||
WaitForJobs bool
|
||||
// Interactive is true if the user should be prompted for input.
|
||||
Interactive bool
|
||||
}
|
||||
|
||||
// NewApply creates a new Apply
|
||||
|
|
@ -204,8 +202,3 @@ func (a *ApplyImpl) Wait() bool {
|
|||
func (a *ApplyImpl) WaitForJobs() bool {
|
||||
return a.ApplyOptions.WaitForJobs
|
||||
}
|
||||
|
||||
// Interactive returns the Interactive.
|
||||
func (a *ApplyImpl) Interactive() bool {
|
||||
return a.ApplyOptions.Interactive
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,8 +10,6 @@ type DeleteOptions struct {
|
|||
Purge bool
|
||||
// SkipDeps is the skip deps flag
|
||||
SkipDeps bool
|
||||
// Interactive is true if the user should be prompted for input.
|
||||
Interactive bool
|
||||
}
|
||||
|
||||
// NewDeleteOptions creates a new Apply
|
||||
|
|
@ -52,8 +50,3 @@ func (c *DeleteImpl) Purge() bool {
|
|||
func (c *DeleteImpl) SkipDeps() bool {
|
||||
return c.DeleteOptions.SkipDeps
|
||||
}
|
||||
|
||||
// Interactive returns the Interactive
|
||||
func (c *DeleteImpl) Interactive() bool {
|
||||
return c.DeleteOptions.Interactive
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,8 +8,6 @@ type DestroyOptions struct {
|
|||
Concurrency int
|
||||
// SkipDeps is the skip deps flag
|
||||
SkipDeps bool
|
||||
// Interactive is true if the user should be prompted for input.
|
||||
Interactive bool
|
||||
}
|
||||
|
||||
// NewDestroyOptions creates a new Apply
|
||||
|
|
@ -45,8 +43,3 @@ func (c *DestroyImpl) Args() string {
|
|||
func (c *DestroyImpl) SkipDeps() bool {
|
||||
return c.DestroyOptions.SkipDeps
|
||||
}
|
||||
|
||||
// Interactive returns the Interactive
|
||||
func (c *DestroyImpl) Interactive() bool {
|
||||
return c.DestroyOptions.Interactive
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,6 +46,8 @@ type GlobalOptions struct {
|
|||
logger *zap.SugaredLogger
|
||||
// EnableLiveOutput enables live output from the Helm binary stdout/stderr into Helmfile own stdout/stderr
|
||||
EnableLiveOutput bool
|
||||
// Interactive is true if the user should be prompted for input.
|
||||
Interactive bool
|
||||
}
|
||||
|
||||
// Logger returns the logger to use.
|
||||
|
|
@ -179,3 +181,8 @@ func (g *GlobalImpl) ValidateConfig() error {
|
|||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Interactive returns the Interactive
|
||||
func (g *GlobalImpl) Interactive() bool {
|
||||
return g.GlobalOptions.Interactive
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,8 +26,6 @@ type SyncOptions struct {
|
|||
Wait bool
|
||||
// WaitForJobs is the wait for jobs flag
|
||||
WaitForJobs bool
|
||||
// Interactive is true if the user should be prompted for input.
|
||||
Interactive bool
|
||||
}
|
||||
|
||||
// NewSyncOptions creates a new Apply
|
||||
|
|
@ -112,8 +110,3 @@ func (t *SyncImpl) Wait() bool {
|
|||
func (t *SyncImpl) WaitForJobs() bool {
|
||||
return t.SyncOptions.WaitForJobs
|
||||
}
|
||||
|
||||
// Interactive returns the Interactive
|
||||
func (t *SyncImpl) Interactive() bool {
|
||||
return t.SyncOptions.Interactive
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue