Repository navigation
Commit 53a1d2d
committed
fix(e2e): read the KubernetesNodes pool release in the HelmRelease guard (#4970)
`cozy_guard_all_helmreleases` in
`hack/e2e-chainsaw/_lib/run-kubernetes.sh` reads the parent
`kubernetes-<test>` release and the addons selected by the
`kubernetes-<test>-` prefix. The worker pool is
`kubernetes-nodes-<test>-md0`, an Application HelmRelease the aggregated
apiserver stamps with `RetryOnFailure` like the parent, and it sits on
the node-join path through the talos-reconcile Job it renders. Its name
does not start with the addon prefix, so a failed action on it was never
read, on the passing path or in the failure-path report.
This reads it on both paths, with the `required` strategy check the
parent gets, since the apiserver stamps both. The pool name is derived
from the parent (`cozy_pool_helmrelease_name`), the way the addon prefix
is, so the two cannot drift. The failure-path report checks that the
release exists before reading it, with `get hr --ignore-not-found -o
name`: a run whose pool apply failed has no pool release (exit 0, empty
output), and the report says so instead of reporting a failed read. For
that run to reach the report at all, `run_kubernetes_test` now arms the
exit handler (`_tenant_failure_on_exit`, with
`CURRENT_TENANT_PARENT_HR`) right after the parent `Kubernetes` apply
instead of after the `KubernetesNodes` apply: before, a failing pool
apply exited under errexit with no handler installed, and the parent
went unclassified. The snapshot half still no-ops until the tenant
kubeconfig is set. A non-zero exit (a timeout, a kill, a Forbidden) is
reported as the failed read it is, through `_cozy_guard_read_failure`,
never as absence. The pool reads are gated on the report's own deadline
as well as the phase clock, like the addon listing.
Unit tests in `hack/run-kubernetes-remediation_test.bats` cover a
failing pool release on the passing path, a clean one (the composite
returns zero), an empty strategy on the pool, the report with and
without the pool release, a cut-off existence read, and a pool read past
the report budget; the ordering pin now also requires the handler to be
armed before the pool apply. The kubectl stub gained an existence read:
an `ABSENT` marker prints nothing and exits 0 under `--ignore-not-found`
(NotFound without it, as kubectl does), and the failure markers apply to
it as `<name>.exists`.
Verified with `hack/cozytest.sh` and Bats on
`hack/run-kubernetes-remediation_test.bats` (51 tests),
`hack/run-kubernetes-node-join_test.bats` and
`hack/remediation-guard.bats`.
Closes #4737
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Bug Fixes**
* Kubernetes release checks now include worker-pool releases alongside
the parent release and add-ons, and flag missing or invalid install
strategies and remediation failures.
* Failure reports distinguish worker-pool releases that are absent from
those whose status cannot be read. Existing releases are assessed
against the phase gate and report time budget; when the budget is
exhausted, skipped checks are identified.
* Failure handling now begins immediately after the parent resource is
applied, covering errors that occur while applying the worker pool.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Backported-from: 013b1662 files changed
Lines changed: 354 additions & 36 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5230 | 5230 | | |
5231 | 5231 | | |
5232 | 5232 | | |
5233 | | - | |
5234 | | - | |
5235 | | - | |
| 5233 | + | |
| 5234 | + | |
| 5235 | + | |
| 5236 | + | |
5236 | 5237 | | |
5237 | 5238 | | |
5238 | 5239 | | |
| |||
5437 | 5438 | | |
5438 | 5439 | | |
5439 | 5440 | | |
| 5441 | + | |
| 5442 | + | |
| 5443 | + | |
| 5444 | + | |
| 5445 | + | |
| 5446 | + | |
| 5447 | + | |
| 5448 | + | |
| 5449 | + | |
| 5450 | + | |
| 5451 | + | |
5440 | 5452 | | |
5441 | 5453 | | |
5442 | 5454 | | |
5443 | 5455 | | |
5444 | 5456 | | |
5445 | 5457 | | |
5446 | | - | |
5447 | | - | |
5448 | | - | |
| 5458 | + | |
| 5459 | + | |
| 5460 | + | |
| 5461 | + | |
5449 | 5462 | | |
| 5463 | + | |
| 5464 | + | |
| 5465 | + | |
| 5466 | + | |
5450 | 5467 | | |
5451 | 5468 | | |
5452 | 5469 | | |
| |||
5495 | 5512 | | |
5496 | 5513 | | |
5497 | 5514 | | |
5498 | | - | |
| 5515 | + | |
| 5516 | + | |
5499 | 5517 | | |
5500 | 5518 | | |
5501 | 5519 | | |
| |||
5515 | 5533 | | |
5516 | 5534 | | |
5517 | 5535 | | |
5518 | | - | |
| 5536 | + | |
5519 | 5537 | | |
5520 | 5538 | | |
5521 | 5539 | | |
| |||
5541 | 5559 | | |
5542 | 5560 | | |
5543 | 5561 | | |
| 5562 | + | |
| 5563 | + | |
| 5564 | + | |
| 5565 | + | |
| 5566 | + | |
| 5567 | + | |
| 5568 | + | |
| 5569 | + | |
| 5570 | + | |
| 5571 | + | |
| 5572 | + | |
| 5573 | + | |
| 5574 | + | |
| 5575 | + | |
| 5576 | + | |
| 5577 | + | |
| 5578 | + | |
| 5579 | + | |
| 5580 | + | |
| 5581 | + | |
| 5582 | + | |
| 5583 | + | |
| 5584 | + | |
5544 | 5585 | | |
5545 | 5586 | | |
5546 | 5587 | | |
| |||
5723 | 5764 | | |
5724 | 5765 | | |
5725 | 5766 | | |
| 5767 | + | |
| 5768 | + | |
| 5769 | + | |
| 5770 | + | |
| 5771 | + | |
| 5772 | + | |
| 5773 | + | |
| 5774 | + | |
| 5775 | + | |
| 5776 | + | |
| 5777 | + | |
| 5778 | + | |
| 5779 | + | |
| 5780 | + | |
| 5781 | + | |
| 5782 | + | |
| 5783 | + | |
| 5784 | + | |
| 5785 | + | |
| 5786 | + | |
| 5787 | + | |
| 5788 | + | |
5726 | 5789 | | |
5727 | 5790 | | |
5728 | 5791 | | |
| |||
5781 | 5844 | | |
5782 | 5845 | | |
5783 | 5846 | | |
5784 | | - | |
5785 | | - | |
5786 | | - | |
5787 | | - | |
5788 | | - | |
5789 | | - | |
5790 | | - | |
5791 | | - | |
5792 | | - | |
5793 | | - | |
5794 | | - | |
5795 | | - | |
5796 | | - | |
5797 | | - | |
5798 | | - | |
5799 | | - | |
5800 | 5847 | | |
5801 | 5848 | | |
5802 | 5849 | | |
| |||
0 commit comments