parent
3f6c03999a
commit
279d7dee18
|
|
@ -70,6 +70,7 @@ func NewApplyCmd(globalCfg *config.GlobalImpl) *cobra.Command {
|
|||
f.StringArrayVar(&applyOptions.PostRendererArgs, "post-renderer-args", nil, `pass --post-renderer-args to "helm template" or "helm upgrade --install"`)
|
||||
f.StringVar(&applyOptions.Cascade, "cascade", "", "pass cascade to helm exec, default: background")
|
||||
f.StringArrayVar(&applyOptions.SuppressOutputLineRegex, "suppress-output-line-regex", nil, "a list of regex patterns to suppress output lines from the diff output")
|
||||
f.StringVar(&applyOptions.DryRyn, "dry-run", "", "pass dry-run to helm exec")
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ func NewSyncCmd(globalCfg *config.GlobalImpl) *cobra.Command {
|
|||
f.StringVar(&syncOptions.PostRenderer, "post-renderer", "", `pass --post-renderer to "helm template" or "helm upgrade --install"`)
|
||||
f.StringArrayVar(&syncOptions.PostRendererArgs, "post-renderer-args", nil, `pass --post-renderer-args to "helm template" or "helm upgrade --install"`)
|
||||
f.StringVar(&syncOptions.Cascade, "cascade", "", "pass cascade to helm exec, default: background")
|
||||
f.StringVar(&syncOptions.DryRyn, "dry-run", "", "pass dry-run to helm exec")
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1536,6 +1536,7 @@ Do you really want to apply?
|
|||
PostRenderer: c.PostRenderer(),
|
||||
PostRendererArgs: c.PostRendererArgs(),
|
||||
SyncArgs: c.SyncArgs(),
|
||||
DryRun: c.DryRun(),
|
||||
}
|
||||
return subst.SyncReleases(&affectedReleases, helm, c.Values(), c.Concurrency(), syncOpts)
|
||||
}))
|
||||
|
|
@ -1929,6 +1930,7 @@ Do you really want to sync?
|
|||
PostRenderer: c.PostRenderer(),
|
||||
PostRendererArgs: c.PostRendererArgs(),
|
||||
SyncArgs: c.SyncArgs(),
|
||||
DryRun: c.DryRun(),
|
||||
}
|
||||
return subst.SyncReleases(&affectedReleases, helm, c.Values(), c.Concurrency(), opts)
|
||||
}))
|
||||
|
|
|
|||
|
|
@ -2196,6 +2196,7 @@ func (c configImpl) ShowOnly() []string {
|
|||
type applyConfig struct {
|
||||
args string
|
||||
cascade string
|
||||
dryRun string
|
||||
values []string
|
||||
|
||||
// TODO: Remove this function once Helmfile v0.x
|
||||
|
|
@ -2415,6 +2416,10 @@ func (a applyConfig) ShowOnly() []string {
|
|||
return a.showOnly
|
||||
}
|
||||
|
||||
func (a applyConfig) DryRun() string {
|
||||
return a.dryRun
|
||||
}
|
||||
|
||||
type depsConfig struct {
|
||||
skipRepos bool
|
||||
includeTransitiveNeeds bool
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ type ApplyConfigProvider interface {
|
|||
PostRendererArgs() []string
|
||||
Cascade() string
|
||||
SuppressOutputLineRegex() []string
|
||||
DryRun() string
|
||||
|
||||
Values() []string
|
||||
Set() []string
|
||||
|
|
@ -99,6 +100,7 @@ type SyncConfigProvider interface {
|
|||
PostRenderer() string
|
||||
PostRendererArgs() []string
|
||||
Cascade() string
|
||||
DryRun() string
|
||||
|
||||
Values() []string
|
||||
Set() []string
|
||||
|
|
|
|||
|
|
@ -66,6 +66,8 @@ type ApplyOptions struct {
|
|||
SuppressOutputLineRegex []string
|
||||
// SyncArgs is the list of arguments to pass to helm upgrade.
|
||||
SyncArgs string
|
||||
// DryRun is for helm dry-run flag
|
||||
DryRyn string
|
||||
}
|
||||
|
||||
// NewApply creates a new Apply
|
||||
|
|
@ -247,3 +249,8 @@ func (a *ApplyImpl) SuppressOutputLineRegex() []string {
|
|||
func (a *ApplyImpl) SyncArgs() string {
|
||||
return a.ApplyOptions.SyncArgs
|
||||
}
|
||||
|
||||
// DryRun returns dry-run flag
|
||||
func (a *ApplyImpl) DryRun() string {
|
||||
return a.ApplyOptions.DryRyn
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,6 +34,8 @@ type SyncOptions struct {
|
|||
Cascade string
|
||||
// SyncArgs is the list of arguments to pass to the helm upgrade command.
|
||||
SyncArgs string
|
||||
// DryRun is for helm dry-run flag
|
||||
DryRyn string
|
||||
}
|
||||
|
||||
// NewSyncOptions creates a new Apply
|
||||
|
|
@ -139,3 +141,8 @@ func (t *SyncImpl) Cascade() string {
|
|||
func (t *SyncImpl) SyncArgs() string {
|
||||
return t.SyncOptions.SyncArgs
|
||||
}
|
||||
|
||||
// DryRun returns dry-run flag
|
||||
func (t *SyncImpl) DryRun() string {
|
||||
return t.SyncOptions.DryRyn
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,6 +100,12 @@ func (st *HelmState) appendWaitFlags(flags []string, release *ReleaseSpec, ops *
|
|||
}
|
||||
return flags
|
||||
}
|
||||
func (st *HelmState) appendDryRunFlags(flags []string, opt *SyncOpts) []string {
|
||||
if opt != nil && opt.DryRun != "" {
|
||||
flags = append(flags, "--dry-run", opt.DryRun)
|
||||
}
|
||||
return flags
|
||||
}
|
||||
|
||||
// append post-renderer flags to helm flags
|
||||
func (st *HelmState) appendCascadeFlags(flags []string, helm helmexec.Interface, release *ReleaseSpec, cascade string) []string {
|
||||
|
|
|
|||
|
|
@ -753,6 +753,7 @@ type SyncOpts struct {
|
|||
PostRenderer string
|
||||
PostRendererArgs []string
|
||||
SyncArgs string
|
||||
DryRun string
|
||||
}
|
||||
|
||||
type SyncOpt interface{ Apply(*SyncOpts) }
|
||||
|
|
@ -2672,6 +2673,7 @@ func (st *HelmState) flagsForUpgrade(helm helmexec.Interface, release *ReleaseSp
|
|||
postRendererArgs = opt.PostRendererArgs
|
||||
}
|
||||
flags = st.appendPostRenderArgsFlags(flags, release, postRendererArgs)
|
||||
flags = st.appendDryRunFlags(flags, opt)
|
||||
|
||||
flags = st.appendExtraSyncFlags(flags, opt)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue