Skip to content

Commit

Permalink
Use Helm's schema validation skipping feature
Browse files Browse the repository at this point in the history
This relies on Helm's functionality instead of manipulating chart data
when schema validation is to be skipped.
This should work from Helm 3.16 onwards.
  • Loading branch information
weyfonk authored and manno committed Sep 13, 2024
1 parent 0899e3d commit 051781f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions internal/helmdeployer/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ func (h *Helm) Deploy(ctx context.Context, bundleID string, manifest *manifest.M
chart.Metadata.Annotations[CommitAnnotation] = manifest.Commit
}

if options.Helm.SkipSchemaValidation {
// TODO: instead of manipulating the chart object, use helm's own functionality when it's available:
// https://github.com/helm/helm/pull/11510
chart.Schema = nil
}

if resources, err := h.install(ctx, bundleID, manifest, chart, options, true); err != nil {
return nil, err
} else if h.template {
Expand Down Expand Up @@ -144,6 +138,7 @@ func (h *Helm) install(ctx context.Context, bundleID string, manifest *manifest.
u.Namespace = defaultNamespace
u.Timeout = timeout
u.DryRun = dryRun
u.SkipSchemaValidation = options.Helm.SkipSchemaValidation
u.PostRenderer = pr
u.WaitForJobs = options.Helm.WaitForJobs
if u.Timeout > 0 {
Expand All @@ -170,6 +165,7 @@ func (h *Helm) install(ctx context.Context, bundleID string, manifest *manifest.
u.Namespace = defaultNamespace
u.Timeout = timeout
u.DryRun = dryRun
u.SkipSchemaValidation = options.Helm.SkipSchemaValidation
u.DisableOpenAPIValidation = h.template || dryRun
u.PostRenderer = pr
u.WaitForJobs = options.Helm.WaitForJobs
Expand Down

0 comments on commit 051781f

Please sign in to comment.