Add support for --validate on chartify (#1960)

Apparently we needed to pass `--validate` on helm-template run by chartify when the targeted chart contains Capabilities.APIVersions in a chart template. Otherwise, you can never make such chart work with chartify, as at apply time helm template expressions that involved Capabilities.APIVersions are already nowhere.
This commit is contained in:
Yusuke Kuoka
2021-09-14 04:48:21 +09:00
committed by GitHub
parent 0f91f2c9cf
commit e1cabc82e3
6 changed files with 27 additions and 7 deletions
+9 -5
View File
@@ -966,10 +966,13 @@ type ChartPrepareOptions struct {
SkipDeps bool
SkipResolve bool
SkipCleanup bool
IncludeCRDs *bool
Wait bool
WaitForJobs bool
OutputDir string
// Validate is a helm-3-only option. When it is set to true, it configures chartify to pass --validate to helm-template run by it.
// It's required when one of your chart relies on Capabilities.APIVersions in a template
Validate bool
IncludeCRDs *bool
Wait bool
WaitForJobs bool
OutputDir string
}
type chartPrepareResult struct {
@@ -1142,9 +1145,10 @@ func (st *HelmState) PrepareCharts(helm helmexec.Interface, dir string, concurre
if opts.IncludeCRDs != nil {
includeCRDs = *opts.IncludeCRDs
}
chartifyOpts.IncludeCRDs = includeCRDs
chartifyOpts.Validate = opts.Validate
out, err := c.Chartify(release.Name, chartPath, chartify.WithChartifyOpts(chartifyOpts))
if err != nil {
results <- &chartPrepareResult{err: err}