Files
cozystack/packages/core/platform
myasnikovdaniil a1be486fb6 fix(platform): do not gate cert-manager-issuers on ClusterIssuer readiness (#5210)
## What this PR does

This PR makes the cert-manager-issuers release stop waiting for
ClusterIssuers to become Ready. ClusterIssuer is Ready only after
cert-manager registered an ACME account with the CA, so when
letsencrypt-stage can't reach the staging endpoint, helm upgrade of the
release hangs until timeout with `timeout waiting for:
[ClusterIssuer/letsencrypt-stage status: 'InProgress']`. The release
stays not Ready and every package that dependsOn cozystack.cert-manager
stays in DependencyNotReady, even when letsencrypt-prod works and all
certificates are already issued.

Fix is `healthCheckExprs` with `current: "true"` for ClusterIssuer on
the component, the same mechanism vm-default-images uses. It covers the
prod issuer too, I did not special-case staging because the wait is the
same.

Issuers keep their own status and retry registration, so they start
issuing when the CA is back. Certificate requests that come before that
stay Pending with `IssuerNotReady`, they are not failed.

Downside is that unreachable CA no longer shows up as non-Ready Package.
Only signal left is ClusterIssuer's own Ready condition and Certificates
at `Ready=False`, and there is no alert on ClusterIssuer in monitoring
packages yet.

On a cluster where the release is already stuck, the running upgrade has
to time out first (10m by default), then the retry uses the new spec.

letsencrypt-stage is still rendered on every cluster. Making it optional
needs a migration, because the issuers carry
`platform.cozystack.io/no-delete`, so it is not part of this PR.

Checked on a 3-node dev cluster running v1.7.0. I made the staging ACME
host unreachable from the cert-manager controller, so letsencrypt-stage
went to Ready=False with ErrRegisterACMEAccount, and forced an upgrade
of cert-manager-issuers. Without the expression the release hung in the
upgrade action and 23 releases went to DependencyNotReady within 15
seconds (67 of 124 at the peak). I then added the expression to the
PackageSource by hand, since I did not install a build of this branch.
The stuck upgrade ran until its timeout, the retry came right after it
and the release was Ready within 2 seconds, a second forced upgrade took
8 seconds, and all 124 releases converged with letsencrypt-stage still
False. After I made the host reachable again the issuer registered by
itself in about 30 seconds.

### Screenshots

### Downstream repositories

- [x] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up:
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up:
- [ ]
[cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack)
- follow-up:
- [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up:
- [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up:
- [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) -
follow-up:
- [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) -
follow-up:
- [ ]
[cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server)
- follow-up:
- [ ]
[cozystack/external-apps-example](https://github.com/cozystack/external-apps-example)
- follow-up:
- [ ] [cozystack/examples](https://github.com/cozystack/examples) -
follow-up:
- [ ] [cozystack/community](https://github.com/cozystack/community) -
follow-up:

### Release note

```release-note
fix(platform): the cert-manager-issuers release no longer waits for ClusterIssuers to become Ready, so an unreachable ACME endpoint (staging included) does not hold other platform packages in DependencyNotReady.
```


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Bug Fixes**
* Updated cert-manager issuer release checks to use the ClusterIssuer’s
current status and polling. Releases are no longer held up by ACME
readiness, which can remain unavailable even when issuance may recover
without intervention. This also helps prevent dependent packages from
being delayed while waiting for ACME services to become reachable.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-25 18:23:05 +05:00
..