feat: add SkipSchemaValidation to config and state handling
Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
parent
78bbc6a584
commit
2e8df93f1c
|
|
@ -1441,6 +1441,7 @@ func (a *App) apply(r *Run, c ApplyConfigProvider) (bool, bool, []error) {
|
|||
DiffArgs: c.DiffArgs(),
|
||||
PostRenderer: c.PostRenderer(),
|
||||
PostRendererArgs: c.PostRendererArgs(),
|
||||
SkipSchemaValidation: c.SkipSchemaValidation(),
|
||||
SuppressOutputLineRegex: c.SuppressOutputLineRegex(),
|
||||
}
|
||||
|
||||
|
|
@ -1943,18 +1944,19 @@ Do you really want to sync?
|
|||
subst.Releases = rs
|
||||
|
||||
opts := &state.SyncOpts{
|
||||
Set: c.Set(),
|
||||
SkipCRDs: c.SkipCRDs(),
|
||||
Wait: c.Wait(),
|
||||
WaitRetries: c.WaitRetries(),
|
||||
WaitForJobs: c.WaitForJobs(),
|
||||
ReuseValues: c.ReuseValues(),
|
||||
ResetValues: c.ResetValues(),
|
||||
PostRenderer: c.PostRenderer(),
|
||||
PostRendererArgs: c.PostRendererArgs(),
|
||||
SyncArgs: c.SyncArgs(),
|
||||
HideNotes: c.HideNotes(),
|
||||
TakeOwnership: c.TakeOwnership(),
|
||||
Set: c.Set(),
|
||||
SkipCRDs: c.SkipCRDs(),
|
||||
Wait: c.Wait(),
|
||||
WaitRetries: c.WaitRetries(),
|
||||
WaitForJobs: c.WaitForJobs(),
|
||||
ReuseValues: c.ReuseValues(),
|
||||
ResetValues: c.ResetValues(),
|
||||
PostRenderer: c.PostRenderer(),
|
||||
PostRendererArgs: c.PostRendererArgs(),
|
||||
SyncArgs: c.SyncArgs(),
|
||||
HideNotes: c.HideNotes(),
|
||||
TakeOwnership: c.TakeOwnership(),
|
||||
SkipSchemaValidation: c.SkipSchemaValidation(),
|
||||
}
|
||||
return subst.SyncReleases(&affectedReleases, helm, c.Values(), c.Concurrency(), opts)
|
||||
}))
|
||||
|
|
@ -1982,16 +1984,17 @@ func (a *App) template(r *Run, c TemplateConfigProvider) (bool, []error) {
|
|||
}
|
||||
|
||||
opts := &state.TemplateOpts{
|
||||
Set: c.Set(),
|
||||
IncludeCRDs: c.IncludeCRDs(),
|
||||
NoHooks: c.NoHooks(),
|
||||
OutputDirTemplate: c.OutputDirTemplate(),
|
||||
SkipCleanup: c.SkipCleanup(),
|
||||
SkipTests: c.SkipTests(),
|
||||
PostRenderer: c.PostRenderer(),
|
||||
PostRendererArgs: c.PostRendererArgs(),
|
||||
KubeVersion: c.KubeVersion(),
|
||||
ShowOnly: c.ShowOnly(),
|
||||
Set: c.Set(),
|
||||
IncludeCRDs: c.IncludeCRDs(),
|
||||
NoHooks: c.NoHooks(),
|
||||
OutputDirTemplate: c.OutputDirTemplate(),
|
||||
SkipCleanup: c.SkipCleanup(),
|
||||
SkipTests: c.SkipTests(),
|
||||
PostRenderer: c.PostRenderer(),
|
||||
PostRendererArgs: c.PostRendererArgs(),
|
||||
KubeVersion: c.KubeVersion(),
|
||||
ShowOnly: c.ShowOnly(),
|
||||
SkipSchemaValidation: c.SkipSchemaValidation(),
|
||||
}
|
||||
return st.TemplateReleases(helm, c.OutputDir(), c.Values(), args, c.Concurrency(), c.Validate(), opts)
|
||||
})
|
||||
|
|
|
|||
|
|
@ -103,6 +103,7 @@ type ApplyConfigProvider interface {
|
|||
type SyncConfigProvider interface {
|
||||
Args() string
|
||||
PostRenderer() string
|
||||
SkipSchemaValidation() bool
|
||||
PostRendererArgs() []string
|
||||
HideNotes() bool
|
||||
TakeOwnership() bool
|
||||
|
|
@ -239,6 +240,7 @@ type TemplateConfigProvider interface {
|
|||
Args() string
|
||||
PostRenderer() string
|
||||
PostRendererArgs() []string
|
||||
SkipSchemaValidation() bool
|
||||
|
||||
Values() []string
|
||||
Set() []string
|
||||
|
|
|
|||
|
|
@ -1492,6 +1492,8 @@ type TemplateOpts struct {
|
|||
PostRendererArgs []string
|
||||
KubeVersion string
|
||||
ShowOnly []string
|
||||
// Propagate '--skip-schema-validation' to helmv3 template and helm install
|
||||
SkipSchemaValidation bool
|
||||
}
|
||||
|
||||
type TemplateOpt interface{ Apply(*TemplateOpts) }
|
||||
|
|
@ -2837,6 +2839,7 @@ func (st *HelmState) flagsForTemplate(helm helmexec.Interface, release *ReleaseS
|
|||
flags = st.appendApiVersionsFlags(flags, release, kubeVersion)
|
||||
flags = st.appendChartDownloadFlags(flags, release)
|
||||
flags = st.appendShowOnlyFlags(flags, showOnly)
|
||||
flags = st.appendSkipSchemaValidationFlags(flags, release, opt.SkipSchemaValidation)
|
||||
|
||||
common, files, err := st.namespaceAndValuesFlags(helm, release, workerIndex)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Reference in New Issue