Skip to content

Commit 9ca7b6d

Browse files
authored
feat: add skip-schema-validation feature (#676)
* feat: add skip-schema-validation feature Signed-off-by: yxxhero <[email protected]> * feat: add --skip-schema-validation flag Signed-off-by: yxxhero <[email protected]> --------- Signed-off-by: yxxhero <[email protected]>
1 parent 196c9f7 commit 9ca7b6d

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ Flags:
8888
--disable-validation disables rendered templates validation against the Kubernetes cluster you are currently pointing to. This is the same validation performed on an install
8989
--dry-run disables cluster access and show diff as if it was install. Implies --install, --reset-values, and --disable-validation
9090
--enable-dns enable DNS lookups when rendering templates
91+
--skip-schema-validation disables rendered templates validation against the Kubernetes OpenAPI Schema
9192
-D, --find-renames float32 Enable rename detection if set to any value greater than 0. If specified, the value denotes the maximum fraction of changed content as lines added + removed compared to total lines in a diff for considering it a rename. Only objects of the same Kind are attempted to be matched
9293
-h, --help help for diff
9394
--include-tests enable the diffing of the helm test hooks
@@ -185,6 +186,7 @@ Flags:
185186
--disable-validation disables rendered templates validation against the Kubernetes cluster you are currently pointing to. This is the same validation performed on an install
186187
--dry-run disables cluster access and show diff as if it was install. Implies --install, --reset-values, and --disable-validation
187188
--enable-dns enable DNS lookups when rendering templates
189+
--skip-schema-validation skip validation of rendered templates against the Kubernetes OpenAPI Schema
188190
-D, --find-renames float32 Enable rename detection if set to any value greater than 0. If specified, the value denotes the maximum fraction of changed content as lines added + removed compared to total lines in a diff for considering it a rename. Only objects of the same Kind are attempted to be matched
189191
-h, --help help for upgrade
190192
--include-tests enable the diffing of the helm test hooks

cmd/helm3.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,10 @@ func (d *diffCmd) template(isUpgrade bool) ([]byte, error) {
215215
flags = append(flags, "--enable-dns")
216216
}
217217

218+
if d.SkipSchemaValidation {
219+
flags = append(flags, "--skip-schema-validation")
220+
}
221+
218222
var (
219223
subcmd string
220224
filter func([]byte) []byte

cmd/upgrade.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ type diffCmd struct {
4747
disableValidation bool
4848
disableOpenAPIValidation bool
4949
enableDNS bool
50+
SkipSchemaValidation bool
5051
namespace string // namespace to assume the release to be installed into. Defaults to the current kube config namespace.
5152
valueFiles valueFiles
5253
values []string
@@ -255,6 +256,7 @@ func newChartCommand() *cobra.Command {
255256
" --dry-run=server enables the cluster access with helm-get and the lookup template function.")
256257
f.Lookup("dry-run").NoOptDefVal = dryRunNoOptDefVal
257258
f.BoolVar(&diff.enableDNS, "enable-dns", false, "enable DNS lookups when rendering templates")
259+
f.BoolVar(&diff.SkipSchemaValidation, "skip-schema-validation", false, "skip validation of the rendered manifests against the Kubernetes OpenAPI schema")
258260
f.StringVar(&diff.postRenderer, "post-renderer", "", "the path to an executable to be used for post rendering. If it exists in $PATH, the binary will be used, otherwise it will try to look for the executable at the given path")
259261
f.StringArrayVar(&diff.postRendererArgs, "post-renderer-args", []string{}, "an argument to the post-renderer (can specify multiple)")
260262
f.BoolVar(&diff.insecureSkipTLSVerify, "insecure-skip-tls-verify", false, "skip tls certificate checks for the chart download")

0 commit comments

Comments
 (0)