Commit Graph
17 Commits
Author SHA1 Message Date
Pedram Pourmohammad e461dd9b20 Route traffic to canary on promotion failure
On a failed promotion the canary keeps serving, but the traffic may
already have been shifted to the primary by runPromotionTrafficShift
before it started failing. Route all traffic back to the canary and
report the matching canary weight instead of zeroing it.

Addresses review feedback on #1931.

Signed-off-by: Pedram Pourmohammad <eragon.pedy@gmail.com>
2026-06-27 19:56:05 +03:30
Pedram Pourmohammad 8eaa0408af Keep canary alive when primary promotion fails
When the canary analysis succeeds, Flagger copies the canary pod spec
to the primary and waits for the primary rollout to finish. If the
primary fails to become ready, the non-retriable readiness error
triggered the standard analysis rollback, which routes all traffic to
the primary and scales the canary to zero.

During promotion the primary already runs the new (failing) spec while
the canary is the only healthy copy of the new revision still serving
traffic. Rolling back therefore sends all traffic to the broken primary
and deletes the working canary, taking the application down.

Halt the promotion instead: when the primary is not ready and the canary
is in the Promoting or Finalising phase, mark the rollout as failed and
alert, but keep the canary running and leave routing untouched until the
primary recovers or a corrected revision is applied.

Fixes #1898

Signed-off-by: Pedram Pourmohammad <eragon.pedy@gmail.com>
2026-06-27 19:56:03 +03:30
Yap Sok Ann ceab3ec96b Fix bug where CanaryWeight is reset to 0 during CanaryPhasePromoting
Signed-off-by: Yap Sok Ann <sokann@gmail.com>
2026-03-07 15:02:09 +05:30
miguelvalerio b25e12d45d fix initial deployment downtime
Signed-off-by: miguelvalerio <miguelgomes.valerio@gmail.com>
2023-08-18 12:40:56 +05:30
shuheiktgw 38d3ca1022 chore: Drop deprecated io/ioutil
Signed-off-by: shuheiktgw <shuheiktgw@users.noreply.github.com>
2021-07-31 08:25:46 +09:00
Stefan Prodan cd75c5fa25 Copyright Flux authors
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-12-21 19:44:52 +02:00
Stefan Prodan 90abb7ba5b Rename imports to fluxcd/flagger
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-12-21 19:02:23 +02:00
stefanprodan 2e75dbb170 Add progressive promotion test 2020-05-18 10:44:23 +03:00
mathetake 5d84596bc0 pkg/controller: check metrics server's availability during initalization 2020-05-15 19:35:40 +09:00
Ed f46eaa8d05 This makes the primary ready in the TestScheduler_DeploymentAlerts test
in order to send out an alert.  Previously, it did not reach a state
to send an alert.
2020-04-30 00:20:25 -04:00
Tariq Ibrahim d41ed43ef9 fix issues reported by the linter 2020-04-17 11:45:44 -07:00
sayboras c0515fc6ff Upgrade to kube 1.18 2020-04-04 23:46:38 +11:00
mathetake 65d4b28b58 pkg/{canary,controller}: remove unused skipLivenessChecks 2020-03-28 18:13:00 +09:00
mathetake 1f6160148c change CanaryAnalysis to Analysis left in tests 2020-03-10 11:25:57 +09:00
mathetake a616199b81 refactor tests: simplify assertion 2020-03-04 21:46:08 +09:00
stefanprodan 3e0867040f Add unit tests for canary phases 2020-02-28 11:31:47 +02:00
mathetake 5af1665ef8 pkg/controller: add unit test for daemonset target 2020-02-23 13:39:11 +09:00