Fix --skip-crds not working with chartify (#1774)
Follow-up for #1771 Ref #1770 Ref https://github.com/roboll/helmfile/pull/1771#issuecomment-817399338
This commit is contained in:
parent
a111e89b27
commit
ae942c5288
|
|
@ -166,9 +166,12 @@ func (a *App) Diff(c DiffConfigProvider) error {
|
|||
|
||||
var errs []error
|
||||
|
||||
includeCRDs := !c.SkipCRDs()
|
||||
|
||||
prepErr := run.withPreparedCharts("diff", state.ChartPrepareOptions{
|
||||
SkipRepos: c.SkipDeps(),
|
||||
SkipDeps: c.SkipDeps(),
|
||||
IncludeCRDs: &includeCRDs,
|
||||
}, func() {
|
||||
msg, matched, affected, errs = a.diff(run, c)
|
||||
})
|
||||
|
|
@ -305,11 +308,14 @@ func (a *App) Fetch(c FetchConfigProvider) error {
|
|||
|
||||
func (a *App) Sync(c SyncConfigProvider) error {
|
||||
return a.ForEachState(func(run *Run) (ok bool, errs []error) {
|
||||
includeCRDs := !c.SkipCRDs()
|
||||
|
||||
prepErr := run.withPreparedCharts("sync", state.ChartPrepareOptions{
|
||||
SkipRepos: c.SkipDeps(),
|
||||
SkipDeps: c.SkipDeps(),
|
||||
Wait: c.Wait(),
|
||||
WaitForJobs: c.WaitForJobs(),
|
||||
IncludeCRDs: &includeCRDs,
|
||||
}, func() {
|
||||
ok, errs = a.sync(run, c)
|
||||
})
|
||||
|
|
@ -332,11 +338,14 @@ func (a *App) Apply(c ApplyConfigProvider) error {
|
|||
opts = append(opts, SetRetainValuesFiles(c.RetainValuesFiles() || c.SkipCleanup()))
|
||||
|
||||
err := a.ForEachState(func(run *Run) (ok bool, errs []error) {
|
||||
includeCRDs := !c.SkipCRDs()
|
||||
|
||||
prepErr := run.withPreparedCharts("apply", state.ChartPrepareOptions{
|
||||
SkipRepos: c.SkipDeps(),
|
||||
SkipDeps: c.SkipDeps(),
|
||||
Wait: c.Wait(),
|
||||
WaitForJobs: c.WaitForJobs(),
|
||||
IncludeCRDs: &includeCRDs,
|
||||
}, func() {
|
||||
matched, updated, es := a.apply(run, c)
|
||||
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ type DiffConfigProvider interface {
|
|||
|
||||
Values() []string
|
||||
Set() []string
|
||||
SkipCRDs() bool
|
||||
SkipDeps() bool
|
||||
|
||||
IncludeTests() bool
|
||||
|
|
|
|||
|
|
@ -3,15 +3,16 @@ package app
|
|||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"io"
|
||||
"path/filepath"
|
||||
"sync"
|
||||
"testing"
|
||||
|
||||
"github.com/roboll/helmfile/pkg/exectest"
|
||||
"github.com/roboll/helmfile/pkg/helmexec"
|
||||
"github.com/roboll/helmfile/pkg/testhelper"
|
||||
"github.com/variantdev/vals"
|
||||
"go.uber.org/zap"
|
||||
"io"
|
||||
"path/filepath"
|
||||
"sync"
|
||||
"testing"
|
||||
)
|
||||
|
||||
type diffConfig struct {
|
||||
|
|
@ -20,6 +21,7 @@ type diffConfig struct {
|
|||
retainValuesFiles bool
|
||||
set []string
|
||||
validate bool
|
||||
skipCRDs bool
|
||||
skipDeps bool
|
||||
includeTests bool
|
||||
suppressSecrets bool
|
||||
|
|
@ -49,6 +51,10 @@ func (a diffConfig) Validate() bool {
|
|||
return a.validate
|
||||
}
|
||||
|
||||
func (a diffConfig) SkipCRDs() bool {
|
||||
return a.skipCRDs
|
||||
}
|
||||
|
||||
func (a diffConfig) SkipDeps() bool {
|
||||
return a.skipDeps
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue