Commit 5bcbfea
committed
build: derive default Capabilities.KubeVersion from client-go
Helm's chartutil declares k8sVersionMajor/Minor as build-time overridable
variables whose in-source values are "1" and "20". Helm's own Makefile
replaces them via -ldflags, deriving them from the k8s.io/client-go version
it builds against, so the helm CLI reports a current default. This provider
builds with no -ldflags for them, so it inherits the literal source values
and DefaultCapabilities.KubeVersion resolves to v1.20.0.
That surfaces in data.helm_template, which renders with ClientOnly and
therefore falls back to DefaultCapabilities. Any chart declaring a
kubeVersion constraint above 1.20 refuses to render, and the error names the
bogus version rather than the constraint's real problem:
Error running Helm install: chart requires kubeVersion: >=1.29.0-0
which is incompatible with Kubernetes v1.20.0
The same chart renders fine with the helm CLI, because that binary is the
one build where the ldflags are set.
Set the two flags in both build paths, mirroring Helm's Makefile: the
release build in .github/workflows/build.yml, and the GNUmakefile so local
builds behave like released ones. client-go v0.x.y corresponds to Kubernetes
v1.x.y, hence the +1 on the major.
With k8s.io/client-go v0.35.1 the default becomes v1.35.0.1 parent a4f1c1d commit 5bcbfea
2 files changed
Lines changed: 27 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
135 | 146 | | |
136 | 147 | | |
137 | 148 | | |
138 | 149 | | |
139 | | - | |
| 150 | + | |
140 | 151 | | |
141 | 152 | | |
142 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
23 | 36 | | |
24 | 37 | | |
25 | 38 | | |
26 | | - | |
| 39 | + | |
27 | 40 | | |
28 | 41 | | |
29 | 42 | | |
| |||
89 | 102 | | |
90 | 103 | | |
91 | 104 | | |
92 | | - | |
| 105 | + | |
93 | 106 | | |
94 | 107 | | |
95 | 108 | | |
| |||
0 commit comments