Skip to content

Commit cd5743f

Browse files
committed
Workaround to make helm (v3) template to render crds
1 parent 977b5c8 commit cd5743f

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

cmd/helm3.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,13 @@ func (d *diffCmd) template() ([]byte, error) {
8585
}
8686
}
8787

88+
//This is a workaround until https://github.com/helm/helm/pull/6729 is released
89+
for _, apiVersion := range strings.Split(os.Getenv("HELM_TEMPLATE_API_VERSIONS"), ",") {
90+
if apiVersion != "" {
91+
flags = append(flags, "--api-versions", strings.TrimSpace(apiVersion))
92+
}
93+
}
94+
8895
args := []string{"template", d.release, d.chart}
8996
args = append(args, flags...)
9097
cmd := exec.Command(os.Getenv("HELM_BIN"), args...)

plugin.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: "diff"
22
# Version is the version of Helm plus the number of official builds for this
33
# plugin
4-
version: "3.0.0-rc.3"
4+
version: "3.0.0-rc.4"
55
usage: "Preview helm upgrade changes as a diff"
66
description: "Preview helm upgrade changes as a diff"
77
useTunnel: true

0 commit comments

Comments
 (0)