Commit 0cc4181
committed
resource/helm_release: don't drop the release from state when the lookup fails
resourceReleaseExists reports false both when a release is genuinely absent
and when the lookup against the cluster failed, telling the two apart only
through the returned diagnostics. Read and Delete acted on the boolean before
appending those diagnostics, so any transient error was silently swallowed.
In Read that means a hiccup while talking to the API server (we hit
"net/http: TLS handshake timeout" against AKS, which the kubernetes provider
surfaced as an error in the same run) removes the release from state. The
following plan turns the refresh into a create, and the create then fails
with "cannot re-use a name that is still in use" because the release was
there the whole time. Delete has the same problem: it returns early and drops
the resource without ever running the uninstall, leaving the release behind
in the cluster.
Check the diagnostics first in both places, which is what Create already
does and what the SDKv2 implementation did before the plugin framework
migration.1 parent a4f1c1d commit 0cc4181
1 file changed
Lines changed: 15 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1015 | 1015 | | |
1016 | 1016 | | |
1017 | 1017 | | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
1018 | 1024 | | |
1019 | | - | |
1020 | | - | |
1021 | | - | |
1022 | | - | |
1023 | 1025 | | |
1024 | 1026 | | |
1025 | 1027 | | |
1026 | 1028 | | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
1027 | 1033 | | |
1028 | 1034 | | |
1029 | 1035 | | |
| |||
1251 | 1257 | | |
1252 | 1258 | | |
1253 | 1259 | | |
| 1260 | + | |
| 1261 | + | |
1254 | 1262 | | |
1255 | | - | |
1256 | | - | |
1257 | | - | |
1258 | 1263 | | |
1259 | 1264 | | |
1260 | 1265 | | |
1261 | 1266 | | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
1262 | 1270 | | |
1263 | 1271 | | |
1264 | 1272 | | |
| |||
0 commit comments