mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-30 04:06:34 +09:00
2d8af2bfe8a3451bf33410266aa66caeefeec2aa
902
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
2d8af2bfe8 |
feat(api): check GPU budgets when a VM or a worker pool is written
GPU budgets are not pod resources, so ResourceQuota cannot enforce them. Until the pool-wide admission gate is available, the API server needs to check declared class reservations to avoid accepting applications that exceed a tenant's budget. Reusing its inputs and pool arithmetic keeps the eventual switch from changing admission decisions. Tenant quota allocation must account for those reservations because ResourceQuota usage cannot report them. Ordinary-resource accounting must retain GPU-only descendants in the parent's pool, matching the tenant chart and runtime controller. Unsupported keys in the GPU budget domain must not create an unenforced promise when the chart omits them. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <f@lex.la> |
||
|
|
5d381360c6 |
docs(gpu): define the class admission and licensing contract
The admission webhooks, license copier and budget checks depend on the same class annotations, names and ownership rules. Keep their contract next to the shared constants, including where name acknowledgement ends and capacity scheduling begins. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <f@lex.la> |
||
|
|
4cb240a500 |
feat(gpu): share resource-name ownership and capacity rules
The GPU components need consistent answers about catalog-name ownership, free units, budget keys and tenant entitlement. An acknowledged name belongs to its object UID even when an older class changes its request. Only an exact, unique acknowledgement confirms ownership; creation time selects candidates for unreserved names, and duplicate acknowledgements stay ambiguous. These snapshot rules do not fence future status writes or reserve GPU capacity. Free units come from node allocatable and pod requests. A finite NoExecute toleration cannot make a node an enduring placement option, but a matching toleration without an expiry can. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <f@lex.la> |
||
|
|
7554abf715 |
feat(api): add the GPUClass catalog to cozystack.io
GPU offers need stable names for tenant budgets and billing while the host layer can change its device-plugin resource names. Publish the offer metadata and a UID-scoped acknowledgement of the underlying resource name, separate from readiness and from GPU capacity. Keep immutable offer details on the class, require a profile for vGPU, and retain the CRD on chart uninstall. The shipped-schema tests exercise create, update and status preparation through the apiserver strategies, including malformed fields and status isolation. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <f@lex.la> |
||
|
|
9cf93b8535 |
fix(postgres): keep bullseye clusters on their image until a clean locale check (#5472)
## What this PR does Refs #5459. Part of bringing #5405 (standard-trixie images) back to release-1.7, which #5461 reverted. This PR covers the `C.UTF-8` item of #5459 by keeping such clusters off the new image. The other items are fixed separately: the repair racing the rollout and the Job budget, the repair skipping `C.UTF-8`, the double REINDEX, and the postgis extension update. ### Why Clusters created before #5405 run a bare tag, the system variant on Debian bullseye. Moving them to `standard-trixie` changes glibc and ICU under the data directory. The collation repair pass from #5405 cannot see every case. A libc `C.*` locale such as `C.UTF-8` carries no collation version in any PostgreSQL major, yet Debian bullseye's `C.UTF-8` and the one in glibc 2.35+ sort differently. Until the indexes are rebuilt, replicas return wrong results through `-ro` and unique indexes accept duplicates. PostgreSQL ([Locale data changes](https://wiki.postgresql.org/wiki/Locale_data_changes)) and CloudNativePG ([postgres-containers](https://github.com/cloudnative-pg/postgres-containers): switching the Debian base "is a manual operation because of PostgreSQL locale-data implications") both treat this as a deliberate, owner-driven step. ### What it does A cluster on one of the bare bullseye tags the chart shipped (13.22, 14.20, 15.15, 16.11, 17.7, 18.1) stays on its image until a check finds it clean. The check fails closed: a cluster not checked yet, one the check could not finish on, and one it found affected all stay. - **The check.** A `pre-upgrade` hook (`locale-check-<release>-<hash>`) runs before every upgrade of such a cluster, from the cluster's current image. - It looks in every database for columns, indexes, composite or range types, and `jsonb` indexes that depend on a collation other than C, POSIX or builtin, and for a database default (collate or ctype) outside those. - It records `clean`, `affected` or `unknown` in the `postgres.cozystack.io/locale-data` annotation of the Cluster, and the first objects found in `postgres.cozystack.io/locale-data-objects`. - Its Role can only `get`/`patch` that one Cluster. - **What the chart renders.** The chart reads the recorded answer through `lookup`. Helm renders before hooks run, so the hook fails an attempt only when the new answer contradicts that render, before the Cluster is patched. The HelmRelease retry then renders according to the new answer: - A cluster not checked before, or found `affected` or `unknown`, is rendered on its current image. The upgrade passes, and every other value of the app still applies. - A cluster found `clean` fails that attempt once, and the retry moves it to `standard-trixie` with the existing repair. - **Opt-in.** `allowCollationChange: true` moves a held cluster on the next upgrade, in a window the owner picks. - **Version changes.** A held cluster refuses a change of `version` with an explicit render error, since new majors are built only on the new images. - **Restore.** The CNPG backup driver copies the source Cluster's `spec.imageName` into the backup snapshot verbatim, passes it to the restore as `bootstrap.sourceImageName`, and clears it with `bootstrap.enabled`. The core controller knows nothing about the chart's hold rules. - The chart decides: a backup taken on one of the bullseye tags restores onto that image, so the data keeps the library that built it. - The next upgrade then checks the restored data like any other bullseye cluster. - Any other value is ignored, so a tenant cannot choose an image through it. - The driver also reads the major from that image tag when the backup recorded none, and refuses a mismatch with `spec.version` before the purge. ### What a held cluster is left with - It keeps running its bare bullseye tag. Upstream builds new PostgreSQL minors only on bookworm and trixie, so a held cluster gets **no further minors and none of their security fixes; CVE-2026-116331 stays open on it** for as long as it is held. - The tenant sees only that the image did not change. The answer and the objects found are on the cnpg.io Cluster, which only an administrator can read. - There is no deadline. The hold lasts until the owner takes one of the ways out below. ### How a held cluster leaves that state 1. **Remove the dependency.** Move the listed columns and indexes to `C`, or to the builtin `pg_c_utf8` on PostgreSQL 17 and later, or drop them. The next upgrade checks again, finds the cluster `clean` and moves it. 2. **Move explicitly.** In a maintenance window, set `allowCollationChange: true`. The next upgrade moves the cluster and the init Job's repair rebuilds indexes on versioned collations (ICU, libc locales other than `C.*`). Until the separate `C.UTF-8` repair fix lands, rebuild indexes on `C.UTF-8` or another `C.*` locale by hand with `REINDEX INDEX CONCURRENTLY`. Range partitions, CHECK constraints and materialized views on such text are not fixed by a rebuild and need a logical move (pg_dump/restore or logical replication). During the move, replicas restart on the new image first, so reads through `-ro` can be wrong and unique indexes can accept duplicates until the primary's rebuild is done. ### Testing - `helm unittest packages/apps/postgres`: 276 passed, including `tests/locale_guard_test.yaml`. It covers: - holding on `affected`, `unknown` and a missing result, and moving on `clean`; - the opt-in and the version refusal; - restores from bullseye and trixie backups, hand-set recoveries, and leftover values; - ignoring foreign images, postgis, hook gating, naming and the Role scope. - `go test ./internal/backupcontroller/...` passes, including `cnpg_source_image_test.go` and the restore reconcile cases for passing the image on and refusing the held major before the purge. - The check script was run in Docker against `postgres:13-bullseye` and `postgres:18-bookworm`: - It flags `C.UTF-8`/`C.utf8` columns and defaults, ICU indexes, `en_US` defaults with text, a `C`-collate / `en_US`-ctype database with a `lower()` index, composite and range types over text, and `jsonb` indexes under a non-C default. - It reports `clean` for `C`, `POSIX`, `pg_c_utf8` and `ucs_basic`, and when another database is `default_transaction_read_only`. - It reports `unknown` on an authentication failure or when a database accepts no connections. - The record step was run with a stub `kubectl` for each render (held or moving) and answer: - held + `clean` fails the attempt; held + `affected`/`unknown` passes; - moving + `clean` passes; moving + `affected`/`unknown` fails the attempt; - every answer is recorded. - Dev cluster: apps installed from the v1.7.1 chart (`postgresql:17.7`, bullseye) and upgraded to this branch (results in the PR thread). ### Screenshots ### Downstream repositories The trigger map hits `cozystack/terraform-provider-cozystack`, because this adds `allowCollationChange` and `bootstrap.sourceImageName` to the postgres `values.schema.json`. The follow-up is cozystack/terraform-provider-cozystack#91. - [ ] No downstream repository is affected by this change - [ ] [cozystack/website](https://github.com/cozystack/website) - follow-up: - [x] [cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack) - follow-up: cozystack/terraform-provider-cozystack#91 - [ ] [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 [postgres] A cluster still on a Debian bullseye image now stays on that image until a pre-upgrade check finds nothing in it that depends on a collation other than C, POSIX or builtin (an ICU or libc locale, or C.UTF-8), or until `allowCollationChange` is set. A held cluster gets no further PostgreSQL minors or their security fixes. The `postgres.cozystack.io/locale-data` annotation of the cnpg.io Cluster shows the result of the check. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit - **New Features** - PostgreSQL upgrades from older Debian Bullseye images now check for collation-dependent data and hold the current image when results are affected or unknown. - Added an opt-in setting to allow the image change despite the collation check. Review collation and index-rebuild considerations before enabling it. - PostgreSQL restores retain source-image information to support image selection and compatibility checks. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
3add3d0a5a |
Merge commit from fork
fix(backups): confine Velero restore-copy to the tenant namespace subtree |
||
|
|
21d66c4cce |
fix(postgres): keep bullseye clusters on their image until a clean locale check
Clusters created before the move to standard-trixie run the bare tag, the system variant on Debian bullseye. Moving them changes glibc and ICU under the data directory, and the collation repair pass cannot see every case (C.UTF-8 carries no collation version), so text indexes can return wrong results and unique indexes can accept duplicates. Such a cluster now stays on its image until a pre-upgrade hook, run from that image, finds nothing stored that depends on a collation other than C, POSIX or builtin. The hook records clean, affected or unknown on the Cluster; anything but clean holds the cluster, so a check that cannot finish keeps it where it is rather than letting it move unchecked. Helm renders before hooks run, so the hook fails an attempt only when its answer contradicts what that attempt rendered, and the retry follows the answer. allowCollationChange moves a held cluster on the owner's terms, and a held cluster refuses a change of version, since new majors are built only on the new images. A physical restore replaces the Cluster that carries the answer. The CNPG backup driver records the source Cluster's image in the backup snapshot and passes it on as bootstrap.sourceImageName without interpreting it; the chart restores onto it only when it is one of the bullseye tags it shipped, and the next upgrade checks the restored data. Assisted-By: LLM Signed-off-by: Andrey Kolkov <androndo@gmail.com> |
||
|
|
9f00135618 |
feat(api): add EndpointAttachment to attach addresses to app endpoints
A managed application's tenant-facing Services are its endpoints, and the only way to publish one externally has been the chart boolean `external`, which publishes one chart-chosen endpoint on one address from no particular pool through five different render paths. EndpointAttachment attaches one address, minted from an IPAddressClass or bound from a reserved IPAddressClaim, to one tenant-facing Service by rendering an additive LoadBalancer Service that mirrors the endpoint's selector and ports. The mechanism therefore needs no per-engine render knowledge and never touches the application's own objects, and a reserved address survives every attachment and moves between applications. The Service carries the loadBalancerClass the claim's class reports in status, so it reaches the load balancer that owns the class's pool; since a Service's loadBalancerClass is immutable, nothing new is rendered before the class's provisioner accepts the class for its current generation. The rendered Service asks for the claim's IP families, since one left to the cluster's primary family cannot be assigned an address of the other. The endpoint check requires both the lineage labels and the tenantresource marker: lineage alone also covers operator-internal Services. A LoadBalancer Service a tenant Kubernetes cluster's cloud-controller-manager creates carries the cluster's labels and the marker too, so the cluster.x-k8s.io/tenant-service-name label it writes excludes it. Identity is by owner reference throughout, so a Service carrying the ownership label without the reference is never adopted, and a same-name recreated application does not inherit the previous incarnation's attachments. The VM datapath modes render the cozy-proxy Service contract unchanged and are gated on a platform declaration rather than CNI detection: a proxy skips a Service delegated to a name it does not claim while the load balancer still attracts the address. Exclusivity is keyed on the backend pod in both modes because cozy-proxy's egress map holds one address per pod, and holds IPv4 only, so a method attachment off a VPC refuses an IPv6 or Dual claim. A delegation no attachment renders, such as a chart Service with external: true, always takes the pod, since nothing would ever withdraw it; between attachments the oldest wins. A whole-IP attachment with several ready backends keeps its address dark instead of picking one. A cozyplane VPC changes that for whole-IP: the VM's only interface is in the VPC, so the launcher pod address a cozy-proxy Service maps to never reaches it. Where a backend pod carries the VM chart's sdn.cozystack.io/vpc annotation and the cluster serves cozyplane's FloatingIP, the attachment owns a FloatingIP on the VM's VPC address wearing its claim instead, and mirrors its readiness once its status is for its current generation: a re-pointed FloatingIP keeps the old target's status until cozyplane observes the change. FloatingIP is read as unstructured and used only when served, so the controller keeps no dependency on cozyplane. A live migration's two launcher pods share the VM's VPC address and count as one target, and a stopped VM keeps its binding rather than flipping to a cozy-proxy Service. Only a backend pod says whether a VM is in a VPC, so a method attachment that has published nothing yet waits for one; otherwise an attachment created before its VM starts would pin the claim to a cozy-proxy Service first. PortList is refused there: a FloatingIP binds every port and cozy-proxy cannot reach the VPC address. So is a Dual claim, since a FloatingIP wears one address. The kube-ovn VPC keeps the pod-network interface and adds VPC subnets as secondary interfaces, so the cozy-proxy path still delivers to the VM there. The e2e suite is the only one that needs the address substrate, so it owns both of its optional packages in test selection: the e2e install enables them, a selection that leaves the suite out disables them, and post-install prep gives the sandbox a default IPAddressClass on a pool MetalLB does not auto-assign from. The cozyplane VPC suite stays parked, because no e2e lane installs that networking variant. The kind lives in local.sdn.cozystack.io, the CRD-served half of the sdn family the address substrate and cozyplane share, so stock ResourceQuota counts keep working. Assisted-by: LLM Signed-off-by: Timofei Larkin <lllamnyp@gmail.com> |
||
|
|
94c79925f8 |
feat(api): add the credentials API with mint and revoke subresources (#4921)
## What this PR does Tenants read application passwords from Secrets today, and a leaked password can't be taken back. This PR adds the platform side of the user secrets API design (cozystack/community#137, ADR 0002): a password comes out once from a mint, the next mint replaces it, and a revoke kills it. The engines are converted in the PRs stacked on top, starting with Postgres in #4922. How it works: - A kind's chart renders one `CredentialTemplate` (`cozystack.io/v1alpha1`) per account: the username, the stored format (`scram-sha-256`, `mysql-native`, `sha256` or `plaintext`), labels for the account Secret, and an optional `valuesPath` for an operator that reads no Secret. - cozystack-controller keeps the account Secret `<template>.account`. It seeds it on a release the API marked for seeding, adopts an unowned Secret with the same username, leaves a foreign one alone with a `SecretConflict` condition, and mirrors the record (origin, time, actor, history) into the template status. For a `valuesPath` template it maintains an optional `valuesFrom` entry on the release. - `core.cozystack.io/v1alpha1` serves `credentials` as a read-only view of the templates, plus `mint` and `revoke` subresources. A mint checks the caller's `resourceVersion` precondition against the mirrored status, builds the whole Secret and writes it in one request, or answers 409. It never reads the Secret back. One API request writes one object; the best-effort Event is the only extra write. - The Application API marks a new release for seeding, keeps the account `valuesFrom` entries when it rewrites a release, and refuses to delete a suspended release that still has accounts, since Flux would skip its uninstall. - The dashboard gets a Credentials tab on the application page. It lists accounts with origin and history; an administrator can mint or revoke, and a viewer sees no buttons. The application charts are untouched here: a kind starts using this only when its chart renders templates. The `CredentialFormat` webhooks that ADR 0002 describes are not in this PR, so `format.name` accepts only the four built-in names for now. ### Screenshots <img width="1440" height="900" alt="01-admin-tab" src="https://github.com/user-attachments/assets/8c48086c-8f6c-4908-82c1-40e9078afe57" /> <img width="1440" height="900" alt="02-mint-dialog" src="https://github.com/user-attachments/assets/802b2963-3f57-4c0b-ab84-f74bad28c343" /> <img width="1440" height="900" alt="03-mint-result" src="https://github.com/user-attachments/assets/0e9ae3cc-7a3c-4daf-9a09-d4abf53bf70b" /> <img width="1440" height="900" alt="04-viewer-tab" src="https://github.com/user-attachments/assets/10e940f2-4ceb-469d-a0f9-6c9d20a62919" /> ### Downstream repositories - [ ] No downstream repository is affected by this change - [ ] [cozystack/website](https://github.com/cozystack/website) - follow-up: needed, cozystack/website#753 should document the `Credential` mint/revoke flow and the dashboard tab - [ ] [cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack) - follow-up: needed later, a way to mint from Terraform; nothing breaks in this PR alone - [ ] [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: none, the design is cozystack/community#137 ### Release note ```release-note feat(api): Add the credentials API. Applications that support it expose their accounts as `credentials.core.cozystack.io`; an administrator mints a password once with the `mint` subresource, and `revoke` invalidates it without issuing a new one. The dashboard shows a Credentials tab for such applications. No application uses it in this release on its own; see the per-engine changes. ``` |
||
|
|
ef32ff8d71 |
fix(postgres): bound a backup whose cnpg Backup stalls in pending (#5320)
<!-- Thank you for making a contribution! Here are some tips for you: - Use Conventional Commits for the PR title: `type(scope): description` - Types: feat, fix, security (a fix that comes through a security advisory), docs, style, refactor, perf, test, build, ci, chore - Scopes are not an exhaustive list — pick the most specific scope for the change and extend the list when a genuinely new area appears. Examples: - System components: dashboard, platform, operator, cilium, kube-ovn, linstor, fluxcd, cluster-api - Managed apps: postgres, mariadb, redis, kafka, clickhouse, virtual-machine, kubernetes - Development and maintenance: api, hack, tests, ci, docs, maintenance - Breaking changes: append `!` after type/scope (`feat(api)!: ...`) or add a `BREAKING CHANGE:` footer - If it's a work in progress, consider creating this PR as a draft. - Don't hesistate to ask for opinion and review in the community chats, even if it's still a draft. - Fixes merged to `main` reach the release lines the backport batch runs for automatically, so do not open backport PRs by hand: https://github.com/cozystack/cozystack/blob/main/docs/release/backports.md --> ## What this PR does Part of #5209. The other part, a Plan that does not start a run while its previous BackupJob is still running, follows in a separate PR. A Postgres BackupJob whose `cnpg.io/Backup` never left `pending` stayed `Running` with no bound. In CloudNativePG 1.30.0 a Backup is pending for one of two reasons: it is queued behind a started or running backup of the same Cluster (`waitIfOtherBackupsRunning`), which is healthy, or the instance to run it on cannot be found or is not ready (`startBackupManagedByInstance`), which lasts for as long as the Cluster is fenced. A restart on another instance goes through the second path too. The driver tells the two apart only by whether a backup of the Cluster is `started` or `running`; it does not model which pending Backup CloudNativePG lets through first. Each poll reads the Cluster's backups from the cache, and the job reads them again from the apiserver right before it gives up, since the cache can still show pending a backup that has just started. Behind a started or running backup the wait stays uncapped and the BackupJob says which backup it waits for. Otherwise the BackupJob records a `CNPGBackupStalled` condition, and once that has lasted the backup deadline (30 minutes, the same bound as the plugin rollout wait) the BackupJob fails with the cause, and its own `cnpg.io/Backup` is deleted so it does not run later with no Cozystack `Backup` recording it. The delete is conditional on the UID and resourceVersion the driver read, so a Backup CloudNativePG started in between is kept. The give-up is recorded before the delete, so a Backup found missing later fails the job only when the driver removed it; a Backup deleted by hand is replaced and its stall counts afresh. The stall also ends, and a later one counts afresh, as soon as the Backup moves to any other phase. The reason CloudNativePG gives (`BackupPending: Backup target pod not ready: ...`) exists only as an event on the Backup, so the condition and the failure message carry the newest Warning event recorded on the job's own Backup, or, when it carries none, on another pending backup of the same Cluster. The events are listed by the Backup's UID through the uncached reader, so the controller gains `list` on events and no watch; when the read fails, the message says so instead of omitting the reason. A job is no longer held on the plugin rollout another job started when the Cluster is fenced and every instance pod postdates that attach: a fenced Cluster is neither healthy nor ready until the fence is lifted, so waiting there would only delay the bound by up to the rollout deadline. An instance pod older than the attach still holds the job, so a Backup never starts on a pod without the plugin. The postgres e2e (`examples/backups/postgres/run-all.sh` step 26) fences the source Cluster, checks that a BackupJob reports the stall with the reason CloudNativePG recorded, which exercises the `involvedObject.uid` selector and the events grant against a real apiserver and replaces a helm-unittest that only matched the rendered rule, then lifts the fence and checks that the same job completes with the stall ended. Failing at the deadline is covered by the unit tests. Known limit, left as is: a backup of the Cluster in `finalizing` does not count as running, which only a hand-made `volumeSnapshot` Backup can reach, since platform flows create plugin backups only. ### Screenshots <!-- REQUIRED for UI changes: attach screenshots or screen recordings demonstrating the visual impact of your changes. PRs with UI changes without screenshots will not be merged. --> ### Downstream repositories <!-- Cozystack is upstream for repositories that are NOT kept in sync with it automatically, and nothing in CI compares the two sides, so a change here can break them silently. Which change forces what, and which file to touch, is the trigger map in docs/agents/contributing.md under "Downstream Repositories". Walk it before you tick anything. IF YOU ARE AN AI AGENT OR AN LLM, THIS IS PART OF THE TASK, NOT A FORM TO FILL IN: 1. Walk the trigger map against the actual diff of this PR, file by file. Do not decide from the PR title or from your memory of what you changed. 2. For every repository you tick, open the follow-up PR there and link it on the same line. A ticked box with no link claims work that does not exist, which is worse than an empty box. Search that repository for an open PR or issue covering it first, and link that instead of filing a duplicate. 3. When the follow-up is out of scope, or needs a decision that is not yours to make, open an issue in that repository instead, link that, and say so in the PR body. Do not push a speculative PR into another repository just to fill a line here. 4. Do not tick "No downstream repository is affected" to make the checklist go away. If you are unsure, leave every box empty and say so in the PR body, so a human decides. --> - [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 <!-- Write a release note: - Explain what has changed internally and for users. - Start with the same `type(scope):` prefix as in the PR title - Follow the guidelines at https://github.com/kubernetes/community/blob/master/contributors/guide/release-notes.md. --> ```release-note fix(postgres): a Postgres BackupJob whose cnpg.io/Backup stays pending because its target instance is not ready, for example while the Cluster is fenced, now fails after 30 minutes with the reason CloudNativePG gives, and the abandoned cnpg.io/Backup is removed. A Backup queued behind a running backup of the same Cluster is not affected. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Bug Fixes** * Pending backups that stall for 30 minutes now fail with a recorded reason. Backups queued behind an executing backup, progressing, or finished are not incorrectly treated as stalled. * Backup handling accounts for concurrent progress, external deletion, and retries, and reports the newest available warning for a pending backup. * Fenced clusters now use instance-pod creation time when evaluating plugin rollout readiness. * **Tests** * Expanded coverage for stalled backups, warning reporting, queue handling, and fenced-cluster backup recovery. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
cdec07d0bd |
refactor(backups): stop annotating restored PVCs for CDI claim adoption (#5428)
<!-- Thank you for making a contribution! Here are some tips for you: - Use Conventional Commits for the PR title: `type(scope): description` - Types: feat, fix, security (a fix that comes through a security advisory), docs, style, refactor, perf, test, build, ci, chore - Scopes are not an exhaustive list — pick the most specific scope for the change and extend the list when a genuinely new area appears. Examples: - System components: dashboard, platform, operator, cilium, kube-ovn, linstor, fluxcd, cluster-api - Managed apps: postgres, mariadb, redis, kafka, clickhouse, virtual-machine, kubernetes - Development and maintenance: api, hack, tests, ci, docs, maintenance - Breaking changes: append `!` after type/scope (`feat(api)!: ...`) or add a `BREAKING CHANGE:` footer - If it's a work in progress, consider creating this PR as a draft. - Don't hesistate to ask for opinion and review in the community chats, even if it's still a draft. - Fixes merged to `main` reach the release lines the backport batch runs for automatically, so do not open backport PRs by hand: https://github.com/cozystack/cozystack/blob/main/docs/release/backports.md --> ## What this PR does <!-- Link the issues this PR addresses. For a complete fix targeting the default branch, use Closes #N (Closes owner/repository#N for another repository). Otherwise use a non-closing reference; release-branch PRs need manual issue linking and closure when appropriate. --> Both Velero-based restore strategies stamp `cdi.kubevirt.io/allowClaimAdoption=true` on every restored PVC through a resource modifier. CDI never reads that annotation on a PVC. In CDI v1.66.1, the version this repository ships, `AllowClaimAdoption` in `pkg/controller/common/util.go` is the only place the annotation is read, and it reads it from the DataVolume; the DataVolume controller and the admission webhook both go through it. So the PVC rule does nothing. The VM strategy already said so in a comment and kept the rule anyway, its tests required the rule, and the Kubernetes strategy comment and the VM restore example presented it as part of what lets CDI adopt the restored claim. This PR removes the PVC rule from both strategies, the comment and example text that describe it, and flips the two tests that required it into tests that it is absent. Adoption keeps working the way it already does: through the annotation the vm-disk chart sets on its DataVolume, and for tenant Kubernetes clusters through the modifier rule that sets it on restored DataVolumes. That rule had no test; a new one pins it as the only rule of the volumes phase. Restored PVCs no longer carry the annotation. Nothing in CDI reads it there, so a restore behaves the same before and after. The PVC rule was also the only unconditional rule of the VM strategy. Without it, an in-place restore of a VMDisk, or of a VMInstance with no recorded IP and MAC to keep, has no rules at all, and Velero fails validation of a Restore whose modifier ConfigMap has an empty rule list (`resource modifier rules cannot be empty`). So `createResourceModifiersConfigMap` now returns nil in that case, and the Restore is created without a resource modifier; the caller already handled nil. The Kubernetes strategy always has one rule per phase and is not affected. This touches the same doc comment as #5367 (it adds a bullet next to the one removed here), so whichever merges second resolves a one-line conflict by keeping the HelmRelease bullet. The two changes do not interact otherwise: #5367 relies on the DataVolume annotation, which stays. #### Testing - The flipped and new tests fail before the change and pass after, including one that an in-place VMDisk restore creates no modifier ConfigMap and its Velero Restore has no `resourceModifier`: `go test ./internal/backupcontroller/` and `go vet ./internal/backupcontroller/` pass. - Velero behaviour on an empty rule list is read from Velero v1.18.1 source, the version the bundled chart deploys. - Not run on a cluster. The claim rests on reading CDI v1.66.1 source, not on a live restore. ### Screenshots <!-- REQUIRED for UI changes: attach screenshots or screen recordings demonstrating the visual impact of your changes. PRs with UI changes without screenshots will not be merged. --> No UI change. ### Downstream repositories <!-- Cozystack is upstream for repositories that are NOT kept in sync with it automatically, and nothing in CI compares the two sides, so a change here can break them silently. Which change forces what, and which file to touch, is the trigger map in docs/agents/contributing.md under "Downstream Repositories". Walk it before you tick anything. IF YOU ARE AN AI AGENT OR AN LLM, THIS IS PART OF THE TASK, NOT A FORM TO FILL IN: 1. Walk the trigger map against the actual diff of this PR, file by file. Do not decide from the PR title or from your memory of what you changed. 2. For every repository you tick, open the follow-up PR there and link it on the same line. A ticked box with no link claims work that does not exist, which is worse than an empty box. Search that repository for an open PR or issue covering it first, and link that instead of filing a duplicate. 3. When the follow-up is out of scope, or needs a decision that is not yours to make, open an issue in that repository instead, link that, and say so in the PR body. Do not push a speculative PR into another repository just to fill a line here. 4. Do not tick "No downstream repository is affected" to make the checklist go away. If you are unsure, leave every box empty and say so in the PR body, so a human decides. --> - [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 <!-- Write a release note: - Explain what has changed internally and for users. - Start with the same `type(scope):` prefix as in the PR title - Follow the guidelines at https://github.com/kubernetes/community/blob/master/contributors/guide/release-notes.md. --> ```release-note refactor(backups): restored PVCs no longer get the `cdi.kubevirt.io/allowClaimAdoption` annotation, which CDI reads only on DataVolumes; claim adoption after a restore is unchanged. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Bug Fixes** * Updated in-place VM disk restores to apply CDI claim adoption through the recreated DataVolume, rather than modifying restored PVCs. * Restores no longer create an empty resource-modifier configuration when no rules are needed. * **Documentation** * Clarified the in-place restore guidance for PVC adoption; OVN IP and MAC preservation guidance remains unchanged. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
9baf43c632 |
test(kafka): check tenant-visible Strimzi Secrets in the e2e suite (#5424)
## What this PR does Moves the check of which Kafka Secrets a tenant can read from a unit test in the shared lineage webhook package into the kafka e2e suite. `internal/lineagecontrollerwebhook/kafka_rd_secrets_test.go` read the raw `kafka-rd` ApplicationDefinition and ran it against Strimzi labels typed by hand. The selectors are kafka's, and the labels are whatever the Strimzi User and Cluster Operators write at run time, so the test pinned one application's configuration against a guess of operator behaviour, from a package that should know neither. The generic part, how `matchLabels` and `resourceNames` select an object, is already covered by `matcher_test.go` in the same package. The kafka suite now creates one SCRAM user and checks the deployed Secrets. First, the user's password Secret and both CA certificate Secrets must carry `internal.cozystack.io/tenantresource=true`. Then no tenant-visible Secret of the cluster may hold a `*.key` entry, which is where Strimzi puts every private key. This check goes by content, so it covers the CA keys and the per-node key Secrets, whose names follow the node pools, and it does not break if a later Strimzi labels one more certificate Secret. A positive control fails the step if no Secret of the cluster holds a `*.key` entry at all, so the check cannot pass vacuously if Strimzi changes how it names keys. I also removed `hack/check-kafka-rd-secrets.bats`. It grepped the same YAML for the CA certificate names, so it passed on a name that only appeared in a comment or an exclude list. The e2e step now checks those names against the real Secrets. Nothing shipped changes: only tests are touched. The new e2e step has not run anywhere yet; it is exercised for the first time by CI on this PR. Locally I checked that the suite YAML parses, that the chart renders the `KafkaUser` from the fixture, and that the step's shell logic passes, fails on a leaked key and fails on the vacuous case when `kubectl` is stubbed. ### Screenshots No UI changes. ### 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 test(kafka): check tenant-visible Strimzi Secrets in the kafka e2e suite instead of a lineage webhook unit test ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Tests** * Expanded Kafka end-to-end checks to verify tenant-visible Secrets are labeled correctly and do not expose private keys. * Added an end-to-end Kafka user configuration for testing. * Removed earlier checks for Kafka certificate Secret naming and selector behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
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 --> |
||
|
|
6d1eeba65b |
fix(postgres): bound a backup whose cnpg Backup stalls in pending
CloudNativePG keeps a Backup pending either behind a started or running backup of the same Cluster, which is healthy, or because the instance to run it on cannot be found or is not ready, which lasts as long as the Cluster is fenced. The BackupJob waited on both forever. The driver now tells the two apart by whether any backup of the Cluster is started or running. It does not model which pending Backup CloudNativePG lets through first. With none running, the job records a CNPGBackupStalled condition and fails once that has lasted the backup deadline. Before it gives up it reads the Cluster's backups again from the apiserver, since the cache can still show pending one that has just started. Its own Backup is deleted, conditionally on the version read so a Backup CloudNativePG has just started is kept, because otherwise it would run later with no Backup recording it. The give-up is persisted before the delete, so a Backup found missing afterwards fails the job only when the driver removed it; one deleted by hand is replaced and its stall counts afresh. The reason CloudNativePG gives exists only as an event on a Backup, so the driver reads the newest Warning on its own Backup, or on another pending backup of the Cluster when its own carries none, by UID and uncached, which needs list on events but no watch. A job is no longer held on the plugin rollout another job started when the Cluster is fenced and every instance pod postdates that attach: a fenced Cluster is neither healthy nor ready until the fence is lifted, so waiting on that would only delay the bound by up to the rollout deadline. The postgres e2e fences the source Cluster, checks that a BackupJob reports the stall with that reason, then lifts the fence and checks the same job completes with the stall ended. That exercises the events grant and the involvedObject.uid selector against a real apiserver. The step creates the BackupJob only once every instance pod has gone NotReady, since the fence takes effect asynchronously and CloudNativePG starts a Backup on a target that is still Ready. Assisted-by: LLM Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io> Signed-off-by: Andrey Kolkov <androndo@gmail.com> |
||
|
|
faaa2b7f2c |
refactor(backups): stop annotating restored PVCs for CDI claim adoption
CDI decides whether a DataVolume may adopt an existing claim from the cdi.kubevirt.io/allowClaimAdoption annotation on the DataVolume, or from the DataVolumeClaimAdoption feature gate. It never reads the annotation on the PVC. The Velero modifier rule that stamped it on every restored PVC in both the VM and the Kubernetes restore strategy therefore changed nothing, while the Kubernetes strategy comment and the VM restore example described it as part of what lets CDI adopt. Drop the PVC rule from both strategies. Adoption still rests on the annotation the vm-disk chart puts on its DataVolume and, for tenant clusters, on the rule that sets it on restored DataVolumes, which a test now pins as the only rule of the volumes phase. Without that rule an in-place VM strategy restore of a VMDisk, or of a VMInstance with no recorded IP and MAC to keep, has no modifier rule left. Velero fails validation of a Restore whose modifier ConfigMap has an empty rule list, so in that case no ConfigMap is created and the Restore carries no resource modifier. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <f@lex.la> |
||
|
|
66c7ed42ed |
test(kafka): check tenant-visible Strimzi Secrets in the e2e suite
Which Secrets of a Kafka cluster a tenant can read depends on the labels the Strimzi operators write onto them at run time, matched against the kafka ApplicationDefinition's selectors. A unit test in the shared lineage webhook package read the kafka-rd YAML and fed it hand-typed Strimzi labels, so it pinned one application's selectors against a guess of what the operator writes, from a package that should know neither. The kafka suite now creates one SCRAM user and asserts on the deployed Secrets: the user's password Secret and both CA certificates carry tenantresource=true, and no tenant-visible Secret of the cluster holds a private key. The second check goes by content rather than by name, so it covers the CA keys and the per-node key Secrets, whose names follow the node pools, and does not break when Strimzi labels another certificate Secret. The generic selector matching stays covered by the webhook package's matcher tests. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <f@lex.la> |
||
|
|
d4f1381bda |
feat(controller): seed account Secrets from CredentialTemplates
The account list now comes from the chart, so something has to turn a rendered CredentialTemplate into an account Secret. The controller seeds a missing Secret, but only on a release marked for seeding: the mark says no client holds a password a seeded one would replace, which is true for a release the API created and, after the conversion, for a converted one. It seeds again when the template's format changes, adopts an unowned Secret the conversion wrote, leaves any other Secret at the name alone, and mirrors the Secret's record into the template's status. A second reconciler adds a valuesFrom entry per template that names a valuesPath, for an engine whose operator reads no Secret. A template reaches it one event at a time, and a conversion writes the Secrets and their entries before the converted chart renders the templates, so an entry whose Secret still exists is kept until its template is seen; it goes once the Secret is gone. The ApplicationDefinition reconciler keeps these entries rather than resetting valuesFrom to the platform values. HelmReleases are watched for the seed mark appearing or going, filtered so helm-controller's status writes do not wake the controller. Without that, a template the chart rendered before the release carried the mark stayed unseeded until the next resync, which on MariaDB turned into a ten-minute Helm timeout on the unready User. Account Secrets are read through the uncached reader and watched as metadata, because an account Secret may hold a plaintext that has no business in a cache. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com> |
||
|
|
d65f86277c |
feat(api): serve Credentials with mint and revoke
A Credential is a view over a CredentialTemplate's status, so a list or a get never reads a Secret. A mint builds the whole account Secret from the template and writes it under the Secret resourceVersion the template's status mirrors, so a concurrent mint or a seed in between fails with a conflict instead of silently replacing a password someone just received, and returns the plaintext once. A revoke stores a random password and discards it. A dry-run writes nothing. Each mint and revoke records an Event on the application naming the account and the caller, never the value, which needs create on events. The API review gate now captures a subresource registration such as credentials/mint as a resource of its own rather than dropping it. Co-authored-by: Timofei Larkin <lllamnyp@gmail.com> Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com> |
||
|
|
fc5ece0a28 |
fix(clickhouse): keep a quota-held archive delete and count a failed one once (#5415)
<!-- Thank you for making a contribution! Here are some tips for you: - Use Conventional Commits for the PR title: `type(scope): description` - Types: feat, fix, security (a fix that comes through a security advisory), docs, style, refactor, perf, test, build, ci, chore - Scopes are not an exhaustive list — pick the most specific scope for the change and extend the list when a genuinely new area appears. Examples: - System components: dashboard, platform, operator, cilium, kube-ovn, linstor, fluxcd, cluster-api - Managed apps: postgres, mariadb, redis, kafka, clickhouse, virtual-machine, kubernetes - Development and maintenance: api, hack, tests, ci, docs, maintenance - Breaking changes: append `!` after type/scope (`feat(api)!: ...`) or add a `BREAKING CHANGE:` footer - If it's a work in progress, consider creating this PR as a draft. - Don't hesistate to ask for opinion and review in the community chats, even if it's still a draft. - Fixes merged to `main` reach the release lines the backport batch runs for automatically, so do not open backport PRs by hand: https://github.com/cozystack/cozystack/blob/main/docs/release/backports.md --> ## What this PR does <!-- Link the issues this PR addresses. For a complete fix targeting the default branch, use Closes #N (Closes owner/repository#N for another repository). Otherwise use a non-closing reference; release-branch PRs need manual issue linking and closure when appropriate. --> Closes #5198. Follow-up to #5224, closing three gaps in how a ClickHouse archive delete on the system bucket treats a refused or failed cleanup Job. - A cleanup Job a ResourceQuota refuses with `status unknown for quota:`, which the quota admission returns until the quota controller has computed the usage, released the `Backup` and left its archive in the bucket for good, although the refusal clears by itself. It is now retried like `exceeded quota:`; any other `Forbidden` or `Invalid` refusal still releases the `Backup` with `ArtifactNotDeleted`. - A cleanup Job a quota refuses now raises an `ArtifactCleanupFailed` Warning Event on the `Backup`, so a `Backup` held terminating by a quota says why. - Recording a failed cleanup Job on the `Backup` starts the next reconcile at once, while the Job cache can still hold the Job just deleted, so one failure could be counted twice: a second Event and the retry wait doubled once more. The UID of the counted Job is now kept on the `Backup` under `altinity.strategy.backups.cozystack.io/cleanup-failed-job`, and a failed Job with that UID is only deleted. - The restore scenario now says that the skip annotation stops only new cleanup Jobs (a cleanup Pod that already exists can still start a delete), and that a quota-refused delete holds the `Backup` until the annotation releases it. Covered by unit tests through the fake client, each guard checked by mutation; not run against a cluster. Out of scope, found while reviewing: the Kafka, Kubernetes, Redis and RabbitMQ strategy controllers release a `Backup` on any `Forbidden` from the cleanup Job create, a quota refusal included, so on a namespace whose Job quota is full their archives are left behind the same way. ### Screenshots <!-- REQUIRED for UI changes: attach screenshots or screen recordings demonstrating the visual impact of your changes. PRs with UI changes without screenshots will not be merged. --> ### Downstream repositories <!-- Cozystack is upstream for repositories that are NOT kept in sync with it automatically, and nothing in CI compares the two sides, so a change here can break them silently. Which change forces what, and which file to touch, is the trigger map in docs/agents/contributing.md under "Downstream Repositories". Walk it before you tick anything. IF YOU ARE AN AI AGENT OR AN LLM, THIS IS PART OF THE TASK, NOT A FORM TO FILL IN: 1. Walk the trigger map against the actual diff of this PR, file by file. Do not decide from the PR title or from your memory of what you changed. 2. For every repository you tick, open the follow-up PR there and link it on the same line. A ticked box with no link claims work that does not exist, which is worse than an empty box. Search that repository for an open PR or issue covering it first, and link that instead of filing a duplicate. 3. When the follow-up is out of scope, or needs a decision that is not yours to make, open an issue in that repository instead, link that, and say so in the PR body. Do not push a speculative PR into another repository just to fill a line here. 4. Do not tick "No downstream repository is affected" to make the checklist go away. If you are unsure, leave every box empty and say so in the PR body, so a human decides. --> - [ ] No downstream repository is affected by this change - [x] [cozystack/website](https://github.com/cozystack/website) - follow-up: cozystack/website#809 (the ClickHouse archive delete page, updated for the quota retry and the skip annotation wording) - [ ] [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 <!-- Write a release note: - Explain what has changed internally and for users. - Start with the same `type(scope):` prefix as in the PR title - Follow the guidelines at https://github.com/kubernetes/community/blob/master/contributors/guide/release-notes.md. --> ```release-note fix(clickhouse): a ClickHouse archive delete whose cleanup Job a ResourceQuota refuses, including before the quota's usage is known, now keeps the Backup and retries with an ArtifactCleanupFailed Warning Event instead of releasing it and leaving the archive; a failed cleanup Job is counted once. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Bug Fixes** * Backups are retained when cleanup Jobs are refused due to quota limits, with a warning and retry when quota permits. * Repeated reconciliation of the same failed cleanup Job no longer increments the failure count or emits duplicate warnings. * Invalid cleanup errors continue to release the Backup, even if the error message mentions quota. * Clarified that cleanup may continue if a Pod has already started or a sidecar has accepted the deletion. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
94d710e50f |
fix(tenant): render the LimitRange only under a compute quota (#4954)
## What this PR does
The tenant chart rendered `tenant-range-limits` whenever
`resourceQuotas` was non-empty. Under a quota on something other than
compute, for example `{services.loadbalancers: "1"}`, `storage` or
`nvidia.com/gpu` alone, its 128Mi default memory limit still applied to
every container and refused any pod that requests more memory without a
limit of its own. virt-launcher is one of those, so VMs could not start
in such a tenant.
The LimitRange exists so pods without requests or limits pass a quota
that tracks `cpu`, `memory` or `ephemeral-storage`. This PR has it
default each of those three only when the flattened quota bounds that
resource (its `requests.*` or `limits.*` key), and renders no LimitRange
when the quota bounds none of them. A quota on all three renders the
LimitRange exactly as before, with the same values. The ResourceQuota is
unchanged. The system memory limits guide has moved to the website and
described the old condition in two places; the follow-up below updates
it. A second commit qualifies the comments in the operator, the tenant
quota controller, the backup controller and the barman and kafka charts
that still said every tenant with `resourceQuotas` gets a 128Mi memory
default.
Tests:
- New `packages/apps/tenant/tests/quota_limitrange_test.yaml` (9 tests):
no LimitRange under a quota on load balancers, storage or GPUs alone;
only the cpu, only the memory, or only the ephemeral-storage defaults
under a quota on that resource alone; only memory beside non-compute
keys; every default, values unchanged, under a quota on all three.
- Against main's template, 7 of the 9 tests fail. The two that pass are
the empty quota and the full cpu, memory and ephemeral-storage quota,
which keep their behaviour.
- `helm unittest` for the whole tenant chart: 23 suites, 98 tests pass.
- `helm template` of `templates/quota.yaml` under `{cpu, memory,
ephemeral-storage}` is identical to main.
I did not reproduce the virt-launcher admission failure on a live
cluster; the reproduction in the issue is from a test cluster on main.
Fixes #4930
### Screenshots
Not a UI change.
### Downstream repositories
- [ ] No downstream repository is affected by this change
- [x] [cozystack/website](https://github.com/cozystack/website) -
follow-up: cozystack/website#817
- [ ]
[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(tenant): the tenant LimitRange now defaults cpu, memory and ephemeral-storage only when resourceQuotas bounds that resource, so a quota without memory no longer gives containers a 128Mi default memory limit that kept VMs from starting.
```
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Bug Fixes**
* LimitRange settings are now rendered only when quotas bound CPU,
memory, or ephemeral storage. Defaults are included only for the bounded
resources; quotas limited to load balancers, storage, or GPUs do not
trigger a LimitRange on their own.
* **Documentation**
* Clarified when tenant namespaces receive LimitRange defaults,
including the resource-specific conditions for CPU, memory, and
ephemeral storage.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
|
||
|
|
5780952b45 |
fix(backups): confine Velero restore-copy to the tenant's namespace subtree
A RestoreJob with the Velero strategy took options.targetNamespace verbatim and, for a cross-namespace copy, checked only that the namespace existed. A tenant administrator could restore their own backup - Secrets, PVCs and data included - into any other tenant's namespace, or overwrite an application there. GHSA-vq9c-8j6p-r6mp / GHSA-p7mc-34g4-53vv / GHSA-4295-xcmq-8h9h. Require the target namespace to carry the tenant.cozystack.io/<restoreJob namespace> subtree label, the same marker the Cilium egress and tenant-namespace delete policies already use. The target is then the RestoreJob's own namespace or a descendant; a different tenant, a parent, a sibling or a system namespace is refused before any Velero Restore is created. Restore-copy within a tenant's own subtree keeps working. Signed-off-by: IvanHunters <xorokhotnikov@gmail.com> |
||
|
|
3c04f64307 |
fix(clickhouse): count a failed archive delete once
Recording a cleanup Job's failure on the Backup starts the next reconcile at once, and the Job cache can still hold the failed Job the controller has just deleted. That reconcile counted the same failure again: a second ArtifactCleanupFailed Event and the wait doubled once more for one failed delete. The UID of the counted Job is kept on the Backup beside the count, and a failed Job with that UID is only deleted, the Backup held for the rest of the wait already set. Assisted-by: LLM Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io> |
||
|
|
905a75118f |
fix(clickhouse): name a quota-held archive delete on its Backup
A cleanup Job a ResourceQuota refuses is retried with the Backup held, which leaves the Backup terminating with the reason only in the controller log. The refusal is now an ArtifactCleanupFailed Warning Event on the Backup, as a failed cleanup Job is. Assisted-by: LLM Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io> |
||
|
|
64d614d0d1 |
fix(clickhouse): hold an archive delete while a quota's usage is unknown
The ResourceQuota admission plugin refuses a Job with "status unknown for quota:" until the quota controller has computed its usage, as well as with "exceeded quota:" once it is used up. The cleanup only retried the latter; on the former it released the Backup and left its archive in the bucket for good, though the refusal clears by itself. Assisted-by: LLM Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io> |
||
|
|
8f0082a1c8 |
fix(clickhouse): delete the archive when its Backup is deleted (#5224)
<!-- Thank you for making a contribution! Here are some tips for you: - Use Conventional Commits for the PR title: `type(scope): description` - Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore - Scopes are not an exhaustive list — pick the most specific scope for the change and extend the list when a genuinely new area appears. Examples: - System components: dashboard, platform, operator, cilium, kube-ovn, linstor, fluxcd, cluster-api - Managed apps: postgres, mariadb, redis, kafka, clickhouse, virtual-machine, kubernetes - Development and maintenance: api, hack, tests, ci, docs, maintenance - Breaking changes: append `!` after type/scope (`feat(api)!: ...`) or add a `BREAKING CHANGE:` footer - If it's a work in progress, consider creating this PR as a draft. - Don't hesistate to ask for opinion and review in the community chats, even if it's still a draft. - Add the label `kind/backport` if it's a bugfix that needs to be backported to a previous version. --> ## What this PR does Builds on #5229 (merged), which gives every backup run an archive of its own. Deleting a `Backup` taken with the Altinity (ClickHouse) strategy released its finalizer at once and left the archive in the bucket. On the system bucket nothing else prunes it, so every ClickHouse backup stayed until someone called the sidecar by hand, and the route the chart and the examples documented for that, `DELETE /backup/<name>/remote`, does not exist in clickhouse-backup 2.7 and answers 404. The driver names each archive `<application>-<start time as YYYYMMDDHHMMSS>-<first 12 hex digits of the BackupJob UID>` (#5229) and records it on the `Backup` under `altinity.strategy.backups.cozystack.io/archive`. This PR also records, under `altinity.strategy.backups.cozystack.io/use-system-bucket`, the application's `backup.useSystemBucket` as it read when the backup Job was created: the setting is stamped on the backup Job and copied onto the `Backup`, because the application may switch before the controller sees the Job complete. A Job created before the stamp existed falls back to the application as it reads at completion. For a system-bucket application the bucket the projected credentials (`cozy-backups-creds`) name is recorded the same way, under `altinity.strategy.backups.cozystack.io/bucket`. The `Backup` is created with its cleanup finalizer already set, so a `Backup` deleted before the `Backup` reconciler first sees it still has its archive deleted. On `backup.useSystemBucket: true`, deleting the `Backup` runs a one-shot cleanup Job that calls `POST /backup/delete/remote/<name>` on the application's sidecar and holds the finalizer until it completes. The sidecar refuses a delete with 423 while any other operation runs and cannot be reached while its Pod restarts, so the Job waits both out within its deadline; an archive that is already gone counts as deleted, and any other answer fails the Job, which is reported as an `ArtifactCleanupFailed` Warning Event carrying the reason the Job failed and retried after a wait that starts at 30 seconds and doubles with each failure up to 30 minutes (kept on the `Backup` under `altinity.strategy.backups.cozystack.io/cleanup-failures` and `.../cleanup-retry-after`, since the failed Job is deleted to make room for the next). The Job starts only once the projected credentials have reached the sidecar, as the backup and restore Jobs do. It is built by the controller, not rendered as a whole from the strategy template, because the shipped and the example templates run `restore_remote` for every mode other than `backup`; only the image, how to pull it and where the Pod may be scheduled (node selector, tolerations, affinity, priority class) come from the template, rendered as for the strategy's own Pods. When the delete cannot or must not run, the `Backup` is released with an `ArtifactNotDeleted` Warning Event naming the archive left behind: the namespace is terminating, the strategy, the application or its API Secret is gone, the application no longer uses the system bucket (also when it leaves while the delete runs), the system bucket is no longer the one the `Backup` records or cannot be read (also when it changes while the delete runs; a sidecar on another bucket would answer "not found" and the delete would count as done), another Job holds the cleanup Job name, or the archive has the older `clickhouse-<application>-<YYYYMMDDTHHMMSSZ>` form, without its BackupJob's UID. Such a name comes from a controller that predates per-run names; two runs of one application started within the same second share it, and a run still in flight when the controller is upgraded records it later, so it is never deleted. `backups.cozystack.io/skip-artifact-cleanup: "true"` releases a `Backup` without deleting anything. An application on its own bucket keeps the archive's lifecycle, as with MongoDB. The wrong delete route is corrected in the chart comments and the restore scenario. A BackupJob or RestoreJob no longer takes the outcome of a batch Job of its name that it does not control. A Job left by an earlier owner of the same name is waited out, with the `Ready` condition (`PredecessorJobPending`) naming it, until the garbage collector removes it; any other Job holding the name fails the BackupJob or RestoreJob with a message naming the Job. The condition is dropped once the run's own Job starts. The example strategy under `examples/backups/clickhouse` now uploads under the archive name the controller chose and restores the archive the `Backup` records, as the shipped strategy does, keeping its clock-made name and the newest archive only as the fallback for a run given no name; `hack/clickhouse-example-strategy.bats` runs it against a stubbed sidecar. The backup scenario no longer says the archive is expired by the upstream tool's retention, which the chart does not configure. Known limitations: a `Backup` taken before #5208, or by a custom strategy that does not use `.ArchiveName`, does not name its archive and keeps it; a `Backup` that names its archive but not the bucket setting, as every `Backup` taken before this change does (a 1.7.x release that carries #5208 among them), keeps its archive too and is released without an Event; a `Backup` that records no bucket, taken before buckets were recorded, is deleted without the bucket check; a `Backup` deleted during an application uninstall can lose its cleanup Job to the chart's own `<release>-cleanup` hook and is then released with a Warning Event, leaving the archive; the recorded setting and bucket are read when the backup Job is created, not observed from the upload, so a switch made just before a backup, while the sidecar still runs on the previous bucket, is recorded for an archive written to the previous one. Related gap outside this PR, in main today: an archive uploaded by a run whose `Backup` name is already taken is recorded by nothing, so no `Backup` deletes it. Verified with unit tests that drive the cleanup path through a fake client and the cleanup script against a stub `curl`, with mutation checks on every guard, and on a test cluster running v1.7.0 with the backup controllers built from this branch (before #5229 shortened the run name to its current form, which leaves the deletion side unchanged), against the real clickhouse-backup sidecar and SeaweedFS: a backup records a per-run archive name and the bucket setting on a `Backup` created with its finalizer; deleting the `Backup` deletes the archive's objects in the bucket; a restore from a `Backup` brings the data back; a BackupJob recreated under a used name waits for the earlier Job and then writes an archive of its own; a Job of that name created by anything else fails the BackupJob; a `Backup` recording an archive named without a UID is released with `ArtifactNotDeleted` and its objects stay. The changes made after that run (the recorded bucket, the retry wait, the credentials wait before the cleanup Job, the rendered cleanup Pod settings, the cleared predecessor condition, the example strategy) are covered by the unit tests and bats, not by a live run. ### Screenshots <!-- REQUIRED for UI changes: attach screenshots or screen recordings demonstrating the visual impact of your changes. PRs with UI changes without screenshots will not be merged. --> ### Downstream repositories <!-- Cozystack is upstream for repositories that are NOT kept in sync with it automatically, and nothing in CI compares the two sides, so a change here can break them silently. Which change forces what, and which file to touch, is the trigger map in docs/agents/contributing.md under "Downstream Repositories". Walk it before you tick anything. IF YOU ARE AN AI AGENT OR AN LLM, THIS IS PART OF THE TASK, NOT A FORM TO FILL IN: 1. Walk the trigger map against the actual diff of this PR, file by file. Do not decide from the PR title or from your memory of what you changed. 2. For every repository you tick, open the follow-up PR there and link it on the same line. A ticked box with no link claims work that does not exist, which is worse than an empty box. Search that repository for an open PR or issue covering it first, and link that instead of filing a duplicate. 3. When the follow-up is out of scope, or needs a decision that is not yours to make, open an issue in that repository instead, link that, and say so in the PR body. Do not push a speculative PR into another repository just to fill a line here. 4. Do not tick "No downstream repository is affected" to make the checklist go away. If you are unsure, leave every box empty and say so in the PR body, so a human decides. --> - [ ] No downstream repository is affected by this change - [x] [cozystack/website](https://github.com/cozystack/website) - follow-up: cozystack/website#809 (for cozystack/website#808; its `next/` pages should merge after this PR) - [ ] [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 <!-- Write a release note: - Explain what has changed internally and for users. - Start with the same `type(scope):` prefix as in the PR title - Follow the guidelines at https://github.com/kubernetes/community/blob/master/contributors/guide/release-notes.md. --> ```release-note fix(clickhouse): deleting a Backup taken on the system bucket from this release on now deletes its clickhouse-backup archive and keeps the Backup until the delete finished, reporting an archive it cannot or must not delete (including one named without its BackupJob's UID, or in a system bucket the platform has left) as a Warning Event and retrying a failed delete with a growing wait; the cleanup Pod is scheduled as the strategy's own Pods; a BackupJob or RestoreJob no longer reports the outcome of a batch Job it did not create; the documented sidecar delete route is corrected to POST /backup/delete/remote/<name>. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * ClickHouse backups using the system bucket now remove their recorded archive when the backup is deleted. Deletion waits for cleanup to finish. * Backup and restore operations use the controller-provided archive name when available. Restores can fall back to the latest matching archive. * **Bug Fixes** * Temporary sidecar failures are retried with increasing delays. If cleanup cannot safely remove an archive, it completes with a warning rather than risking deletion of the wrong archive. * **Documentation** * Clarified that archives in tenant-owned buckets remain until manually deleted or removed by bucket lifecycle rules. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
9ecff91b74 |
fix(kafka)!: require SCRAM-SHA-512 on the external listener
With external access on, the chart opens a listener on port 9094 of a public LoadBalancer address, and it rendered that listener without any authentication: whoever reached the address could produce and consume on every topic. TLS on that listener only encrypts the session. The KafkaUser name carries the release name because it is also the SCRAM username and the name of its Secret, and two instances in one namespace may declare the same user. A dot joins the two because a user Secret readable by the tenant must never take the name of a Secret Strimzi derives from a cluster name, and neither a release name nor any of those Secrets can hold a dot. BREAKING CHANGE: an instance with external access enabled refuses clients that do not authenticate. The Kafka README gives the upgrade sequences. Assisted-by: LLM Signed-off-by: Mattia Eleuteri <mattia@hidora.io> |
||
|
|
2af1e21299 |
fix(gateway): copy allowed routes for the edge listener (#4167)
## What this PR does Fixes #4118. The `edge` listener retained the renderer's local `edgeAllowedRoutes` value, while `edge-apex` and child listeners already received independent copies. Give `edge` its own `DeepCopy()` as well, so later changes to the local value cannot reach the rendered listener. The rendered Gateway configuration is unchanged. The change is confined to that one assignment. Current main already creates independent allowed-routes values for HTTPS and TLS-passthrough listeners. Validation: `go test ./internal/controller/tenantgateway -count=1` passes. No new test is added, as accepted in the maintainer's review. ### 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: The diff changes only ownership of a local allowed-routes value; API fields, namespace selectors, route kinds, package layout and rendered resources stay the same, so it reaches none of the downstream trigger map's contracts. ### Release note ```release-note fix(gateway): give the edge TenantGateway listener its own allowed-routes copy; rendered Gateway configuration is unchanged ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Fixed edge-mode gateway listeners so each retains its own allowed-routes configuration. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
b7e72840f9 |
fix(gateway): skip a child apex the wildcard certificate already covers (#5148)
## What this PR does In DNS-01 mode the controller added every inheriting child tenant's apex to the parent Gateway's wildcard Certificate. When the child's host derives one label below the parent (`ci.mgmt.example.com` under `mgmt.example.com`), the parent's `*.mgmt.example.com` already covers that apex, and Let's Encrypt refuses the whole order as redundant, so the parent Gateway is left with no certificate for any of its hostnames. `renderWildcardCertificate` now skips a child apex when `*.` plus the apex without its first label is among the wildcards in the same Certificate, which is the check Boulder runs in `wildcardOverlap`. The child's own `*.<child-apex>` stays, and an apex two labels below every wildcard stays listed, because a certificate wildcard matches exactly one label. That is also why this does not reuse `hostnameCovers`, which follows Gateway API matching at any depth. The wildcard set is collected before the loop because `childApexes` is sorted by name and a covering child wildcard can sort after the apex it covers. `TestReconcile_DNS01WildcardCertCoversInheritingChildApexes` asserted the redundant `alice.example.org` SAN and now asserts its absence. The new `TestRenderWildcardCertificate_SkipsChildApexCoveredByWildcard` covers the reported case, a child two labels down, a covering wildcard that sorts late, and an empty or unrelated apex; the reported case and the late sorting case fail without the fix. The README paragraph that describes the SAN list is updated to match. `go test -p 2 ./internal/... -count=1` and `go vet ./internal/controller/tenantgateway/` pass locally. Fixes #5125 ### Screenshots No UI change. ### Downstream repositories - [ ] No downstream repository is affected by this change - [x] [cozystack/website](https://github.com/cozystack/website) - follow-up: https://github.com/cozystack/website/issues/779 - [ ] [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(gateway): the DNS-01 wildcard Certificate no longer lists a child tenant's apex that the parent's wildcard already covers, so Let's Encrypt stops refusing the order and the parent Gateway gets its certificate again. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Bug Fixes** * Wildcard certificates now omit child apex names already covered by an existing wildcard while retaining the child wildcard names. Apex names not covered by a wildcard remain included, and duplicate or empty apex names are excluded. This keeps certificate names focused on the names needed for coverage. * **Documentation** * Clarified how child apex and wildcard names are included in DNS-01 certificates, including when a child apex is covered by an existing wildcard. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
a2f7ea18ee |
fix(clickhouse): drop the predecessor wait once a run's own Job starts
A BackupJob or RestoreJob that waited for the Job of an earlier owner of its name kept its Ready=False PredecessorJobPending condition after that Job was gone and its own Job had started, so for the whole run it still said it was waiting for the garbage collector. The condition is now dropped when the run's own Job is running, the way the credentials wait is. Assisted-by: LLM Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io> |
||
|
|
084fed9e2f |
fix(clickhouse): take no restore Job's result that this RestoreJob did not run
The restore path took any Job standing under a RestoreJob's Job name as its own, so a RestoreJob re-created under a used name met the completed Job of the earlier one before the garbage collector removed it and was marked Succeeded although nothing was restored for it. The restore path now refuses such a Job the way the backup path does: the Job of an earlier RestoreJob of the same name is waited out, with the Ready condition naming it, and any other Job holding the name fails the RestoreJob. Assisted-by: LLM Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io> |
||
|
|
e199ef1d83 |
fix(clickhouse): take no backup Job's result that this BackupJob did not run
A Job standing under a BackupJob's Job name was taken as its own. A BackupJob re-created under a used name, as a Plan does when the BackupJob of a schedule slot is deleted within the slot's starting deadline, met the completed Job of the earlier one before the garbage collector removed it, was marked Succeeded without uploading anything, and recorded a Backup for an archive nobody uploaded for it. A Job controlled by an earlier BackupJob of the same name is now waited out, with the Ready condition naming it; any other Job holding the name fails the BackupJob, since nothing will remove it. Assisted-by: LLM Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io> |
||
|
|
564bdd3a79 |
fix(clickhouse): delete the archive when its Backup is deleted
Deleting a Backup taken with the Altinity strategy released its finalizer at once and left the archive in the bucket. On the system bucket nothing else prunes it, so every ClickHouse backup stayed until someone called the sidecar by hand. Deleting such a Backup now runs a one-shot Job that asks the application's sidecar to delete the archive the Backup records, and holds the finalizer until the Job completes. The driver creates the Backup with the finalizer already set, so a Backup deleted before the reconciler first sees it still gets its archive deleted. An archive that is already gone counts as deleted. The sidecar refuses a delete while another operation runs, and cannot be reached while the ClickHouse Pod restarts, so the Job waits both out within its deadline; any other refusal fails the Job, which is reported as an ArtifactCleanupFailed Warning Event carrying the reason it failed. Each failure doubles the wait before the next cleanup Job, from 30 seconds up to 30 minutes, so a delete the sidecar refuses for good, such as one made with a wrong password, does not cost a Job, its Pod and a Warning Event every few seconds. The count of failures and the time the next Job may start are kept on the Backup, because the Backup controller does not watch Jobs; a start time further ahead than the longest wait, from a skewed clock or a hand edit, is logged and ignored. A Job the namespace's Job quota refuses is retried once a slot frees up rather than released, since the Backup would be gone by then and nothing would delete the archive. The Job is built by the controller, not rendered from the strategy template, because the shipped and the example templates run a restore for every mode other than backup. Only the image, how to pull it, and the node selector, tolerations, affinity and priority class come from the template, rendered against the application and the Backup as for the strategy's own Pods, so the cleanup Pod can be scheduled where they are. The strategy is read only when a Job has to be created, so a running delete outlives it. The Job also waits for the projected credentials to reach the sidecar, as the backup and restore Jobs do: a sidecar still serving the previous bucket answers "not found", and the delete would count as done. When the delete cannot run, the Backup is released with an ArtifactNotDeleted Warning Event naming the archive left behind: the namespace is terminating, the strategy, the application or its API Secret is gone, the application has left the system bucket, the platform's system bucket is no longer the one the Backup records (also when it changes while the delete runs), another Job holds the cleanup Job name, or the API server refuses the Job. An archive named without its BackupJob's UID is released the same way: such a name comes from a run that crossed the controller upgrade, and another run started in the same second may share it. The backups.cozystack.io/skip-artifact-cleanup annotation releases the Backup without starting a delete. An application on its own bucket keeps the archive's lifecycle, as with MongoDB. The restore scenario and the chart comments told tenants to delete an archive with DELETE /backup/<name>/remote, which clickhouse-backup 2.7 answers with 404; they now name POST /backup/delete/remote/<name>. Co-authored-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com> Assisted-by: LLM Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io> Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com> |
||
|
|
b62f2f385f |
fix(clickhouse): record the bucket setting a ClickHouse backup was taken with
A ClickHouse application writes its archives either to the system bucket, which nothing prunes, or to its own bucket, whose lifecycle is the tenant's. A Backup did not say which applied, so nothing deciding the fate of the archive when the Backup goes could tell them apart. The application's useSystemBucket is read when the backup Job is created, stamped on the Job and copied onto the Backup from there, because the application may switch before the controller sees the Job complete. It is the setting, not an observation of the bucket: the sidecar uploads to the bucket it was last restarted with, so a switch made just before the backup can be recorded while the sidecar still writes to the previous bucket. A Job created before the stamp existed falls back to the application as it reads then. Assisted-by: LLM Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io> |
||
|
|
8382ed1a92 |
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> |
||
|
|
addf7d1258 |
fix(lineage-webhook): leave a running Pod's scheduler alone on update
spec.schedulerName cannot change once a Pod exists, yet the webhook set it on every Pod admission, updates included. A Pod created before its tenant got a class, or before its application named one, then had every later update refused by the apiserver, labels and annotations written by controllers included. A class can only take effect when the Pod is created. Assisted-by: LLM Signed-off-by: Mattia Eleuteri <mattia@hidora.io> |
||
|
|
e67a514903 |
fix(lineage-webhook): keep the tenant class when an application's is refused
The webhook fell back to the tenant class only when an application left spec.schedulingClass empty. A value naming a class that does not exist, or one the tenant does not allow, left the pod with no scheduler at all, so a typo, or a deliberate bogus name, in any application lifted the placement constraint the tenant administrator had set. Admission sees the application only once, so a class removed from the allowed list afterwards has to be caught here as well. Naming the tenant's own class needs no entry in the list, being the same as leaving the field empty. The application class is looked up once, so a class deleted between deciding and injecting cannot leave the pod with neither class. A lookup error fails the admission instead of counting as absence: otherwise a timeout or a 5xx from the apiserver would admit the Pod on the default scheduler, outside the tenant's constraint, until it was recreated. Under failurePolicy Fail its controller retries. Only an absent class, or an absent SchedulingClass CRD, means there is nothing to inject. Assisted-by: LLM Signed-off-by: Mattia Eleuteri <mattia@hidora.io> |
||
|
|
aed71ed610 |
test(lineage-webhook): cover the per-application scheduling class
The applySchedulingClass tests only ever passed a nil owner, so the path where an application's class takes over from the tenant's, and the guard that keeps an over-long class name off the Pod labels, could break unnoticed. The owner is built as unstructured, as the lineage walk returns it, because its conversion into Application.Spec.Raw is part of that path. Assisted-by: LLM Signed-off-by: Mattia Eleuteri <mattia@hidora.io> |
||
|
|
0132457260 |
feat(apps): expose schedulingClass across all managed applications
Placement could only be set per tenant, so two applications of the same tenant could not be kept together, or apart, unless each had a tenant to itself. With a class per application and the scheduling-class Pod label, a SchedulingClass name can serve as a co-affinity group: a database and the virtual machine that uses it can be kept in the same region without pinning which one. The field is capped at 63 characters. A SchedulingClass name may be up to 253, but the webhook writes the class into a Pod label, and this is the first source of the class the apiserver has not already validated as a label value; capping it is cheap while the field is new and a breaking change once released. A class created with a longer name must still not break Pod admission, so for it only the label is left out. kubernetes-nodes gets no field: the ownership walk from a worker Pod reaches the parent Kubernetes application, never the pool, so a class set on a pool would be accepted and silently ignored. Placement per replica role (primary or standby of a clustered database) is out of scope: the operator assigns the role after election, once the webhook has already seen the pod. Assisted-by: LLM Signed-off-by: Mattia Eleuteri <mattia@hidora.io> |
||
|
|
46f03b8748 |
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> |
||
|
|
65cb73e380 |
fix(lineage-webhook): keep an explicit tenantresource false (#4920)
## What this PR does Lets a chart narrow the lineage webhook's `internal.cozystack.io/tenantresource` verdict without being able to widen it. The webhook computes the verdict from the ApplicationDefinition's `secrets` selectors on first admission and copied it over whatever label the chart rendered, so a Secret the definition still selected was projected through `core.cozystack.io/tenantsecrets` whatever the chart said. A `"false"` rendered on a Secret the webhook admits for the first time (CREATE) is now kept; a rendered `"true"` is still replaced by the computed verdict. A re-admission (UPDATE with `managed-by-cozystack` dropped, which the cacert controller does on a selector change) still gets the definition's verdict, because the `"false"` it carries is the one this webhook wrote earlier. This is rollout step 2 of the accepted [user secrets API proposal](https://github.com/cozystack/community/blob/main/design-proposals/user-secrets-api/README.md): during a kind's conversion the converted chart renders the platform-only `<release>-credentials` Secret with `tenantresource: "false"` while the old definition may still select the name, and the label is what keeps that Secret off the projection in the window. It ships on its own because nothing else depends on it and the conversions do. Behaviour otherwise unchanged: an object with no rendered label gets the definition's verdict as before, and the re-admission short-circuit on `managed-by-cozystack` is untouched. Covered by a handler test: on CREATE, a rendered `false` kept where the selector matches, a rendered `true` overwritten where it does not, and no rendered label taking the verdict; on a re-admission UPDATE, a grant where the selector now matches and a revoke where it no longer does. ### Screenshots No UI change. ### Downstream repositories Walked the trigger map against the diff: two files under `internal/lineagecontrollerwebhook`, no CRD, no package, no chart, no values, no `hack/` change. The ApplicationDefinition's selector semantics gain one exception, but the website's ApplicationDefinition page does not describe the projection verdict at that depth, so there is nothing there to update. - [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(lineage-webhook): a Secret created with `internal.cozystack.io/tenantresource: "false"` keeps that label even where its ApplicationDefinition selects the name, so a chart can take a Secret off the tenantsecrets projection; a rendered `"true"` is still overwritten by the definition's verdict. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Bug Fixes** * On resource creation, an existing `false` tenant-resource label is preserved even when the configured selector matches. Otherwise, the label reflects the selector’s verdict. On updates, the label is set according to the selector. * **Tests** * Added coverage for tenant-resource label behavior on creation and updates, including existing and missing labels. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
e11ca91d81 |
fix(backups): stop leaking MariaDB dumps of stuck runs and torn-down namespaces (#5344)
## What this PR does Closes #5291. Two paths left a MariaDB dump and its `k8s.mariadb.com/Backup` behind after the dump cleanup from #5233. **A run that never completes.** When the operator Backup stays short of `Complete` past `mariadbDefaultBackupDeadline`, the BackupJob now deletes it (background propagation, so its Job goes too) before it marks itself `Failed`, and says so in the failure message. No Cozystack `Backup` is ever made of such a run, so nothing else deleted it, and while it stood its window had no end: `contestedMariaDBDump` counted it as a possible writer of every later dump of the application, and every later `Backup` was released with `ArtifactNotDeleted`. Deleting the Job also stops a run that is still going from uploading a dump nobody tracks. An operator Backup that is `Complete=True` on a reason the driver does not know has a bounded window and is kept, as before. The decision is made on the operator Backup read from the API server, not the cache. A run the operator has just marked complete or failed goes down the normal path and is not deleted. The delete carries the UID and resourceVersion that were read, so a run that completes between the read and the delete is not deleted either. Past the deadline no new run is created, so a pass that deleted the run and then failed to persist `Failed` does not start another one on retry. A delete the API server keeps refusing shows as `Ready=False/OperatorBackupDeleteFailed` on the BackupJob. The delete also removes the run's pod, so before it the controller copies what held the pod up into the failure message: an unschedulable pod, or a container that is waiting or has failed. The MariaDB driver's other failure exits take the same path: the MariaDB application was deleted, the MariaDB CR never came back, the strategy disappeared past its deadline, the strategy no longer renders, the applicationRef is rejected, or the run could not be created. Past the deadline, the run is taken from the API server listing and `ensureMariaDBBackup` is not called, so a cache that has not seen the run cannot cause a second one to be created. mariadb-operator leaves the run of a MariaDB that went away at `Complete=False` for good, so if the application was later recreated under the same name, that run used to contest every later dump. The deadline is still 30 minutes from `StartedAt`, but a dump that is still running at that point is now stopped instead of being left to finish outside Cozystack. **Namespace teardown.** mariadb-operator puts no finalizer on its `Backup`, so during teardown it is usually gone before the Cozystack `Backup` finalizer runs. When the operator Backup is not found, the cleanup now: - takes bucket, prefix and Secret references from the snapshot in `status.underlyingResources`; - goes on only for a recorded dump (`k8s.mariadb.com/dump-file`) on the platform bucket written with the projected platform Secret, reached with the platform credentials, which do not depend on the namespace; - keeps the dump, with a `Warning ArtifactNotDeleted`, when another operator Backup, finished or not, could have written it (the same `contestedMariaDBDump` check as before); - retries a failed delete through `retryMariaDBCleanup`, which releases the `Backup` once the namespace is terminating. The snapshot and the storage URI now record the storage the run was created with, whatever its kind, rather than the strategy as rendered when the run completed. A strategy edited during a run therefore cannot send the cleanup to the wrong place. The BackupJob looks for its run on the API server rather than in the cache, so a retry after a failed status write never starts a second run. A `Running` BackupJob never starts a run at all, and if its run is gone the job is failed. A `Backup` with no recorded dump, no snapshot, a dump on another bucket or written with the tenant's own Secret, or unreadable platform credentials is released with a `Warning`, as before. A missing operator CRD keeps the old release path. The platform-bucket check that `mariadbCleanupConnection` used is now `mariadbPlatformConnection`, shared by both paths. Its behaviour is unchanged. Not covered: - Operator Backups left behind by BackupJobs that failed before this change are still there, because terminal BackupJobs are not reconciled again. Deleting them by hand releases the dumps they hold. - Deleting a BackupJob that is still running leaves its operator Backup, which has no ownerRef and no finalizer. This was already the case and is not addressed here. - The driver-independent terminal exits in `backupjob_controller.go` (BackupClass resolution, credentials projection) still fail a BackupJob without looking at a MariaDB run. - A run that is stopped at the deadline after it has uploaded its dump leaves that dump untracked. No `Backup` is ever made of such a run. The other fail-safe cases listed in the issue (a `Restore` that never completes, the single `Backup` worker, non-204 DELETE responses, endpoint moves) are not addressed here. Tests: `go test ./internal/backupcontroller/...`. The deadline outcome table now also checks whether the operator Backup was deleted. New cleanup tests cover a missing operator Backup: the dump deleted with the platform credentials, already absent, contested by an unfinished run, a failed delete held for retry, and each case it cannot reach (volume storage, a recorded name that is not a dump, a snapshot of another kind). Deadline tests cover a retry after a failed status write, a cache that trails a completed run or misses a new one, a delete conditional on the run that was read, a refused delete, and the application or MariaDB going away mid-run. ### Screenshots N/A, no UI changes. ### Downstream repositories I checked the trigger map in `docs/agents/contributing.md` against the diff. The diff touches `internal/backupcontroller/mariadbstrategy_*.go` and their tests. It also adds a message helper in `internal/backupcontroller/backupjob_controller.go` and changes comments in `internal/backupcontroller/backup_controller.go` and `packages/system/backupstrategy-controller/templates/rbac.yaml`. No values, schemas, CRDs, RBAC rules, annotations or telemetry change. - [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(backups): MariaDB dumps are no longer left in the bucket when a backup run never completes or when a tenant namespace is deleted. A BackupJob that times out now deletes the operator Backup it gave up on, so that run no longer blocks the deletion of later dumps. A Backup whose operator Backup is already gone now deletes its recorded dump from the platform bucket using the platform credentials. A MariaDB backup run that has not completed 30 minutes after its BackupJob started is now stopped. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Bug Fixes** * MariaDB backup cleanup now removes a recorded dump from the platform bucket when its operator Backup is already gone, while leaving contested or insufficiently verified dumps untouched. * Failed dump deletions are retried, and cleanup reports when a dump is already absent. * Backup jobs are less likely to start duplicate runs during retries, and completed backups retain the storage configuration used by their run. * Failure handling preserves completed runs and includes operator-run completion details when available. * Backup jobs now recheck the operator Backup before failing on a deadline, helping account for runs that completed or failed in the meantime. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
dbc088f862 |
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> |
||
|
|
73df99b77d |
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> |
||
|
|
887453c008 |
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> |
||
|
|
5fbf7e9a38 |
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> |
||
|
|
d88322197f |
chore(deps): roll up Renovate updates and raise dependencies to latest stable (#4869)
## What this PR does One PR instead of separate Renovate PRs. Go modules, Dockerfile base images and GitHub Actions move to newer versions that build and pass the tests. Where a newer version is known to break something, it stays behind, and `.github/renovate.json` holds it with the reason in the rule description. The tests come first, in their own commits: - `make go-unit-tests` runs the Go tests under `pkg/` and `cmd/`, except the backport-batch suite, which keeps its own target. The apiserver serializer and fuzz tests, the generated OpenAPI and applyconfiguration suites, the apis packages and the controller, operator and observability-proxy commands did not run in CI before. - The apps API surface that apiserver libraries shape is pinned: server-side apply, content negotiation, Table output on watch, the served OpenAPI v2 and v3 documents, and building the server without etcd. Two answers look wrong and are pinned as they are today: applies from different field managers never conflict (#4857), and protobuf is refused with 406 even when the client offers JSON as a fallback (#5297). - New tests cover the kubeovn webhook patch, the token proxy session cookie and the mount-utils behaviour the kubevirt CSI node service relies on. - `hack/image-smoke.bats` checks the tools the CSI, LINSTOR, multus, Harbor and redis-backup images take from their base images or build stages, and that the kubevirt CSI node plugin and its sidecars need no more than x86-64-v2. Each PR build job runs it against the images it pushed; forks and the unit lane run no container. The tests found two bugs: - The kubeovn webhook dereferenced a nil pointer on an admission review without a request, so the caller got a dropped connection instead of a 400. - The token proxy cookie refresh never fired: securecookie decodes the session times as int64 and the refresh looked for float64, so the `--cookie-refresh=1h` the chart sets did nothing. A refreshed cookie keeps the token's expiry. A session too large to encode now shows an error at sign-in and leaves the current cookie alone on refresh. What moved: - GitHub Actions to their Node 24 majors. The flux action stays on the tag of the Flux CLI it installs. The release job's checkout no longer persists credentials, so its staging branch push uses the App token. - Go 1.27.2 for the toolchain and builders. Builds that reproduce an upstream release keep the Go upstream uses: Harbor, cilium-operator, SeaweedFS and the chainsaw stage of the e2e sandbox. - controller-runtime v0.25.2, gateway-api v1.6.3 on the minor of the installed v1.6.1 CRDs, cel-go v0.30.0, grpc v1.84.0, etcd v3.7.2, cert-manager v1.21.2, kubevirt csi-driver f10ae94 on Kubernetes v0.37.1. - Node 24 for the dashboard console. Held back, each with its reason in the Renovate rule: - cel-go stays below v0.31: the old repository has no tags past v0.30.0, and v0.32 moves to cel.dev/cel-go, which k8s.io/apiserver does not import. - kube-openapi stays on the commit its dependencies require, and structured-merge-diff stays on v6, because k8s.io/apimachinery v0.37 does not compile against v7. - The Flux API modules stay on the Flux v2.8 line the platform installs. - gomodules.xyz/jsonpatch stays on v2, which controller-runtime's admission.Patched takes. - jwx stays on v3: v4 removes jwk.Cache, which the token proxy's JWKS refresh is built on. - kubevirt.io/api and the CDI API stay where upstream csi-driver builds. - The kubevirt CSI driver image stays on AlmaLinux 9, because AlmaLinux 10 builds its amd64 userland for x86-64-v3. - shadowbox stays on node 18, which outline-server declares in its engines. - The e2e sandbox stays on Ubuntu 24.04. 26.04 ships uutils coreutils, whose `date` costs about 4x per call, and the test harness forks it per traced line, which adds about ten minutes to the install phase. - clastix/kubectl stays on v1.32 for the cleanup hooks, within kubectl's one-minor skew. The cert-manager Go module (v1.21.2) is one minor ahead of the installed chart (v1.20.2). The Certificate objects the gateway controller writes serialize the same either way. `api/apps/v1alpha1` now requires Go 1.27.2, which applies to every module that imports the published types. The Linux run with Go 1.27.2 was done before the rebase onto current main, and the rebased head has not been through it yet. There the five modules built, vetted, tested and tidied cleanly, and the repository unit, controller and envtest lane passed. `go test -race` passed in four modules. In the root module it failed only on a pre-existing data race in the workload monitor tests (#5296), which main has too. The image smoke checks run in this PR's CI. ### Screenshots No UI change. ### Downstream repositories `api/apps/v1alpha1` moves to `go 1.27.2`, and cozystack/terraform-provider-cozystack imports it, so that repository is affected but needs no action. Its box stays empty for that reason, and so does the "not affected" one. - [ ] 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: none needed, because its Renovate raises the go directive together with the pin bump and its CI takes Go from `go.mod`; the only effect is that the provider's minimum Go becomes 1.27.2. - [ ] [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 chore(deps): move the toolchain and builder images to Go 1.27.2 and raise Go modules, base images and GitHub Actions to newer working releases; the dashboard token proxy now refreshes its session cookie, and the kube-ovn webhook rejects an admission review without a request instead of dropping the connection. ``` |
||
|
|
a3e60ec372 |
feat(kafka)!: run on Strimzi 1.2.0 and Kafka 4.x (#4900)
<!-- Thank you for making a contribution! Here are some tips for you: - Use Conventional Commits for the PR title: `type(scope): description` - Types: feat, fix, security (a fix that comes through a security advisory), docs, style, refactor, perf, test, build, ci, chore - Scopes are not an exhaustive list — pick the most specific scope for the change and extend the list when a genuinely new area appears. Examples: - System components: dashboard, platform, operator, cilium, kube-ovn, linstor, fluxcd, cluster-api - Managed apps: postgres, mariadb, redis, kafka, clickhouse, virtual-machine, kubernetes - Development and maintenance: api, hack, tests, ci, docs, maintenance - Breaking changes: append `!` after type/scope (`feat(api)!: ...`) or add a `BREAKING CHANGE:` footer - If it's a work in progress, consider creating this PR as a draft. - Don't hesistate to ask for opinion and review in the community chats, even if it's still a draft. - Fixes merged to `main` reach the release lines the backport batch runs for automatically, so do not open backport PRs by hand: https://github.com/cozystack/cozystack/blob/main/docs/release/backports.md --> ## What this PR does This upgrades the Kafka operator to Strimzi 1.2.0. Kafka 4.3 is the application default, with 4.2 also available. Upgrades must pass through Cozystack v1.7 and finish the ZooKeeper-to-KRaft migration first. The upgrade now stops while any Kafka lacks KRaft evidence. Every Kafka must report a nonempty `kafkaMetadataVersion` and the `KRaft` metadata state. The API conversion deletes that state, so without it a Kafka needs `Ready=True` or the `cozystack.io/kraft-verified` annotation, which migration 61 writes on every Kafka it accepts before it stops the operators. Any other explicit state blocks, and the error gives the reason for each Kafka. On every variant, the platform chart refuses to switch package sources while Strimzi still serves `v1beta2` and a Kafka fails that check. On variants without the migration hook, it also refuses while any Strimzi CRD still stores `v1beta2`, so `/migrations/61` has to run first. Migration 61 checks the same evidence again, including on repeat runs, and blocks unfinished broker-pool drains. A manual change that bypasses the managed package source is outside this check. Existing Kafka 3.x applications move to v4.3. Kafka 4 no longer accepts clients older than Kafka 2.1. Kafka 4 also rejects the topic settings `message.format.version`, `message.downconversion.enable` and `message.timestamp.difference.max.ms`, and a `segment.bytes` below 1 MiB (1048576), which Kafka 3.x accepted down to 14 bytes. A Kafka 4 broker whose log holds such a topic does not start. The chart now refuses to render a topic that sets any of these. The platform upgrade refuses to start while a Kafka application sets one, and migration 61 also checks KafkaTopic resources, so topics created outside the chart are caught too. A topic created through the Kafka admin API without a KafkaTopic is not visible to these checks. Restoring a topic-metadata backup taken on Kafka 3.x skips the three removed settings and raises a smaller `segment.bytes` to 1 MiB, with a warning for each. In-place downgrades are unsupported. The default 10-minute Helm timeout can leave a long broker roll Failed until its retry succeeds. The migration does not run automatically on every platform variant. Only the `isp-*` variants run it automatically. On other variants, run `/migrations/61` from the matching migrations image before upgrading, as the Kafka README describes. This includes clusters that run no Kafka but have the kafka-operator package, from the `paas` bundle or `bundles.enabledPackages`. Their Strimzi CRDs still store `v1beta2` even with no objects. The migration converts Strimzi resources and stored Helm references to `v1`. It stamps platform version 62. Running it manually also skips earlier migrations on a later move to an `isp-*` variant. Before it stops the operators, migration 61 refuses objects that the Strimzi 0.51 conversion tool would reject and names each one, for example a Kafka with `.spec.kafka.resources` or with OAuth, Keycloak or OPA settings. A failed conversion can leave the old operators stopped until the migration succeeds and the operator release upgrades. The failed conversion Job stays for diagnosis, but its ClusterRole, binding and ServiceAccount are removed. A Job that is still running when the wait times out keeps them, because the retry waits for it. Known limitations. Migration 61 converts with the old operator stopped, while Strimzi's conversion guide expects a running operator of 0.49 or later. I stop it because 0.45 keeps writing the Kafka status through `v1beta2`, but I have not checked this on a live cluster. Objects Strimzi created keep `ownerReferences` to `v1beta2` until Strimzi 1.2 reconciles them. Deleting a Kafka before that can leave dependents behind, and the chart's pre-delete hook covers only StrimziPodSets. The conversion image is pulled from quay.io by digest with no values override, so an air-gapped cluster has to mirror it under the same name. The full offline unit run passed on Linux on `1171d63adfafb45be34214fb9a0f565723e255fd`: 2,576 cases, no failures, errors or skipped tests. Later changes were checked on `69c704499fa4` with the Bats tests for migration 61, the migration runner, the Kafka hooks and the Kafka backup scripts (102), the platform Helm suite (310 tests) and the Kafka Helm suite (91 tests). After the rebase onto `main` at `5a5d5cd3d85f`, `a48a2f259947` passes the same Bats tests (115) and the platform and Kafka Helm suites (326 and 103 tests). It also passes the new check against added `documentIndex` selectors. I have not validated this revision on a live cluster. Closes #4365 ### Screenshots <!-- REQUIRED for UI changes: attach screenshots or screen recordings demonstrating the visual impact of your changes. PRs with UI changes without screenshots will not be merged. --> Not a UI change. ### Downstream repositories <!-- Cozystack is upstream for repositories that are NOT kept in sync with it automatically, and nothing in CI compares the two sides, so a change here can break them silently. Which change forces what, and which file to touch, is the trigger map in docs/agents/contributing.md under "Downstream Repositories". Walk it before you tick anything. IF YOU ARE AN AI AGENT OR AN LLM, THIS IS PART OF THE TASK, NOT A FORM TO FILL IN: 1. Walk the trigger map against the actual diff of this PR, file by file. Do not decide from the PR title or from your memory of what you changed. 2. For every repository you tick, open the follow-up PR there and link it on the same line. A ticked box with no link claims work that does not exist, which is worse than an empty box. Search that repository for an open PR or issue covering it first, and link that instead of filing a duplicate. 3. When the follow-up is out of scope, or needs a decision that is not yours to make, open an issue in that repository instead, link that, and say so in the PR body. Do not push a speculative PR into another repository just to fill a line here. 4. Do not tick "No downstream repository is affected" to make the checklist go away. If you are unsure, leave every box empty and say so in the PR body, so a human decides. --> - [ ] No downstream repository is affected by this change - [x] [cozystack/website](https://github.com/cozystack/website) - follow-up: https://github.com/cozystack/website/issues/805 - [ ] [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: The Terraform provider does not model the Kafka `version` field. The website issue covers the upgrade notes the `default` variant needs. ### Release note <!-- Write a release note: - Explain what has changed internally and for users. - Start with the same `type(scope):` prefix as in the PR title - Follow the guidelines at https://github.com/kubernetes/community/blob/master/contributors/guide/release-notes.md. --> ```release-note feat(kafka)!: upgrade to Strimzi 1.2.0 and Kafka 4.3 by default, with Kafka 4.2 also available. Platform migration 61 converts Strimzi resources to v1 and moves Kafka 3.x applications to v4.3. Every Kafka must have confirmed KRaft state before the upgrade, including on repeat runs. Upgrade through Cozystack v1.7 first. Kafka 4 drops clients older than Kafka 2.1 and the message.format.version, message.downconversion.enable and message.timestamp.difference.max.ms topic settings, and requires segment.bytes of at least 1 MiB; the chart and the upgrade refuse a topic that breaks either rule, and a topic-metadata backup taken on Kafka 3.x restores without the removed settings and with segment.bytes raised to 1 MiB. In-place downgrades are unsupported. ``` |
||
|
|
7145a67568 |
fix(backups): stop leaking MariaDB dumps of stuck runs and torn-down namespaces
A k8s.mariadb.com/Backup the BackupJob gave up on stayed for good: no Backup is made of such a run, so nothing deleted it, and while it stood short of Complete the dump cleanup counted its open window as a possible writer of every later dump of the application and kept each of them. Every failure exit of a started BackupJob in the MariaDB driver now goes through failMariaDBBackupJob: the deadline, the application, MariaDB CR or strategy going away, a run the operator failed at Complete=False, and a run that could not be created. It lists the job's runs on the API server, where the cache can trail a run created or completed a moment ago, and deletes each one short of Complete under the UID and resourceVersion it read, so a run that completes in between is handed to the success path instead. Deleting the run takes its Job and pod, so what held the pod up is first copied into the failure message. A Running or expired job takes its run from that listing and never starts another, so a retry after a failed status write cannot start a second. During namespace teardown the operator Backup, which carries no finalizer, is usually gone before the Backup finalizer runs, and the cleanup, which read the storage from it, left the dump behind. A Backup that recorded its dump on the platform bucket now has it deleted with the platform credentials, which do not go with the namespace, reading the storage from the snapshot in status.underlyingResources; the dump is still kept when another run could have written it. The snapshot and the storage URI now record the storage the run was created with rather than the strategy as rendered at completion, which a strategy edited during the run would otherwise send the cleanup away from. Closes: #5291 Assisted-by: LLM Signed-off-by: Andrey Kolkov <androndo@gmail.com> |
||
|
|
2495ebfaa0 |
fix(postgres): restore from an archive with the access it was written with (#5295)
## What this PR does Stacked on #5221; review that one first. Once it merges this PR retargets to `main`. A CNPG restore took the destination path and endpoint of the source from the Backup artifact, but the credentials Secret, its key names and the endpoint CA from the CNPG strategy as it reads at restore time. Once the strategy pointed at another bucket or endpoint, the restore combined the recorded location with access settings meant for a different one, and recovery failed after an in-place restore had already purged the target Cluster. The destination record that #5221 annotates on the `cnpg.io/Backup` now also carries the key names and the CA, and the artifact copies them into `driverMetadata["cnpg.io/archive-access"]`. The size probe reads them from there too. The restore picks the access as follows: 1. While the strategy still points at the same endpoint and S3 bucket as the artifact, the strategy's access is used, exactly as before. WAL archiving keeps proving that access against the archive, and it carries any credential rotation since the backup, after which the recorded Secret may already be revoked. The prefix inside the bucket is not compared, since access is taken to be granted per bucket. 2. Once the archive has moved, the recorded access is used if its Secret and CA Secret exist and hold non-empty values under the recorded keys. 3. Otherwise the strategy's access is used, as before, with a `RecordedArchiveAccessUnavailable` Warning event on the RestoreJob. Credentials wider than one bucket can still read the old archive with it. An unreadable record fails the RestoreJob, and an error reading a Secret is retried, both before the HelmRelease is suspended and the target is purged. Artifacts written before this change keep working: one that records only the Secret uses it with the strategy's key names and CA once the archive has moved, and one without any record uses the strategy. This narrows the behaviour the issue asks for ("the recorded Secret, key names and CA, falling back to the strategy only for artifacts that carry no record") in two places, points 1 and 3 above, so that rotating credentials for an archive that has not moved, and deleting the old Secret after a move, keep working as they did. One case remains uncovered: a recorded Secret that still exists but whose keys were revoked, after the archive moved, while the strategy's credentials could still read the old bucket. ### Screenshots Not applicable: no UI change. ### Downstream repositories The diff touches only `internal/backupcontroller`: no CRD, values, chart or naming change, so nothing in the trigger map applies. - [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(postgres): restoring a Postgres backup after its CNPG strategy moved to another bucket or endpoint now reaches the archive with the credentials Secret, key names and CA the backup was written with, as long as those Secrets still exist; otherwise, and for an archive that has not moved, the strategy's current access is used as before. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Bug Fixes** * Restore operations now use the access settings recorded with the backup when the archive destination has changed. * When recorded access settings are unavailable, the controller falls back to the current strategy settings and issues a warning. Invalid access metadata or Secret read errors stop the restore before the target is patched. * **New Features** * Backup records now retain the credential key names and CA reference used to access the archive. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
2cd41b411f |
fix(backups): read the Strimzi Kafka CR through the v1 API
Strimzi 1.x no longer serves kafka.strimzi.io/v1beta2, so the Kafka backup driver's readiness check would fail on every backup and restore. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <f@lex.la> |