Skip to content

Commit c16db59

Browse files
authored
Merge pull request #1392 from fluxcd/reduce-mttr
Reduce the mean time to recovery (MTTR) in case of failed deployments
2 parents 40ed2cc + 1f56886 commit c16db59

38 files changed

+1044
-174
lines changed

.github/workflows/e2e.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -712,8 +712,6 @@ jobs:
712712
713713
kubectl -n helm-system delete -f config/testdata/$test_name
714714
- name: Run install test fail test
715-
# TODO: re-enable after upgrading to Helm 4.1.1 (https://github.com/helm/helm/pull/31730)
716-
if: false
717715
run: |
718716
test_name=install-test-fail
719717
kubectl -n helm-system apply -f config/testdata/$test_name
@@ -739,8 +737,6 @@ jobs:
739737
740738
kubectl -n helm-system delete -f config/testdata/$test_name
741739
- name: Run install test fail ignore test
742-
# TODO: re-enable after upgrading to Helm 4.1.1 (https://github.com/helm/helm/pull/31730)
743-
if: false
744740
run: |
745741
test_name=install-test-fail-ignore
746742
kubectl -n helm-system apply -f config/testdata/$test_name
@@ -863,8 +859,6 @@ jobs:
863859
864860
kubectl delete -n helm-system -f config/testdata/$test_name/install.yaml
865861
- name: Run upgrade test fail test
866-
# TODO: re-enable after upgrading to Helm 4.1.1 (https://github.com/helm/helm/pull/31730)
867-
if: false
868862
run: |
869863
test_name=upgrade-test-fail
870864
kubectl -n helm-system apply -f config/testdata/$test_name/install.yaml

api/v2/helmrelease_types.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ type HelmReleaseSpec struct {
194194
// health of custom resources using Common Expression Language (CEL).
195195
// The expressions are evaluated only when the specific Helm action
196196
// taking place has wait enabled, i.e. DisableWait is false, and the
197-
// 'watcher' WaitStrategy is used.
197+
// 'poller' WaitStrategy is used.
198198
// +optional
199199
HealthCheckExprs []kustomize.CustomHealthCheck `json:"healthCheckExprs,omitempty"`
200200
}
@@ -441,8 +441,8 @@ type HelmChartTemplateVerification struct {
441441
type WaitStrategyName string
442442

443443
const (
444-
// WaitStrategyWatcher is the strategy for watching resource statuses via kstatus.
445-
WaitStrategyWatcher WaitStrategyName = "watcher"
444+
// WaitStrategyPoller is the strategy for polling resource statuses via kstatus.
445+
WaitStrategyPoller WaitStrategyName = "poller"
446446

447447
// WaitStrategyLegacy is the legacy strategy for waiting for resources to be ready
448448
// used in Helm v3.
@@ -453,12 +453,12 @@ const (
453453
// resources to become ready.
454454
type WaitStrategy struct {
455455
// Name is Helm's wait strategy for waiting for applied resources to
456-
// become ready. One of 'watcher' or 'legacy'. The 'watcher' strategy uses
457-
// kstatus to watch resource statuses, while the 'legacy' strategy uses
456+
// become ready. One of 'poller' or 'legacy'. The 'poller' strategy uses
457+
// kstatus to poll resource statuses, while the 'legacy' strategy uses
458458
// Helm v3's waiting logic.
459-
// Defaults to 'watcher', or to 'legacy' when UseHelm3Defaults feature
459+
// Defaults to 'poller', or to 'legacy' when UseHelm3Defaults feature
460460
// gate is enabled.
461-
// +kubebuilder:validation:Enum=watcher;legacy
461+
// +kubebuilder:validation:Enum=poller;legacy
462462
// +required
463463
Name WaitStrategyName `json:"name"`
464464
}

config/crd/bases/helm.toolkit.fluxcd.io_helmreleases.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ spec:
355355
health of custom resources using Common Expression Language (CEL).
356356
The expressions are evaluated only when the specific Helm action
357357
taking place has wait enabled, i.e. DisableWait is false, and the
358-
'watcher' WaitStrategy is used.
358+
'poller' WaitStrategy is used.
359359
items:
360360
description: CustomHealthCheck defines the health check for custom
361361
resources.
@@ -1102,13 +1102,13 @@ spec:
11021102
name:
11031103
description: |-
11041104
Name is Helm's wait strategy for waiting for applied resources to
1105-
become ready. One of 'watcher' or 'legacy'. The 'watcher' strategy uses
1106-
kstatus to watch resource statuses, while the 'legacy' strategy uses
1105+
become ready. One of 'poller' or 'legacy'. The 'poller' strategy uses
1106+
kstatus to poll resource statuses, while the 'legacy' strategy uses
11071107
Helm v3's waiting logic.
1108-
Defaults to 'watcher', or to 'legacy' when UseHelm3Defaults feature
1108+
Defaults to 'poller', or to 'legacy' when UseHelm3Defaults feature
11091109
gate is enabled.
11101110
enum:
1111-
- watcher
1111+
- poller
11121112
- legacy
11131113
type: string
11141114
required:

config/testdata/server-side-apply/rollback-upgrade.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ spec:
2929
replicaCount: 2
3030
faults:
3131
unready: true
32-
timeout: 3s
32+
timeout: 10s

config/testdata/upgrade-fail-remediate/upgrade.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ spec:
2525
replicaCount: 2
2626
faults:
2727
unready: true
28-
timeout: 3s
28+
timeout: 10s

config/testdata/upgrade-fail-retry/upgrade.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ spec:
2525
replicaCount: 2
2626
faults:
2727
unready: true
28-
timeout: 3s
28+
timeout: 10s

docs/api/v2/helm.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ resources to become ready.</p>
435435
health of custom resources using Common Expression Language (CEL).
436436
The expressions are evaluated only when the specific Helm action
437437
taking place has wait enabled, i.e. DisableWait is false, and the
438-
&lsquo;watcher&rsquo; WaitStrategy is used.</p>
438+
&lsquo;poller&rsquo; WaitStrategy is used.</p>
439439
</td>
440440
</tr>
441441
</table>
@@ -1603,7 +1603,7 @@ resources to become ready.</p>
16031603
health of custom resources using Common Expression Language (CEL).
16041604
The expressions are evaluated only when the specific Helm action
16051605
taking place has wait enabled, i.e. DisableWait is false, and the
1606-
&lsquo;watcher&rsquo; WaitStrategy is used.</p>
1606+
&lsquo;poller&rsquo; WaitStrategy is used.</p>
16071607
</td>
16081608
</tr>
16091609
</tbody>
@@ -3471,10 +3471,10 @@ WaitStrategyName
34713471
</td>
34723472
<td>
34733473
<p>Name is Helm&rsquo;s wait strategy for waiting for applied resources to
3474-
become ready. One of &lsquo;watcher&rsquo; or &lsquo;legacy&rsquo;. The &lsquo;watcher&rsquo; strategy uses
3475-
kstatus to watch resource statuses, while the &lsquo;legacy&rsquo; strategy uses
3474+
become ready. One of &lsquo;poller&rsquo; or &lsquo;legacy&rsquo;. The &lsquo;poller&rsquo; strategy uses
3475+
kstatus to poll resource statuses, while the &lsquo;legacy&rsquo; strategy uses
34763476
Helm v3&rsquo;s waiting logic.
3477-
Defaults to &lsquo;watcher&rsquo;, or to &lsquo;legacy&rsquo; when UseHelm3Defaults feature
3477+
Defaults to &lsquo;poller&rsquo;, or to &lsquo;legacy&rsquo; when UseHelm3Defaults feature
34783478
gate is enabled.</p>
34793479
</td>
34803480
</tr>

docs/spec/v2/helmreleases.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -952,14 +952,14 @@ for resources to become ready after Helm actions.
952952
The field offers the following subfields:
953953

954954
- `.name` (Required): The strategy for waiting for resources to be ready.
955-
One of `watcher` or `legacy`. The `watcher` strategy uses kstatus to watch resource
955+
One of `poller` or `legacy`. The `poller` strategy uses kstatus to poll resource
956956
statuses, while the `legacy` strategy uses Helm v3's waiting logic. Defaults to
957-
`watcher`, or to `legacy` when the `UseHelm3Defaults` feature gate is enabled.
957+
`poller`, or to `legacy` when the `UseHelm3Defaults` feature gate is enabled.
958958

959959
```yaml
960960
spec:
961961
waitStrategy:
962-
name: watcher
962+
name: poller
963963
```
964964

965965
### Health check expressions
@@ -968,8 +968,8 @@ spec:
968968
checks on custom resources using [Common Expression Language (CEL)](https://cel.dev/).
969969

970970
The expressions are evaluated only when the Helm action taking place has wait
971-
enabled (i.e. `.spec.<action>.disableWait` is `false`) and the `watcher`
972-
wait strategy is used (i.e. `.spec.waitStrategy.name` is `watcher`).
971+
enabled (i.e. `.spec.<action>.disableWait` is `false`) and the `poller`
972+
wait strategy is used (i.e. `.spec.waitStrategy.name` is `poller`).
973973

974974
The `.spec.healthCheckExprs` field accepts a list of objects with the following fields:
975975

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ require (
2525
github.com/fluxcd/pkg/auth v0.36.0
2626
github.com/fluxcd/pkg/cache v0.13.0
2727
github.com/fluxcd/pkg/chartutil v1.21.0
28-
github.com/fluxcd/pkg/runtime v0.96.0
29-
github.com/fluxcd/pkg/ssa v0.64.0
28+
github.com/fluxcd/pkg/runtime v0.97.0
29+
github.com/fluxcd/pkg/ssa v0.65.0
3030
github.com/fluxcd/pkg/testserver v0.13.0
3131
github.com/fluxcd/source-controller/api v1.7.2
3232
github.com/go-logr/logr v1.4.3

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,10 @@ github.com/fluxcd/pkg/cache v0.13.0 h1:MqtlgOwIVcGKKgV422e39O+KFSVMWuExKeRaMDBjJ
160160
github.com/fluxcd/pkg/cache v0.13.0/go.mod h1:0xRZ1hitrIFQ6pl68ke2wZLbIqA2VLzY78HpDo9DVxs=
161161
github.com/fluxcd/pkg/chartutil v1.21.0 h1:NJYhlekwBwuqMpRgsOlcsJrw2Xq0cBJW0Nmvz2oMluA=
162162
github.com/fluxcd/pkg/chartutil v1.21.0/go.mod h1:Gv50bF3SS4OvvKCyyIMRkGeNzZk6Fsh4+lAdrjx97T4=
163-
github.com/fluxcd/pkg/runtime v0.96.0 h1:sF4ic8131BwbOE+T2pkiXlkr2gCaxAho500zlZJJLck=
164-
github.com/fluxcd/pkg/runtime v0.96.0/go.mod h1:FyjNMFNAERkCsF/muTWJYU9MZOsq/m4Sc4aQk/EgQ9E=
165-
github.com/fluxcd/pkg/ssa v0.64.0 h1:B/8VYMIYMeRmolup2HOoWNqXh4UeXi6w2LvXXvl6MZM=
166-
github.com/fluxcd/pkg/ssa v0.64.0/go.mod h1:RjvVjJIoRo1ecsv91yMuiqzO6cpNag80M6MOB/vrJdc=
163+
github.com/fluxcd/pkg/runtime v0.97.0 h1:NZ9ZL2RE6J4yNDHI7ZNmL/OnCsDWurzVIvws73FYMz8=
164+
github.com/fluxcd/pkg/runtime v0.97.0/go.mod h1:FyjNMFNAERkCsF/muTWJYU9MZOsq/m4Sc4aQk/EgQ9E=
165+
github.com/fluxcd/pkg/ssa v0.65.0 h1:pvPYmBmfqS0sRNoi4/IUoocBbglYuD/OJLgOuxMJ9+o=
166+
github.com/fluxcd/pkg/ssa v0.65.0/go.mod h1:RjvVjJIoRo1ecsv91yMuiqzO6cpNag80M6MOB/vrJdc=
167167
github.com/fluxcd/pkg/testserver v0.13.0 h1:xEpBcEYtD7bwvZ+i0ZmChxKkDo/wfQEV3xmnzVybSSg=
168168
github.com/fluxcd/pkg/testserver v0.13.0/go.mod h1:akRYv3FLQUsme15na9ihECRG6hBuqni4XEY9W8kzs8E=
169169
github.com/fluxcd/source-controller/api v1.7.2 h1:/lg/xoyRjxwdhHKqjTxQS2o1cp+DMKJ8W4rpm+ZLemQ=

0 commit comments

Comments
 (0)