feat: mark deprecated args and cmd for v1 (#628)

* feat: mark deprecated args and cmd for v1

Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
yxxhero
2023-01-14 23:43:05 +08:00
committed by GitHub
parent db5c2a52d6
commit 8d96bbb0e4
16 changed files with 65 additions and 25 deletions
+4
View File
@@ -132,6 +132,7 @@ func (a *App) Repos(c ReposConfigProvider) error {
}, c.IncludeTransitiveNeeds(), SetFilter(true))
}
// TODO: Remove this function once Helmfile v0.x
func (a *App) DeprecatedSyncCharts(c DeprecatedChartsConfigProvider) error {
return a.ForEachState(func(run *Run) (_ bool, errs []error) {
err := run.withPreparedCharts("charts", state.ChartPrepareOptions{
@@ -457,6 +458,7 @@ func (a *App) Status(c StatusesConfigProvider) error {
}, false, SetFilter(true))
}
// TODO: Remove this function once Helmfile v0.x
func (a *App) Delete(c DeleteConfigProvider) error {
return a.ForEachState(func(run *Run) (ok bool, errs []error) {
err := run.withPreparedCharts("delete", state.ChartPrepareOptions{
@@ -1166,6 +1168,8 @@ func (a *App) findDesiredStateFiles(specifiedPath string, opts LoadOpts) ([]stri
var defaultFile string
if a.fs.FileExistsAt(DefaultHelmfile) {
defaultFile = DefaultHelmfile
// TODO: Remove this function once Helmfile v0.x
} else if a.fs.FileExistsAt(DeprecatedHelmfile) {
log.Printf(
"warn: %s is being loaded: %s is deprecated in favor of %s. See https://github.com/roboll/helmfile/issues/25 for more information",
+7 -3
View File
@@ -2310,9 +2310,12 @@ func (c configImpl) PostRenderer() string {
}
type applyConfig struct {
args string
values []string
retainValuesFiles bool
args string
values []string
// TODO: Remove this function once Helmfile v0.x
retainValuesFiles bool
set []string
validate bool
skipCleanup bool
@@ -2450,6 +2453,7 @@ func (a applyConfig) Logger() *zap.SugaredLogger {
return a.logger
}
// TODO: Remove this function once Helmfile v0.x
func (a applyConfig) RetainValuesFiles() bool {
return a.retainValuesFiles
}
+4
View File
@@ -19,6 +19,7 @@ type ConfigProvider interface {
loggingConfig
}
// TODO: Remove this function once Helmfile v0.x
type DeprecatedChartsConfigProvider interface {
Values() []string
@@ -66,7 +67,9 @@ type ApplyConfigProvider interface {
Context() int
DiffOutput() string
// TODO: Remove this function once Helmfile v0.x
RetainValuesFiles() bool
Validate() bool
SkipCleanup() bool
SkipDiffOnInstall() bool
@@ -133,6 +136,7 @@ type DiffConfigProvider interface {
valuesControlMode
}
// TODO: Remove this function once Helmfile v0.x
type DeleteConfigProvider interface {
Args() string
+4 -2
View File
@@ -8,8 +8,10 @@ import (
)
const (
DefaultHelmfile = "helmfile.yaml"
DeprecatedHelmfile = "charts.yaml"
DefaultHelmfile = "helmfile.yaml"
// TODO: Remove this function once Helmfile v0.x
DeprecatedHelmfile = "charts.yaml"
DefaultHelmfileDirectory = "helmfile.d"
ExperimentalSelectorExplicit = "explicit-selector-inheritance" // value to remove default selector inheritance to sub-helmfiles and use the explicit one
)
+1
View File
@@ -112,6 +112,7 @@ func (r *Run) Repos(c ReposConfigProvider) error {
return r.ctx.SyncReposOnce(r.state, r.helm)
}
// TODO: Remove this function once Helmfile v0.x
func (r *Run) DeprecatedSyncCharts(c DeprecatedChartsConfigProvider) []error {
st := r.state
helm := r.helm