609 Commits
Author SHA1 Message Date
Myasnikov Daniil 92d78d24de fix(platform): do not gate cert-manager-issuers on ClusterIssuer readiness
A ClusterIssuer turns Ready only after cert-manager has registered an
ACME account with the CA. Under the kstatus wait helm-controller applies
by default, an unreachable Let's Encrypt endpoint, staging included,
keeps the cert-manager-issuers upgrade in progress until it times out.
Every package that dependsOn cozystack.cert-manager then waits behind
that release, so one unreachable CA leaves the platform half rolled out
while the issuers that are in use keep issuing.

Report the issuers as current through healthCheckExprs. The release
completes once the manifests are applied, and the issuers recover on
their own when the CA is reachable again.

Assisted-by: LLM
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
(cherry picked from commit 13fefcedda)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
2026-11-26 06:38:36 +00:00
Nimesh Kulkarni 6be80ea299 docs(tenant): qualify LimitRange defaults by the bounded resource
tenant-range-limits now defaults cpu, memory and ephemeral-storage
each only when resourceQuotas bounds that resource, and is not
rendered at all under a quota on none of them. Comments in the
operator, the tenant quota controller, the backup controller and the
barman and kafka charts still said every tenant with resourceQuotas
gets a 128Mi memory default, which would mislead the next change made
on that assumption.

The tenant quota controller's gate on limits.cpu or limits.memory
stays: a root rendered by an older chart may still carry a LimitRange
under a quota that bounds no compute.

Assisted-by: LLM
Signed-off-by: Nimesh Kulkarni <167794819+GitNimay@users.noreply.github.com>
(cherry picked from commit 46f03b8748)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-25 10:49:46 +00:00
7487 7fb7e9dece fix(gateway): copy allowed routes for the edge listener
The edge listener retained the renderer's local allowed-routes value,
while the apex and child listeners already owned independent copies.
Give edge the same ownership so later changes to the local value cannot
reach a rendered listener. The rendered Gateway remains unchanged.

Fixes #4118

Assisted-by: LLM
Signed-off-by: 7487 <1042653432@qq.com>
(cherry picked from commit 79e1fb444c)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-25 10:49:45 +00:00
somaz 9037cf175e fix(gateway): skip a child apex the wildcard certificate already covers
In DNS-01 mode every inheriting child tenant's apex went into the
parent Gateway's wildcard Certificate. When a wildcard in the same
Certificate already covers that apex one label up, Let's Encrypt
refuses the whole order as redundant and the parent Gateway gets no
certificate at all. Skip such a SAN, matching the single-label check
Boulder runs in wildcardOverlap.

A child may also use a broader custom domain than the gateway. Its
wildcard then covers the gateway apex, so the same check drops the
gateway SAN too.

Closes: #5125
Co-authored-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
Assisted-by: LLM
Signed-off-by: somaz <genius5711@gmail.com>
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
(cherry picked from commit 8382ed1a92)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-25 10:49:44 +00:00
Andrey Kolkov 0bd46bc014 fix(backups): enforce the Velero deletion backoff of failed BackupJobs
The retry backoff of the failed-job sweep only set RequeueAfter. Writing the
retry counter onto the BackupJob triggers a reconcile at once, since the
BackupJob watch has no predicate. When Velero processes a request instantly,
as it does when the backup storage location is missing or read-only, that
reconcile replaced the request again, emitted another event and raised the
counter without any wait. The sweep now records when it last created a
request, in the backups.cozystack.io/velero-deletion-attempted-at annotation,
and replaces a processed request only after the backoff for the current
count has passed since then. Before that, it requeues for the remaining
time.

A request Velero never processes, because Velero is down, and a Velero
backup stuck in New or with no phase were checked at a fixed interval,
each check with an uncached list of Backups. They are now checked again
after as long as they have already waited, from the request's or the
backup's creation time, capped at one hour. Waiting emits no event.

Recording the attempt can fail after the request was created. If the job
was deleted meanwhile, the sweep ends without an error. Any other error is
logged and the computed requeue is kept, because failing the reconcile
would only retry sooner.

Unit tests drive the clock through two back-to-back reconciles of an
instantly processed request (one replacement, one event), then three
retries at 10, 20 and 40 minutes. They also check the waiting intervals for
requests and backups of different ages, and both annotation write errors.

Refs: #5355
Assisted-by: LLM
Signed-off-by: Andrey Kolkov <androndo@gmail.com>
(cherry picked from commit dbc088f862)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-25 10:15:41 +00:00
Andrey Kolkov e8cec92626 fix(backups): retry stuck Velero deletions of failed BackupJobs and report them
Velero marks a backup Deleting before it removes the data and leaves it in
that phase when removing the data fails, with the deletion request
processed with errors. The failed-job sweep skipped Deleting backups and
did not requeue for them, so their data stayed in the bucket until
Velero's TTL. Deleting backups now go through the same request path: a
pending request is left alone, and a processed one of ours is replaced.

A request of ours that Velero processed without errors is also replaced
when the backup still exists, for example after the BSL sync brought it
back. Otherwise the request name blocked a new attempt until Velero
garbage-collects processed requests a day later.

When Velero can never carry out the deletion, because the backup storage
location is missing, read-only or unavailable, the sweep replaced the
request every 5 minutes without any sign of it. Each replacement now
emits a VeleroBackupDeletionFailed Warning event on the BackupJob with
Velero's status.errors, and doubles the requeue interval from 5 minutes
up to 1 hour. The count is kept in the
backups.cozystack.io/velero-deletion-retries annotation, because the
replaced request is gone and a requeue carries no state. The
controller's ClusterRole already allows patching BackupJobs.

Unit tests cover a Deleting backup with a pending request and with an
errored one, a cleanly processed request whose backup still exists, an
errored request under a foreign name that is left alone, three
consecutive failed deletions (three events, 10m, 20m and 40m requeues,
the 1h cap), and a cluster without the Velero CRDs.

Refs: #5355
Assisted-by: LLM
Signed-off-by: Andrey Kolkov <androndo@gmail.com>
(cherry picked from commit 73df99b77d)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-25 10:15:41 +00:00
Andrey Kolkov e1d3161e75 fix(backups): keep completed Velero backups of failed BackupJobs
The failed-job sweep treated a Completed Velero backup as deletable. A
BackupJob can fail after Velero completed, when creating or recording its
Backup fails transiently, and that Velero backup may be the only copy of a
good backup. The sweep now deletes only Failed, PartiallyFailed and
FailedValidation backups, also when several Velero backups reference one
job, and it reads the Backups that may reference them through the uncached
API reader, so a Backup the cache has not seen yet still protects its data.

The Velero strategy no longer requests the deletion before it records the
failure. If that status write failed, Velero removed the backup and the
retried run created a new one, so the failure was lost. The deletion now
comes only from the sweep, which runs on the reconcile that the persisted
Failed phase triggers; the BackupJob watch has no predicate that drops
status updates.

Replacing a request that Velero processed with errors deletes it, and the
backupstrategy-controller ClusterRole only allowed create, get, list and
watch on deletebackuprequests. That Delete failed with 403, and since the
Backup finalizer uses the same helper, a Backup deletion could get stuck
on it. The rule now includes delete.

Nothing watches DeleteBackupRequests, so the sweep did not run again after
Velero processed a request with errors. A Failed job now requeues every
5 minutes while a failed Velero backup of it remains, which replaces such a
request, and every minute while one is still running, instead of every 5
seconds.

Unit tests cover a rejected Failed status write, Completed, Deleting and
FailedValidation backups, a request processed with and without errors, the
UID precondition on the replacement, a Backup visible only to the uncached
reader, and API errors from the helper.

Refs: #5355
Assisted-by: LLM
Signed-off-by: Andrey Kolkov <androndo@gmail.com>
(cherry picked from commit 887453c008)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-25 10:15:41 +00:00
Andrey Kolkov eeab99ae1a fix(backups): delete the Velero backup of a failed BackupJob
When a Velero strategy run ended Failed or PartiallyFailed, no Backup was
created, and the Backup finalizer was the only code that asked Velero to
delete backup data. The failed backup.velero.io object, labelled for the
BackupJob but not owned by it, stayed in the bucket with its partial
resources and logs until Velero's TTL (720h by default) expired it, and
deleting the BackupJob did not remove it.

The strategy now requests the deletion through a DeleteBackupRequest before
it marks the job Failed, and the failure message is still read from the
Velero backup first. A direct delete is not enough, because the BSL sync
recreates the object from the object store. A reconcile of a Failed
BackupJob, which used to return at once, now requests deletion of every
Velero backup still labelled for the job. That retries a request that could
not be created and removes backups that earlier versions leaked, after an
upgrade. A Velero backup that a Backup references (the job failed after its
Backup was created) is left alone, and one still running is polled until
Velero accepts a request for it. The sweep matches on the job labels, so it
also covers the Velero backup of a failed Kubernetes strategy run.

The request is named after the Velero backup, and the Backup finalizer uses
the same helper, so repeated reconciles converge on one request. Nothing is
created while another request for the backup is pending. A request that
Velero processed with errors is replaced, because Velero keeps it for a day
and its name would block the retry until then. A job with more than one
Velero backup now fails with a message that names them, not with an empty
one.

Fake-client unit tests cover Failed and PartiallyFailed runs, a repeated
reconcile, leftovers of already Failed jobs (no request, a pending request,
a request processed with errors, a Backup-referenced backup, a running
backup) and the unchanged Succeeded path.

Closes: #5355
Assisted-by: LLM
Signed-off-by: Andrey Kolkov <androndo@gmail.com>
(cherry picked from commit 5fbf7e9a38)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-25 10:15:41 +00:00
Yan Bondarenko 0755bb50b9 fix(workloadmonitor): keep a bucket not ready until its claim is provisioned
A bucket WorkloadMonitor has no pods and minReplicas 0, so it stayed
operational, and the Bucket app stayed Ready, while its BucketClaim was
never provisioned. A tenant whose nearest S3 ancestor runs no SeaweedFS
gets a claim for a bucket class that does not exist, and the dashboard
showed a ready bucket that was never created.

Assisted-by: LLM
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
(cherry picked from commit 9d33037566)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-25 10:15:40 +00:00
Alexey Artamonov d78b9294ac fix(clickhouse): keep a run's archive name within the old name's length
The archive name is part of every object key, a key is capped at 1024
bytes, and the legacy s3PathOverride prefix has no length limit. The
full UID made the name 37 characters longer than before, so a prefix
that fit the old name pushed the manifest key past the cap and failed
the backup.

The run's name now drops "clickhouse-" and the "T" and "Z" of the
timestamp and spends the room on the first 12 hex digits of the UID,
so it is exactly as long as the old name for every application.

Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit 5a95bcdd64)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-25 10:15:39 +00:00
Alexey Artamonov 7fd7b59dd4 fix(clickhouse): match a backup Job's archive by its whole name
The archive a backup Job carries was found as a substring of its Pod
spec. The name without the BackupJob's UID starts the name with it,
and a strategy may append to either, so a Job that wrote a longer
archive could get the shorter name recorded on its Backup, and a
restore of that Backup would read another archive.

Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit 2046649b4c)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-25 10:15:39 +00:00
Alexey Artamonov d677869549 fix(clickhouse): keep the archive name of a backup running across the upgrade
A backup Job created before archive names carried the BackupJob's UID
writes its archive under the name without it, and the Job is not
re-rendered when the controller is upgraded. Matching only the new
name left that Backup with no archive recorded, so its restore fell
back to guessing by timestamp.

The name without the UID is matched second, because it is a prefix of
the one with it.

Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit fc15ed7171)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-25 10:15:39 +00:00
Alexey Artamonov 2660954027 fix(clickhouse): give every backup run an archive of its own
An archive was named from the application and the BackupJob's start
time, which has one-second resolution. Two runs of one application
started in the same second, as two Plans on the same schedule are,
wrote the same archive. The strategy takes a finished upload of its
archive as an earlier attempt of its own run, so the later run could
succeed on the other run's upload and record an archive missing any
table created since.

The BackupJob's UID now ends the name. It goes after the timestamp so
names keep sorting chronologically, and the restore of a Backup that
records no archive, which accepts only a bare timestamp after the
release prefix, never picks one of these.

Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit 1291e616c7)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-25 10:15:39 +00:00
Alexey Artamonov e59a9db440 fix(seaweedfs): keep bucket lifecycle enforcement off unless enabled
The daily walk that expires objects sends its deletes without an object
identity, and the s3 server skips its compare-and-swap when none is
given (walker_dispatcher.go and identityMatches, unchanged from 4.45
through 4.52). It does not re-check the object's age either, so a key
overwritten between the walk's listing and the delete loses its new
content. Backup buckets write unique keys and barely meet that window;
a tenant bucket that rewrites a fixed key does.

Turning enforcement on by default would also start applying, on
upgrade, every rule that was stored and ignored until now. Both are
retention changes an operator should choose, so the admin server and
the worker now run only where lifecycle.enabled is set. On by default
can return once the walk carries identity.

Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit 62b4213784)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-25 10:15:37 +00:00
Alexey Artamonov ae779b1416 docs(backups): say who applies a bucket lifecycle rule
The notes that send a tenant to a bucket lifecycle rule for a backup
object Cozystack leaves behind read as if some policy were already in
place. None is: the rule has to be set on the bucket, and it is applied
only by an object store that implements lifecycle, which the bundled
SeaweedFS now does once a day while lifecycle.enabled is on.

Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit 27e0aa2880)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-25 10:15:37 +00:00
Timofei Larkin 5f025e9d80 fix(lineage-webhook): keep a rendered false only on create
The cacert controller re-runs admission after a selector change by
dropping managed-by-cozystack and keeping the other labels, so the
UPDATE carries the "false" this webhook wrote on an earlier admission.
Reading that as the chart's narrowing froze the old verdict: a
projection, once revoked, could not be granted again. The chart's
narrowing only matters on CREATE, since an existing Secret already
carries managed-by-cozystack and skips the webhook.

Assisted-by: LLM
Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
(cherry picked from commit 730fd5ebf5)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
2026-11-25 09:58:12 +00:00
Timofei Larkin 84e68279f1 docs(lineage-webhook): cut the rationale from the verdict comment
Comments carry the mechanism, not the reason the change was made; the
reason is in the design doc and the PR.

Assisted-by: LLM
Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
(cherry picked from commit d687e73fd4)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
2026-11-25 09:58:12 +00:00
Timofei Larkin 07a0819604 fix(lineage-webhook): keep an explicit tenantresource false
The webhook computes the tenantresource verdict from the ApplicationDefinition selectors on first admission and copies it over whatever label the chart rendered, so a chart cannot take a Secret the definition still selects off the tenantsecrets projection. The credentials conversion in design-proposals/user-secrets-api needs exactly that during its migration window: the converted chart renders the platform-only credentials Secret with tenantresource false while the old definition still selects the name.

A rendered false is now kept; a rendered true is still replaced by the computed verdict, so the object can only narrow what the definition grants, never widen it.

Assisted-by: LLM
Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
(cherry picked from commit 7b214464ee)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
2026-11-25 09:58:12 +00:00
Mattia Eleuteri ab222a9257 test(controller): exercise the missing-root-LimitRange path under a compute-limit quota
TestReconcile_PoolRootWithoutLimitRange declared its root quota on cpu,
which the compute-limit gate does not count, so the sweep never looked
for the root's LimitRange and the test passed whatever that path did.
Declaring limits.cpu makes it reach the lookup, and it now fails if a
missing root LimitRange produces an empty copy.

Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit cc412d44f2)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
2026-11-25 09:58:10 +00:00
Mattia Eleuteri c1fb228489 fix(controller, platform): copy the LimitRange only under a compute-limit quota
The tenant chart renders tenant-range-limits under any non-empty
resourceQuotas, including one that bounds no compute, such as
services.loadbalancers alone. Copying it into an unbounded member whose
allocated quota bounds neither limits.cpu nor limits.memory imposes a
128Mi default memory limit the quota never asked for: a container that
requests more and sets no limit, virt-launcher among them, is refused
where it was admitted before. Only a quota on limits.cpu or
limits.memory makes admission reject a container that omits a limit, so
the copy is now limited to that case, and removed otherwise.

Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit e6127f7e42)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
2026-11-25 09:58:09 +00:00
Mattia Eleuteri 3c85446337 fix(controller, platform): give unbounded pool members the root's LimitRange
The tenant chart renders the tenant-range-limits LimitRange only next to
the tenant-quota of a tenant that declares resourceQuotas. Since quotas
became hierarchical, an unbounded sub-tenant shares its parent's pool
and gets a controller-owned tenant-quota-allocated ResourceQuota, but
still no LimitRange. A ResourceQuota on limits.cpu or limits.memory
makes admission reject any container that omits that limit, and with
no LimitRange nothing fills it in. Pods that ran before the quota was
introduced fail as soon as they are recreated; the barman-cloud plugin
sidecar, which sets no CPU limit, takes every backed-up postgres
instance in such a namespace down on its next restart.

The controller already knows which namespaces it clamps, so it copies
the pool root's chart LimitRange into each unbounded member, under its
own name so that Helm can still create the chart object if the tenant
later declares a quota of its own, and removes the copy once the
namespace leaves the pool.

Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit c368c48fd8)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
2026-11-25 09:58:09 +00:00
Mattia Eleuteri b24a55b702 fix(backups): give the barman-cloud sidecar an explicit CPU limit
The sidecar was left without a CPU limit so that a throttled sidecar
would slow WAL archiving down rather than fail it. In a tenant with
resourceQuotas that does not hold: the tenant LimitRange gives every
container a 250m CPU limit by default, so the sidecar gets it and
compresses full backups and WAL segments on a quarter of a core. A
1.6 GB database took 30 minutes to back up.

Set an explicit one-core limit in both places that build the sidecar
configuration, the backup driver and cozy-lib, the same way the memory
request and limit already override the LimitRange defaults.

Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit f1dd2d17fc)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
2026-11-25 09:58:06 +00:00
IvanHunters 9cff86f851 fix(marketplace): fail closed on an unparseable verified digest, and cover the generation gate
A verified cosign signature whose manifest digest could not be parsed fell back
to an unpinned tag pull, which reopens the tag-mutation window the verification
was meant to close. Return an error instead.

Add a test that isolates the status.observedGeneration == metadata.generation
conjunct of artifactReady; the existing tests exercised only the tag-prefix
conjunct, so a mutation of the generation check went uncaught.

Assisted-by: LLM
Signed-off-by: IvanHunters <xorokhotnikov@gmail.com>
(cherry picked from commit 09b0688abd)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-10 12:52:38 +00:00
IvanHunters e2f87c0cd7 fix(marketplace): pin a tap digest only from a current-generation artifact
The materializer pinned whatever digest status.artifact reported, even when the
artifact still described the previous reference. On a re-connect to a new tag,
source-controller has not re-resolved yet, so the operator materialized and
pinned the old tag's content (issue #4979). Gate materialization and pinning on
the artifact reflecting the current spec: status.observedGeneration equals
metadata.generation, and for a tag-only source a revision that belongs to that
tag (<tag>@<digest>).

A tap connected before digest pinning existed already has its
materialized-revision equal to the artifact revision, so Reconcile short-circuited
and never pinned, letting it follow the tag one more time. Pin the current digest
before that early return.

Assisted-by: LLM
Signed-off-by: IvanHunters <xorokhotnikov@gmail.com>
(cherry picked from commit 7494d1fad2)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-10 12:52:37 +00:00
IvanHunters 07cd563436 fix(marketplace): pin a tag-following tap source to the resolved digest
A tapped repository followed a mutable tag: the OCIRepository carried only
spec.ref.tag with a 5m interval, so Flux re-pulled whatever the tag pointed
at, and a moved tag reached running tenant application instances within the
interval. Whoever controlled the tag controlled what ran in the cluster.

The materializer now pins the source to the digest Flux resolved for the
artifact it just verified: it reads the manifest digest from
status.artifact.revision (source-controller formats an OCI tag revision as
'<tag>@<digest>') and writes it to spec.ref.digest, which Flux resolves
ahead of the tag. The tag is kept informational. Moving the tag upstream no
longer changes what the cluster pulls; an explicit re-connect is required to
move the pin. A user-supplied explicit digest is never rewritten, and a
revision without a well-formed digest leaves the source following its tag
rather than writing a malformed reference.

Assisted-by: LLM
Signed-off-by: IvanHunters <xorokhotnikov@gmail.com>
(cherry picked from commit c837838cc2)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-10 12:50:17 +00:00
Alexey Artamonov ef3de554b9 docs(mariadb): list the operator's Failed reason on the Complete condition
The reason list read as everything the operator writes on Complete,
yet mariadb-operator also sets Complete=False with reason Failed when
a run fails before or outside its Job. A reader taking the list as
exhaustive would treat Failed as an unknown reason, or make it
terminal, while the operator retries those failures. A table row pins
that the driver keeps waiting on it.

Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit 5f0da5a09a)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-10 12:40:57 +00:00
Alexey Artamonov 7532e4bae0 fix(mariadb): keep the operator's message in deadline failures
The operator sets Complete=False with reason Failed and its own cause
in the message ("Error creating Job", "Backup not complete") when a
run fails before or outside its Job. Such a run waits out the
deadline, and the deadline failure kept only the status and reason,
so the BackupJob or RestoreJob ended without the one line that says
why.

Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit 69cea9ccbd)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-10 12:40:56 +00:00
Alexey Artamonov 192e4c9052 fix(mariadb): report the operator Job's own failure on JobFailed
The operator's JobFailed condition message is only "Failed", and with
the operator's default restartPolicy OnFailure the Job controller
deletes the pod once the backoff limit is spent, before the operator
sets JobFailed. Pointing the reader at the Job's logs therefore sent
them to logs that no longer exist. The Job, which the operator names
after the Backup or Restore, keeps its Failed condition with the
reason and message, so the BackupJob or RestoreJob now carries those
instead; a Job that cannot be read is named in the message rather
than dropped.

Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit 9f51b9db04)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-10 12:40:56 +00:00
Alexey Artamonov 107271f6f6 test(mariadb): cover the absent Complete condition and expired deadlines
Every first reconcile after the operator Backup or Restore is created
sees no Complete condition, and the guards that keep that case from
dereferencing nil could be dropped with the outcome tables staying
green. The tables now also cover the deadline failure for a run that
never reports a known reason, and read the job status back from the
API, so a lost status write fails them instead of passing on the
in-memory object.

Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit 7e1fc7173c)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-10 12:40:56 +00:00
Alexey Artamonov 339628b71a fix(mariadb): fail backup and restore jobs whose operator Job failed
mariadb-operator reports a failed backing Job as Complete=True with
reason JobFailed, and Complete=True alone was read as success. A
backup whose dump or upload failed therefore ended Succeeded and left
a Ready Backup pointing at an archive that does not exist, and a
scheduled Plan kept producing such Backups; a failed restore ended
Succeeded too.

Success now requires reason JobComplete, and JobFailed fails the job
whatever the status.

Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
Assisted-by: LLM
(cherry picked from commit ccac0e17e9)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-10 12:40:56 +00:00
Alexey Artamonov 6645e21b9e fix(postgres): fail a backup job as soon as its cnpg Backup fails
A failed cnpg.io/Backup kept its BackupJob Running for 30 minutes as a
"transient" failure, on the premise that CloudNativePG may move a
Backup out of the failed phase. It does not: its backup controller
returns early on any Backup already failed or completed, so the wait
only delayed the verdict and hid it behind a misleading reason.

A failed Backup now fails the BackupJob at once with the error CNPG
recorded, pointing to the plugin-barman-cloud sidecar log when that
error is only the plugin's exit status. A Backup in any other phase
keeps the BackupJob waiting as before, now with a WaitingForCNPGBackup
condition naming the Backup and its phase instead of no condition at
all. It is still not capped: CloudNativePG keeps a healthy Backup
pending while another backup of the same Cluster runs or while it
restarts one, and a fixed deadline would fail those.

Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit fe6968be7f)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-10 12:40:56 +00:00
Alexey Artamonov 0ce4aa6900 fix(backups): keep forcing objects that still lack the endpoint annotation
An object without backups.cozystack.io/endpoint stopped counting as
stale as soon as one forced render had been requested, whether or not
that render succeeded. A failed upgrade left the objects unannotated
and the gate silent until the controller restarted, which also hid the
climbing force counter meant to report exactly that failure. Such an
object now stays stale until a render stamps it; MinForceInterval
already bounds the cost.

Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit ee5e51ee6c)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-10 12:40:54 +00:00
Alexey Artamonov ddb0d52d51 fix(backups): leave the credentials Secret alone when BucketInfo has no endpoint
A BucketInfo without an endpoint differs from every credentials Secret
that has one, so the gate forced the bucket release on every throttle
window. That render cannot converge: an empty endpoint would be written
into the Secret every driver reads, and with the key absent the
template's trimPrefix fails and parks the release in Failed.

Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit bd2b6c4b49)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-10 12:40:54 +00:00
Alexey Artamonov f42825dac9 fix(backups): refresh stale credentials even when the routed objects are unreadable
The credentials endpoint comparison needs only the credentials Secret and
the COSI Secret it is rendered from, yet its forced render was issued only
after the BackupClass and every routed object had been read. A missing
BackupClass or one unreadable Strategy therefore kept the old endpoint in
the credentials Secret, which the projector hands to every driver, not
just the one whose object failed.

Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit 399ccd3f4a)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-10 12:40:53 +00:00
Alexey Artamonov c0d081a6f6 fix(backups): keep repairing missing default objects while credentials lag
The credentials comparison returned early when the credentials Secret
was stale or the COSI Secret could not be read, so a missing default
Strategy or BSL was no longer created on that tick, nor on any later
one while the bucket release stayed suspended, kept failing, or the
COSI Secret stayed unreadable. Repairing missing objects is what the
gate did before the comparison existed, and it does not depend on the
answer.

Run the object check on every tick and force each release for what it
renders, reporting a comparison error alongside instead of in place of
the repair.

Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit ef7626a951)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-10 12:40:53 +00:00
Alexey Artamonov 8ae1adfb27 fix(backups): compare the credentials endpoint only for a Secret derived from COSI
backupStorage.systemSecretName may name a Secret the bucket chart does
not render from a COSI Secret: the raw COSI Secret itself, which the
projector accepts, or any Secret without the -credentials suffix. The
COSI Secret name was then the source name unchanged, so the gate
compared a Secret with itself and either reported it stale on every
tick or failed the check, and stopped repairing missing default objects
as well. Skip the comparison when there is no distinct COSI Secret or
no endpoint key to compare.

The gate compares the annotation with what the chart's endpoint
helper renders, and the helper renders a present but blank endpoint as
a bare https:// instead of falling back, so the gate has to compute
the same value or its expectation and the chart disagree for that
Secret. The gate's docs, metric help and log lines named only missing
objects, so they did not cover a stale endpoint they now report.

Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit d0f47f7dd5)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-10 12:40:53 +00:00
Alexey Artamonov e8fef61fa1 fix(backups): re-render the default backup objects when the S3 endpoint changes
The S3 endpoint the platform backups use is copied twice and neither
copy is refreshed. The COSI sidecar writes BucketInfo once per
BucketAccess, so the credentials Secret rendered from it keeps its
endpoint, and the Velero BSL and the default Strategy CRs keep whatever
endpoint the last render of backupstrategy-controller saw. The default
objects gate only acted on objects that were missing, so after a
publishing.host change every backup kept going to the old host with
nothing reporting it.

The gate now also forces a render when a copy is stale: the bucket's
<bucket>-system release when the credentials Secret's endpoint differs
from the COSI Secret it is rendered from, and backupstrategy-controller
when the endpoint an object was rendered with differs from the
credentials Secret's. That endpoint sits at a different path in every
kind, in some only as a bare host, so the chart stamps the rendered
value on each object as backups.cozystack.io/endpoint and the gate
compares that. Objects rendered before the annotation existed count as
stale until one forced render has gone through, which stamps it.

The COSI Secret itself still holds the endpoint the BucketAccess was
granted with; it follows a host change only once the BucketAccess is
re-granted.

Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit cd91138f33)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-10 12:40:53 +00:00
Myasnikov Daniil 9ded5c5fc3 fix(backups): fail a ClickHouse BackupJob whose Backup name is taken
A Backup outlives the BackupJob that made it, so a BackupJob created
again under a name already used meets the earlier run's Backup when its
own Job completes. That happens by hand, and from a Plan reconciled
again inside its starting deadline, since a Plan names each BackupJob
after its schedule slot. The Altinity driver took the earlier Backup as
its result: the BackupJob turned Succeeded with a BackupRef recording
the earlier run's archive, the archive this run wrote was recorded on
nothing, and restoring what the BackupJob reported brought back the
older data.

An existing Backup is now taken as this run's only when it records this
run's archive, which is what an earlier reconcile of the same run
leaves when its status write is lost. Any other fails the BackupJob,
naming both archives, and leaves the earlier Backup untouched.

Assisted-by: LLM
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
(cherry picked from commit d7ae34dfc3)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
2026-11-10 12:23:22 +00:00
Myasnikov Daniil b874ce10e7 fix(backups): restore the ClickHouse archive a Backup was taken as
The Altinity strategy named each archive inside its Pod with date -u
and recorded nothing on the Backup, so a restore could only guess: it
listed the remote archives under the application's prefix and took the
newest. A RestoreJob of an older Backup therefore restored whichever
backup had run last.

The controller now names the archive before it creates the backup Job,
from the BackupJob's persisted StartedAt, so every reconcile and every
retried Pod of the Job writes the same one. The name is recorded in the
Backup's driverMetadata next to the strategy parameters, and a restore
renders it into the strategy Pod, which restores exactly that archive
and fails, naming it, when remote storage no longer holds it. The name
is recorded only when the Job's Pod was given it, so a Job created by
an earlier controller, or a strategy that names its own archives,
leaves the Backup without one instead of pointing it at an archive
that does not exist.

Because a retried Pod reuses the name, it waits on an attempt the
sidecar is still running instead of being refused with 423, and asks
for resume, so a local or partial remote backup an earlier attempt left
is completed rather than refused as existing.

Backups taken before names were recorded stay restorable: the Pod picks
the newest archive whose name is stamped no later than the Backup's
takenAt, which is set only after the backup Job finished, and logs a
warning that the choice is a best effort.

Assisted-by: LLM
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
(cherry picked from commit 47b497194e)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
2026-11-10 12:23:22 +00:00
myasnikovdaniil 315b335cf7 [Backport release-1.7] fix(marketplace): do not install a connected repository's components on connect (#5117)
# Description
Backport of #5071 to `release-1.7`.
2026-10-27 12:14:59 +05:00
Myasnikov Daniil d2a452e890 fix(controller): carry healthCheckExprs and waitStrategy to existing releases
cozystack-api writes healthCheckExprs and the resolved wait strategy
from the ApplicationDefinition only when it builds a HelmRelease, and
the definition reconciler that keeps existing releases in step copied
neither. A release created before its definition exempted an object
kept waiting on that object at every upgrade. For vm-disk that is
every disk created before the DataVolume expression was added: a disk
whose import is still running after a platform upgrade fails the
upgrade at the timeout and, under RetryOnFailure, retries forever
while holding a helm-controller worker.

The reconciler now derives both fields the way the API does, in both
directions, so an existing release ends up with what a fresh write
would produce. On the shipped definitions this only relaxes waits: the
vm-disk DataVolume and the postgres KEDA ScaledObject. A release that
another chart renders carries Flux's origin label and keeps the gate
its chart sets.

A failed update used to be logged and dropped, and nothing else
re-enqueues the definition for hours, so that release stayed out of
sync. The errors are now returned and the definition is retried.

Fixes https://github.com/cozystack/cozystack/issues/4409

Assisted-by: LLM
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
(cherry picked from commit 8d8179f20a)
2026-10-27 06:50:30 +00:00
IvanHunters 25f8f11187 fix(marketplace): reconcile tap texts with no-install-on-connect
Removing on-connect auto-registration made several user-facing and doc texts
wrong: they promised that tapping registers a repository's apps in the catalog
and runs its charts. Tapping now installs nothing, so the texts told operators to
wait for apps that never appear.

Reword the `cozypkg tap`/`untap` help, the tap success output (now printing a
`cozypkg add <name>` line per materialized PackageSource), the `cozypkg init`
scaffold README, the packages-index trust model, the dashboard Repositories
banner and per-repository empty state, and the stale re-registration code
comments. No behaviour changes beyond the added `cozypkg add` hint in the tap
output.

Assisted-by: LLM
Signed-off-by: IvanHunters <xorokhotnikov@gmail.com>
(cherry picked from commit 2f39e304f0)
2026-10-26 16:11:10 +00:00
IvanHunters 0e3d2cd3d6 fix(marketplace): do not install a connected repository's components on connect
Connecting a marketplace repository materialized its PackageSources and then
auto-created a tap-managed Package per source. The Package reconciler installed
a HelmRelease for every install-marked component of the default variant, which
Flux runs under its cluster-admin service account with no impersonation. A
publisher's install chart therefore ran as cluster-admin on connect, with no
operator step, contradicting the documented behaviour that tapping installs
nothing.

Remove the on-connect auto-registration. Connecting now only materializes
PackageSources; installing an app is an explicit cozypkg add (or dashboard
action), which is the sole remaining creator of a Package. This also stops a
Package the admin removed with cozypkg del from being re-created on the next
source revision.

Catalog population from PackageSource metadata without an install is left to
the long-term design in #4359, and the privileged-confirmation gaps #4358 and
#4359 stay open.

Assisted-by: LLM
Signed-off-by: IvanHunters <xorokhotnikov@gmail.com>
(cherry picked from commit 3fa534f3cf)
2026-10-26 16:11:10 +00:00
Mattia Eleuteri 691d7bce03 docs(backups): say CDI adopts a restored PVC through the DataVolume
The restore controller and the user-restore example described the
allowClaimAdoption annotation its resource modifiers put on restored
PVCs as what lets CDI adopt them. CDI v1.66 reads that annotation only
on the DataVolume; on a PVC it reads nothing but createdForDataVolume.
Adoption rests on the vm-disk chart annotating the DataVolume Flux
recreates, and a reader trusting the PVC rule could rely on it for a
restore without such a DataVolume, or drop the DataVolume annotation as
redundant.

Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit b5d7e43c49)
2026-10-23 12:45:00 +00:00
Andrey Kolkov da209397a2 fix(backups): prepare standalone VMDisk restore targets before the data mover runs
collectUnderlyingResources returned nothing for a non-VMInstance kind, so
prepareForRestore did nothing for a standalone VMDisk: no HelmRelease suspend and
no DataVolume delete. An in-place VMDisk restore then raced Flux/CDI — the
restored HelmRelease reinstalled and CDI recreated the DataVolume over the same
PVC name the data mover was repopulating, wedging the RestoreJob.

Report a standalone VMDisk's own disk as its underlying resource, so the existing
(VMInstance-proven) restore preparation suspends the vm-disk-<name> HelmRelease,
deletes its DataVolume and — with keepOriginalPVC — renames the live PVC before
the data mover recreates and repopulates it. No VM, so no IP/MAC is collected.

A VMInstance is halted before its disks are touched; a VMDisk target is not,
and every VMInstance disk is a VMDisk. Renaming the PVC of a disk a running VM
mounts leaves the original Terminating behind pvc-protection, Velero skips a
PVC that still exists, and the RestoreJob would report Succeeded having moved
nothing while the VM loses its disk on the next restart. An in-place VMDisk
restore now fails before changing anything when a Pod that has not terminated
mounts the disk's PVC, naming the Pod and telling the user to stop the VM or
restore the VMInstance instead.

A VMDisk Backup taken before the disk was recorded as its underlying
resource has none, so its disk is now derived from the application name
and such a restore is prepared and checked for a mounting Pod as well.

The per-disk orLabelSelectors stay a VMInstance concern. A VMDisk
strategy already selects its disk, and Velero rejects a Backup or
Restore that carries both labelSelector and orLabelSelectors, so
appending them for a VMDisk would break a strategy written with
labelSelector.

When an in-place restore fails after preparation, nothing is rolled
back: resuming the disk's HelmRelease while its PVC is renamed and its
DataVolume deleted would have CDI import a fresh disk under the original
name, which looks healthy and hides that the data sits in the -orig-
PVC. The failure message and a Warning event now name the suspended
HelmReleases and the -orig- PVCs so the user can recover them, read back
from the cluster, so a failure before a step ran does not name what it
would have left.

Preparation takes the target apart before Velero validates the Restore,
so it is refused up front when the Velero Backup is gone or not
Completed. That check now runs on every pass behind the same failure
path as the rest of preparation, and a FailedValidation Restore fails
the RestoreJob like a Failed one instead of leaving it Running. A
HelmRelease suspend or a VM halt that did not happen now stops
preparation instead of renaming and deleting under a running release or
VM, and a VMInstance's disks are renamed only once its launcher Pod has
let go of them. A VMDisk held only by a Pod already being deleted is
waited for rather than refused, for
up to 30 minutes after the RestoreJob started.

Between renaming a kept disk's PVC and deleting its DataVolume, CDI can
recreate an empty PVC under the original name. Velero then skips the
PVC as already present, the RestoreJob reports Succeeded and the VM
boots a blank disk. Once the DataVolume is gone, preparation now
deletes a PVC found under the original name, read uncached, before the
Velero Restore is created.

Preparation spans several reconciles, so the RestoreJob records a
PreparationStarted condition before it first changes the target, and
retries without changing anything when recording it fails. A
refusal on a later pass (the Velero Backup expired, a VM started on the
disk) then names what preparation left behind instead of claiming that
nothing changed, and a preparation still waiting 30 minutes after it
started fails the same way instead of polling forever.

Now that a VMDisk target is prepared, keepOriginalPVC=false reaches it
too: its DataVolume is deleted with orphan propagation and the bound PVC
is deleted before the Restore, as for a VMInstance disk. Left in place,
Velero would skip it and CDI would refuse the DataVolume the resumed
HelmRelease creates.

Assisted-by: LLM
Signed-off-by: Andrey Kolkov <androndo@gmail.com>
(cherry picked from commit 9af1c0f902)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-10-21 13:46:50 +00:00
Andrey Kolkov 82af1a457b feat(backups): back up Valkey with the Redis strategy
Valkey runs on the same spotahome RedisFailover operator as Redis and
speaks the same replication protocol and RDB format, so it needs no
strategy kind of its own. The only difference the backup Job sees is the
chart's resource-name prefix: valkey-<app> instead of redis-<app> for the
sentinel Service and the auth Secret.

The Redis driver now accepts applicationRef kind Valkey as well as Redis
and hands the template .Release.Prefix, derived from the app's kind, which
cozy-default-redis uses for every name it builds. A kind with no known
prefix fails the render instead of producing an empty one. cozy-default
routes apps.cozystack.io/Valkey to cozy-default-redis. A restore must
target an app of the same kind as the backup's source: replaying a Redis
dump into Valkey, or the reverse, is not something the strategy can
promise across engine releases.

The shipped template reads the prefix as `.Release.Prefix | default
"redis-"`: during an upgrade the previous controller, which has no Prefix
in its render context and serves only Redis, renders the new CR, and a
bare reference would print "<no value>" into the names.

The redis:8 image already loads RDB v11, which both shipped Valkey
versions (7.2, 8.1) write.

Signed-off-by: Andrey Kolkov <androndo@gmail.com>
Assisted-By: LLM
(cherry picked from commit 0c2f131192)
2026-10-21 10:57:11 +00:00
Alexey Artamonov 4323363870 test(vm-disk): pin the importer error against a real stuck DataVolume
The table test builds its Running conditions by hand, so it can only
confirm the shape it already assumes. A DataVolume read off a cluster
where the importer had failed on a 404 for days carries a Bound
condition with the same error, which the message must not pick up, and
proves the error sits where the controller looks for it.

Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit 970ccc2578)
2026-10-21 09:16:57 +00:00
Alexey Artamonov 095d9a189f fix(vm-disk): name the importer error in the disk's WorkloadsReady message
A disk whose HTTP source answers 404 or does not resolve never leaves
ImportInProgress: CDI fails an import only on a fatal error and restarts
the importer pod otherwise, so the condition only ever said the disk was
still importing. The reason it will not finish was visible only in the
importer logs and on the DataVolume, whose Running condition carries the
error through the back-off between restarts.

Appending that message lets the user see why the disk is stuck from the
application status and the console, which already shows the
WorkloadsReady message for a disk.

Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit 0b9a801a2b)
2026-10-21 09:16:57 +00:00
Alexey Artamonov 683e80ba0c fix(fluxcd): give each release its own share of the hook's retries
The pre-delete hook's retry budget was one window spent in listing
order, so a release that could never be read or unfenced, listed
first, took all of it and every release after it got a single attempt.
The same transient failure then released a fence or not depending on
where its release sorted. Each release now gets its own share of the
window, capped at the window's end, and the steps that cover every
release keep the whole of it.

Two comments said more than holds. The retry window is measured from
the script's start, not the Job's, so scheduling and the image pull come
out of its one-minute reserve rather than being covered by it. And the
five-minute conflict retry inside kubectl scale never runs here, since
without a precondition it sends a merge patch with no resourceVersion
to conflict on.

helm-controller's finalizer, which the hook reads to tell whether a
release being deleted is still held, is now tied to the constant the
controller uses, as the fence already was.

Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit 699555c7cb)
2026-10-20 12:44:59 +00:00
Alexey Artamonov 18c5acae7b fix(fluxcd): warn about a foreign suspension only on a stuck release
flux-plunger raised its SuspensionNotOwned and TerminatingWhileSuspended
Warnings on a suspension it does not own when the release carried its
processed-version annotation. That annotation is never removed, so
every later suspension of such a release, by a migration, a backup
restore or an operator, drew a Warning: one telling the reader to
resume it, which mid-restore is the one thing nobody wants, and one
calling a migration's deliberate suspend-then-delete an accident. Both
also missed the leftover they are for when the first recovery stopped
before writing the annotation.

A suspension an earlier flux-plunger left mid-recovery freezes the
release in the failure recovery started from, since helm-controller
rewrites no condition of a suspended release. Both Warnings now key on
that state instead, and the README's candidate query with them.

Two comments are qualified where they claimed more than holds: a stop
that overran the manager's grace period can still let a reconcile set
a fence after the drain's last listing, and a process stopped before
controller-runtime closes Elected holds the Lease yet does not drain.

Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit 7b84919db3)
2026-10-20 12:44:59 +00:00