mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-30 04:06:34 +09:00
bcba5d349a6cd2ae71fb4ec03e73dfddcb965c27
8781
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
bcba5d349a |
security(monitoring): reset the Alerta admin password on every start
The entrypoint creates admin users only when they are missing, so an admin user created before Alerta had a password of its own keeps the Grafana password, which stays valid after an operator rotates Grafana's. The respin runs a step right after user creation that sets every admin user's password to ADMIN_PASSWORD, and stops the container if it fails. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com> |
||
|
|
68b0e80d17 |
security(monitoring): show tenants Alerta's login apart from its keys
Tenants logged in to the Alerta UI with the Grafana credentials, the only Secret of the release they are shown. With Alerta on a password of its own, that password moves to a Secret that holds nothing but the login, listed for tenants next to Grafana's, so the signing key and the API key in the alerta Secret stay hidden. The alerta Secret is now rendered under data alone. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com> |
||
|
|
8942c7dfcc |
security(monitoring): keep Alerta credentials out of its container log
The upstream Alerta entrypoint prints the whole environment, including the admin password and API key, and echoes the admin API keys it creates, while nginx logs the request line where Alertmanager passes the key as a query parameter. Pod logs are readable at lower tenant tiers than the credentials themselves. The respin drops the environment dump, silences key creation and masks the api-key parameter in the access log. Each edit is checked during the build, so an upstream change to either file fails the image build rather than bringing the output back. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com> |
||
|
|
d99a1a063e |
fix(monitoring): give Alerta a real signing key and its own admin password
Alerta signs its session JWTs with SECRET_KEY, but the upstream image never
wires a real value into it: the entrypoint renders the generated key into
alertad.conf under the name SECRET (which the application never reads) and
unsets SECRET_KEY before exec, so at runtime the built-in default from
alerta.settings ("changeme") signs and verifies every token. Anyone can mint
a valid admin token without credentials.
Alerta's admin account also reused Grafana's credentials
(grafana-admin-password), and Alerta exposes the whole process environment via
/api/management/properties to any admin-scoped caller, so admin on Alerta
yielded Grafana's admin password.
Generate a strong SECRET_KEY and a dedicated admin password, persist both in
the alerta Secret so they survive upgrades and restarts, feed the key to the
application through a mounted alertad.conf under the name it actually reads,
and stop referencing grafana-admin-password. Add a unittest covering the key,
the mount and the credential decoupling.
Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
|
||
|
|
7be083a5a7 |
feat(harbor): expose replicas and zone spread for the request path (#4880)
<!-- Thank you for making a contribution! Here are some tips for you: - Use Conventional Commits for the PR title: `type(scope): description` - If it's a work in progress, consider creating this PR as a draft. --> ## What this PR does Closes #4824. Every `docker login`, pull and push goes through nginx → core (`/service/token`) → registry, and each of them ran as a single pod. Losing the node that hosted one stopped all registry traffic, however many PostgreSQL and Redis instances backed it. The vendored goharbor chart already scales these components and the registry keeps its blobs in S3, so only the wrapper was missing the knobs. **Request path (`packages/apps/harbor`)** - New `nginx.replicas`, `portal.replicas`, `core.replicas` and `registry.replicas`, all defaulting to `1`. - Above one replica, the wrapper forwards to the upstream chart a `podDisruptionBudget` with `maxUnavailable: 1` and `topologySpreadConstraints`. Upstream defaults `minAvailable` to 1 and renders whichever of the two fields is set, and the API server rejects a PDB carrying both, so the wrapper forwards `minAvailable: 0` to drop it. - At one replica nothing but `replicas: 1` is forwarded, which is the upstream default, so an existing install renders the same Deployments as before. - The `WorkloadMonitor`s for core, registry and portal take `replicas` from the values instead of a hard-coded `1`. `minReplicas` stays at 1, since one serving replica is enough for the component to work. - The spread follows the platform's `scheduling.globalAppTopologySpreadConstraints` (read from `_cluster.scheduling`), as postgres, etcd, keycloak, grafana and kubernetes-nodes already do, so the cluster operator sets the policy once. When the platform sets none, a soft spread stands in: zone then hostname, both `ScheduleAnyway`, so a cluster without zone labels or with fewer nodes than replicas still schedules every replica. Any `labelSelector` in the policy is dropped, because the upstream chart appends its own `release`/`app`/`component` selector to every entry. **Data tier (`packages/system/harbor`)** - The CNPG `Cluster` (when `database.replicas > 1`) gets `topologySpreadConstraints` from the same platform policy, or a `ScheduleAnyway` zone spread when the platform sets none; CNPG's default anti-affinity handles nodes. The Redis pods and sentinels already spread hard per node on main (#4990); this adds a `ScheduleAnyway` zone spread on top of that default. A constraint in the platform policy without a selector gets the component's own; a selector the policy sets is kept, as in the keycloak chart. **Deviations from the issue, on purpose** - Placement follows the platform-wide `globalAppTopologySpreadConstraints` instead of a set of rules hard-coded in Harbor, to stay consistent with the other applications. The fallback spreads across nodes with a `topologySpreadConstraints` entry rather than a preferred `podAntiAffinity` term: the upstream chart appends its own selector to spread entries, while an affinity term is passed through verbatim and would have to hard-code that label set in the wrapper. - On the data tier the zone spread goes through `topologySpreadConstraints`, not `affinity.topologyKey: topology.kubernetes.io/zone`. Moving CNPG's `topologyKey` to the zone would drop its per-node anti-affinity, so instances could share a node on a cluster without zone labels. With spread constraints the two add up, and for Redis the zone entry sits beside the per-node one. - `jobservice.replicas` (item 5 of the issue, which needs `jobLoggers: [database]`) is left for a follow-up, as the issue suggests. **Upgrade impact** - Request path: none at the default replica count. - Data tier: `database.replicas` and `redis.replicas` default to 2, so on upgrade most installs see a one-off rolling restart of the CNPG instances (with a switchover), of the Redis pods and of the sentinels, as their pod spec gains the spread constraint. Where the platform policy uses `DoNotSchedule`, it is now enforced for Harbor pods too, as it already is for the other applications. **Tests** - `packages/apps/harbor/tests/replica_placement_test.yaml`: defaults forward nothing beyond `replicas: 1`; above one replica the PDB and spread are forwarded; the platform policy replaces the fallback and loses its `labelSelector`, and is ignored at one replica; components scale independently; `registry.replicas` lands at the Deployment level, not under `registry.registry`; WorkloadMonitors follow the values. - `packages/system/harbor/tests/zone_spread_test.yaml`: CNPG, Redis and sentinel spread with the right selectors and no `affinity` override, both with the fallback and with a multi-entry platform policy, keeping a selector the policy sets; `redis_spread_test.yaml` covers the per-node default with the zone entry on top; and, rendering the vendored chart with the values the wrapper forwards, the PDB carries `maxUnavailable` alone and the spread entries are scoped to the component's pods. - Checked that the tests fail with the fix removed (helper without `minAvailable: 0`, upstream PDB without the zeroing, CNPG spread removed, platform policy ignored). `helm unittest` on both charts: 72/72 passing. Also rendered the app chart, with and without a platform policy, fed its HelmRelease values into the system chart, and checked the resulting Deployments, PDBs and CNPG `Cluster`. ### Screenshots No UI change. ### Downstream repositories - [ ] 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#70 (issue: the provider models Harbor by hand) - [ ] [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 adds fields to the `harbor` app's `values.schema.json`, which the Terraform provider models by hand, so a follow-up issue is open there. The website reference page is regenerated from the README on release, and no other trigger in the map matches the diff. ### Release note ```release-note feat(harbor): nginx, portal, core and registry now take a `replicas` value. Above one replica they get a PodDisruptionBudget and follow the platform's `globalAppTopologySpreadConstraints`, or a best-effort spread across zones and nodes when none is set, so draining or losing a node or zone keeps docker login, pull and push working. The PostgreSQL and Redis instances and the Redis sentinels now follow the same policy, or a best-effort zone spread; on upgrade this causes a one-off rolling restart of the database and Redis pods. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * Harbor NGINX, portal, core, and registry replica counts are configurable and default to one. Above one replica, these components use a PodDisruptionBudget and follow platform-wide placement settings when available, or spread across zones and nodes otherwise. * Database replicas spread according to placement settings when configured above one. Redis replicas also spread above one, while all three Redis sentinels are always spread. * Core and registry resource settings now use a shared default when not specified. * **Documentation** * Harbor configuration guidance now describes replica settings, placement behavior, and PodDisruptionBudget behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
c797803dd7 |
feat(vm-instance): keep a cozyplane VM's IP and MAC (#5389)
## What this PR does It bumps cozyplane to v0.1.5 and has a cozyplane `vm-instance` VM hold its Port through a `PortClaim`, so the VM keeps its IP and MAC across restarts and live migrations. Without a claim, a VM's Port is garbage-collected when its launcher pod goes away, and the next launcher pod gets a new IP and a random MAC. A guest whose network config is pinned to the old MAC then matches no interface and loses its network. lllamnyp/cozyplane#79 (released in v0.1.3) fixes this without special-casing KubeVirt. A namespaced `PortClaim` in `sdn.cozystack.io` holds a cluster-scoped `Port` the way a PVC holds a PV, and a pod binds it with the annotation `sdn.cozystack.io/port-claim: <name>`, resolved in the pod's own namespace. The claim keeps its IP and MAC for as long as it exists: a stopped VM keeps its address reserved, and deleting the claim frees it. - **cozyplane v0.1.5.** `cozyplane`, `cozyplane-kpr` and `cozyplane-apiserver` are re-vendored with `make update` at `b99171ea7` (tag `v0.1.5`). Beyond v0.1.3's PortClaim, it carries lllamnyp/cozyplane#80, so a PortClaim that adopts a running VM's Port keeps it bound to the pod already holding it and reports `Bound=True` with reason `PreClaimPod`. It also carries lllamnyp/cozyplane#81: the aggregated apiserver sets `metadata.generation` and the controllers stamp `observedGeneration`, so a retargeted FloatingIP no longer keeps its old target's status. The wrappers pin the release images by tag and digest: - `ghcr.io/lllamnyp/cozyplane:v0.1.5@sha256:2cc55293000b64a4c4233910cbc3803b9bea7c16e9e7d44ddcc44fb4042cdd98` - `ghcr.io/lllamnyp/cozyplane-kpr:v0.1.5@sha256:28254bdc0283b3797ea8c5f26146932c46b0be98a15cdd660cb42330963cb01c` The aggregated apiserver serves `PortClaim` from the same binary, and its chart changes only in the image pin. The CNI chart gains the agent's and controller's PortClaim RBAC, and its tenant roles gain `portclaims`. - **`vm-instance`.** A VM that joins a VPC through `networks` renders a `PortClaim` named after the VM, with `spec.vpcRef` set to the VM's VPC, and annotates its pod template with `sdn.cozystack.io/port-claim: <VM name>` next to `sdn.cozystack.io/vpc`. The name matters: cozyplane adopts a running VM's existing Port into a claim named after that VM, so running VMs keep their IP and MAC through the upgrade. Without a VPC, or on kube-ovn, nothing changes. - **RBAC.** No change is needed. Releases are applied by the same identity that already applies the VPC application's `sdn.cozystack.io` objects. Tenants reach `portclaims` through cozyplane's own tenant roles, which `cozy:tenant:cozyplane-edit` and `-view` (#3149) already aggregate into the `cozy:tenant*` tiers: every access level can read claims, and admins can manage them. ### Compatibility The bump and the chart change have to land together. From v0.1.3 a VM with no claim gets a new IP and MAC on every launcher pod, live migration included. **Upgrading running VMs.** A VM adopted while it was running gets a new IP and loses its network if it is live-migrated before a restart. Such a VM's claim shows `Bound=True` with reason `PreClaimPod`, and the VM is marked `RestartRequired`; restart it before migrating it. **Tenant Kubernetes worker VMs are not covered.** `kubernetes-nodes` is unchanged, so from v0.1.3 a tenant cluster's worker VMs keep no IP or MAC across restarts or live migrations. A PortClaim's spec is immutable. Changing `networks[0].name` on an existing VM therefore fails the release upgrade at the claim, instead of moving the VM to another VPC as it did before. ### Tests The new helm-unittest suite `vm-instance/tests/portclaim_test.yaml` covers a VPC VM (one claim named after the VM, its `vpcRef`, no `mac`, and the pod-template annotation), cozyplane with no VPC (no claim, no annotation), and kube-ovn (no claim, no annotation). The `vm-instance`, cozyplane wrapper, kubernetes, kubernetes-nodes and platform suites pass. ### Downstream repositories - [ ] 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: Boxes left unticked so a human decides. ### Release note ```release-note feat(vm-instance): on the cozyplane networking variant, a VM in a VPC keeps its IP and MAC across restarts and live migrations through a PortClaim; cozyplane is bumped to v0.1.5 ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * VMs configured with supported VPC networks now receive a port claim that launcher pods can use to bind to the selected network. * Tenant roles now support viewing and managing port claims, with access appropriate to each role. * **Updates** * Cozyplane components are updated to version 0.1.4, including the API server and Kubernetes provider. These updates include revised support for port claims. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
f7a52ed4f6 |
feat(vm-instance): keep a VPC VM's IP and MAC
From cozyplane v0.1.3 a pod without a PortClaim gets a new Port, and so a new IP and MAC, on every launcher pod, live migration included. A guest whose network config is pinned to its MAC then loses its network after a restart. A VM in a VPC now renders a PortClaim named after the VM and binds its launcher pods to it, so the address survives restarts and migrations and stays reserved while the VM is stopped. The name matches the VM so cozyplane adopts the Port a running VM already has. Assisted-by: LLM Signed-off-by: Timofei Larkin <lllamnyp@gmail.com> |
||
|
|
f17cd76d5e |
feat(cozyplane): bump to the v0.1.5 release
v0.1.5 adds the PortClaim kind: a pod naming a claim in its sdn.cozystack.io/port-claim annotation keeps the claim's IP and MAC across launcher pods. A claim that adopts a running VM's Port keeps it bound to the pod already holding it and reports Bound=True with reason PreClaimPod. Without a claim a VM now gets a new IP and MAC on every launcher pod, live migration included, so vm-instance claims one in the next commit. The aggregated apiserver now sets metadata.generation, and the controllers stamp observedGeneration, so a retargeted FloatingIP no longer keeps its old target's status. The vendored charts pin a main build, so the wrappers keep pinning the release images by tag and digest. Assisted-by: LLM Signed-off-by: Timofei Larkin <lllamnyp@gmail.com> |
||
|
|
a2b341e31b |
fix(kubernetes): include the namespace in the kubevirt-csi ClusterRole name (#5236)
## What this PR does The ClusterRole that lets the kubevirt-csi controller get PersistentVolumes in the management cluster, and its ClusterRoleBinding, are named `<release>-kcsi` and `<release>-kcsi-binding`. They are cluster-scoped and the release is named after the cluster, so two tenants that each have a Kubernetes cluster with the same name render the same pair. I hit this on a 1.6 cluster. A user moved from one tenant to another and created a cluster named `test` in the new tenant while the old tenant still had its own `test`: - installing the new release did not fail: the audit log shows helm-controller getting and patching the existing ClusterRoleBinding, and the release reported `Install complete`; - when the old tenant was deleted, its uninstall deleted `kubernetes-test-kcsi` and `kubernetes-test-kcsi-binding` (helm-controller's `delete` on both is in the audit log); - from then on the new cluster's CSI controller failed every `ControllerExpandVolume` with `error fetching pv ... persistentvolumes "pvc-..." is forbidden: User "system:serviceaccount:tenant-...:kubernetes-test-kcsi" cannot get resource "persistentvolumes" ... at the cluster scope`, and PVC resizes stayed in `Resizing`; - the next upgrade of the new release recreated the pair, and resizing worked again. Now both objects are named `<namespace>-<release>-kcsi` and `<namespace>-<release>-kcsi-binding`, the same way the kccm ClusterRole and binding already are. The rules and the subject are unchanged. On upgrade Helm creates the new pair before it deletes the old one, so the driver doesn't lose access in between. `tests/csi_rbac_test.yaml` checks the new names, the PersistentVolume rule, the binding's roleRef and subject, and that a release with the same name in another namespace gets its own pair. Without the template change three of the four cases fail; the whole chart suite passes (370 tests). The same naming is in release-1.6, so this needs a backport. ### Screenshots Not a UI change. ### Downstream repositories I walked the trigger map against the diff (one chart template and its unit tests): no package added or removed, no values, schema or default changed, no output Secret or Service renamed, nothing under `hack/` touched. - [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(kubernetes): the kubevirt-csi ClusterRole and ClusterRoleBinding are now named after the tenant namespace and the cluster, so deleting a cluster no longer removes PersistentVolume access, and with it volume expansion, from a cluster with the same name in another tenant. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Bug Fixes** * CSI access-control resources in non-Proxmox deployments now include the release namespace in their names, allowing same-named releases in different namespaces to have separate roles and bindings. Each binding remains associated with its corresponding role and service account. The permissions granted to the CSI service account are unchanged. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
c51ea43fee |
chore(deps): update module golang.org/x/net to v0.62.0 [security] (#4822)
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [golang.org/x/net](https://pkg.go.dev/golang.org/x/net) | [`v0.61.0` → `v0.62.0`](https://cs.opensource.google/go/x/net/+/refs/tags/v0.61.0...refs/tags/v0.62.0) |  |  | --- ### Avoid quadratic complexity when coalescing text nodes in html in golang.org/x/net [CVE-2026-78661](https://nvd.nist.gov/vuln/detail/CVE-2026-78661) / [GO-2026-6860](https://pkg.go.dev/vuln/GO-2026-6860) <details> <summary>More information</summary> #### Details When coalescing adjacent text nodes in addText and fosterParent, appending to an existing TextNode's Data via string concatenation (n.Data += text) reallocated and copied the accumulated string on every token. Inputs containing many short text runs separated by ignored end tags (such as "a</x>") caused O(n^2) allocations and byte copies. Accumulate coalesced text in per-node byte slices during parsing and materialize Data strings once at the end of parse. #### Severity Unknown #### References - [https://go.dev/cl/849365](https://go.dev/cl/849365) - [https://go.dev/issue/82224](https://go.dev/issue/82224) - [https://groups.google.com/g/golang-announce/c/sqrs2vTx_Xs](https://groups.google.com/g/golang-announce/c/sqrs2vTx_Xs) This data is provided by [OSV](https://osv.dev/vulnerability/GO-2026-6860) and the [Go Vulnerability Database](https://redirect.github.com/golang/vulndb) ([CC-BY 4.0](https://redirect.github.com/golang/vulndb#license)). </details> --- ### Check all ancestor namespace transitions when rendering raw text in html in golang.org/x/net [CVE-2026-97045](https://nvd.nist.gov/vuln/detail/CVE-2026-97045) / [GO-2026-6866](https://pkg.go.dev/vuln/GO-2026-6866) <details> <summary>More information</summary> #### Details In childTextNodesAreLiteral, walking up the tree previously stopped at the nearest foreign ancestor once an HTML integration point was found. However, that integration point may itself be a descendant of an element that was foster-parented into a foreign namespace (such as <mglyph> or <malignmark> fostered under <mtext>), causing a parser to resolve the subtree in a different foreign namespace upon re-parsing the rendered output. Continue walking the full ancestor chain and verify that every transition from a non-empty namespace occurs at an HTML integration point before emitting literal text. #### Severity Unknown #### References - [https://go.dev/cl/855121](https://go.dev/cl/855121) - [https://go.dev/issue/82622](https://go.dev/issue/82622) - [https://groups.google.com/g/golang-announce/c/sqrs2vTx_Xs](https://groups.google.com/g/golang-announce/c/sqrs2vTx_Xs) This data is provided by [OSV](https://osv.dev/vulnerability/GO-2026-6866) and the [Go Vulnerability Database](https://redirect.github.com/golang/vulndb) ([CC-BY 4.0](https://redirect.github.com/golang/vulndb#license)). </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/cozystack/cozystack). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xMzQuMSIsInVwZGF0ZWRJblZlciI6IjQ0LjI0OS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWF0ZWQiLCJzZWN1cml0eSJdfQ==--> |
||
|
|
4e957bde0d |
chore(deps): update module github.com/klauspost/compress to v1.20.2 [security] (#5238)
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [github.com/klauspost/compress](https://redirect.github.com/klauspost/compress) | `v1.20.1` → `v1.20.2` |  |  | --- ### Panic on two-block frames in github.com/klauspost/compress [CVE-2026-116591](https://nvd.nist.gov/vuln/detail/CVE-2026-116591) / [GHSA-fpmh-frq8-7rj8](https://redirect.github.com/advisories/GHSA-fpmh-frq8-7rj8) / [GO-2026-6865](https://pkg.go.dev/vuln/GO-2026-6865) <details> <summary>More information</summary> #### Details Panic on two-block frames in github.com/klauspost/compress #### Severity Unknown #### References - [https://github.com/klauspost/compress/security/advisories/GHSA-fpmh-frq8-7rj8](https://redirect.github.com/klauspost/compress/security/advisories/GHSA-fpmh-frq8-7rj8) - [https://github.com/klauspost/compress/commit/7f5d8528720c895a6106f201719f87eb030a565d](https://redirect.github.com/klauspost/compress/commit/7f5d8528720c895a6106f201719f87eb030a565d) - [https://github.com/klauspost/compress/releases/tag/v1.20.2](https://redirect.github.com/klauspost/compress/releases/tag/v1.20.2) This data is provided by [OSV](https://osv.dev/vulnerability/GO-2026-6865) and the [Go Vulnerability Database](https://redirect.github.com/golang/vulndb) ([CC-BY 4.0](https://redirect.github.com/golang/vulndb#license)). </details> --- ### Release Notes <details> <summary>klauspost/compress (github.com/klauspost/compress)</summary> ### [`v1.20.2`](https://redirect.github.com/klauspost/compress/releases/tag/v1.20.2) [Compare Source](https://redirect.github.com/klauspost/compress/compare/v1.20.1...v1.20.2) - zstd: Fix DecodeAll crash on specially crafted input. [GHSA-fpmh-frq8-7rj8](https://redirect.github.com/klauspost/compress/security/advisories/GHSA-fpmh-frq8-7rj8). - s2: fix LZ4 block conversion writing past dst by [@​klauspost](https://redirect.github.com/klauspost) in [#​1244](https://redirect.github.com/klauspost/compress/pull/1244) - dict: Stricter input validation by [@​klauspost](https://redirect.github.com/klauspost) in [#​1250](https://redirect.github.com/klauspost/compress/pull/1250) - zstd: reject snappy copy shorter than minimum match by [@​Raghuvardhan-Reddy78](https://redirect.github.com/Raghuvardhan-Reddy78) in [#​1235](https://redirect.github.com/klauspost/compress/pull/1235) **Full Changelog**: <https://github.com/klauspost/compress/compare/v1.20.1...v1.20.2> </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/cozystack/cozystack). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4yMjAuMCIsInVwZGF0ZWRJblZlciI6IjQ0LjI0OS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWF0ZWQiLCJzZWN1cml0eSJdfQ==--> |
||
|
|
64cd55a161 |
feat(kubernetes): run tenant clusters inside a cozyplane VPC (#5337)
## What this PR does Stacked on #4508 (VMs in a cozyplane VPC). This layer runs a whole tenant Kubernetes cluster inside a VPC: the control plane, its etcd and the worker VMs. The `Kubernetes` cluster and each of its `KubernetesNodes` pools set the same `network: {name: <VPC catalog name>}`. A VPC refuses cluster-internal destinations, so the workers, the tenant's own pods and the konnectivity agents all need an apiserver address inside the VPC. The platform side keeps working unchanged: it reaches VPC pods by their fabric IPs and through ClusterIPs that resolve to them. That covers Kamaji, CAPI, kccm, the cluster autoscaler, the chart's Jobs, the ingress passthrough, and the `super-admin.svc` kubeconfig Flux installs the tenant addons with. **Control plane.** `network.name` on the `Kubernetes` cluster does three things: - puts the apiserver pods in the VPC (`deployment.podAdditionalMetadata`); - attaches their Service to it (`network.serviceAnnotations`), so that inside the VPC the resolver answers the Service's name with a VIP from the VPC's own range; - stamps the cluster's own etcd through the `annotations` key of `cozy-lib.etcd.cluster`. etcd-operator copies that annotation onto the member Pods and both etcd Services, so the apiserver reaches its DataStore entirely inside the VPC. **Advertise address.** Kamaji's `advertiseAddress` is what the tenant's `kubernetes` endpoints and the konnectivity agents dial, and its CRD requires an IP. The right IP is the apiserver Service's VIP, which only a pod inside the VPC can learn. In VPC mode each pool's talos-reconcile Job starts a short-lived probe pod in the VPC. The probe resolves the Service's FQDN and writes the answer to its termination message. The Job reads that back with a namespaced pod `get`, patches `advertiseAddress` (Kamaji adds it to the apiserver certificate itself), and uses the VIP for the workers' `extraHostEntries` in place of the ClusterIP. This happens before the pool's TalosConfigTemplate is applied, so Kamaji's one rollout runs while the cluster has no workers yet. The Job's Role gains `create` on pods plus `get`/`delete` on the probe pod by name, in VPC mode only. **Workers.** Each pool stamps `sdn.cozystack.io/vpc` on its worker VM template, only when set, because the KubevirtMachineTemplate is content-hash named. **Route table.** A pool can also name a cozyplane RouteTable with `routeTable` (a DNS-1123 name, empty by default), the same contract as `vm-instance`'s value in #4508. When it is set, the pool renders `sdn.cozystack.io/route-table: <routeTable>` on its worker VM template next to `sdn.cozystack.io/vpc`, and setting or changing it rolls the pool's workers, as `network` does. Empty renders nothing, which leaves the VPC's default table in effect. The render fails with `routeTable` on a cluster that does not serve `sdn.cozystack.io`, on `substrate: proxmox`, or without `network.name`. The control plane keeps the VPC's default table. **Guards**, all unit-tested. The cluster refuses `network.name`: - where `sdn.cozystack.io` is not served; - on the proxmox substrate; - on the tenant's shared DataStore; - on a running cluster outside that VPC, in either direction, because etcd-operator never re-stamps a running member. A pool refuses a network that differs from its control plane's, again in either direction, checked against the live apiserver Service. Design notes: - **The probe is interim.** A request for cozyplane to report an attached Service's VIP on the Service itself (`sdn.cozystack.io/vpc-ip`, the same annotation the CNI stamps on pods) is going to upstream. Once it ships, the Job reads the annotation and the probe goes away. - **The rejected alternative is a LoadBalancer.** Publishing the apiserver Service and reaching it through the VPC gateway's NAT spends a published address per cluster and makes NAT a dependency of the control path. Not verified on a live stand yet: - the probe's resolution through the VPC resolver; - worker bootstrap and konnectivity through the VIP; - etcd member peering inside the VPC; - OIDC mode, where the apiserver dials Keycloak's internal URL from inside the VPC. ### Screenshots Not a UI change. ### Downstream repositories Walked the trigger map against the diff. terraform-provider-cozystack models app fields by hand, so the new `network` (both apps) and `routeTable` (KubernetesNodes) fields need its schema, model and expand/flatten; that is cozystack/terraform-provider-cozystack#90. The website's reference pages for kubernetes and kubernetes-nodes are regenerated from their READMEs on release, and both apps are in the website's app lists, so no follow-up is needed there. Nothing else in the map is touched. - [ ] 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#90 - [ ] [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 feat(kubernetes): on the cozyplane networking variant, a tenant Kubernetes cluster can run entirely inside a VPC — network.name puts its control plane, its own etcd and its worker VMs in the VirtualPrivateCloud ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * Kubernetes clusters now use dedicated etcd by default, with configurable one- or three-member setups and storage options. Existing clusters using shared etcd retain their current configuration. * Clusters and worker pools can join a cozyplane VPC, subject to platform and compatibility requirements. Changing a worker pool’s network rolls its worker VMs. * Cluster status notes now identify the etcd configuration in use. * **Bug Fixes** * Enabled Kubernetes add-ons and supporting services can render independently of tenant-shared etcd availability. * Cluster cleanup now handles dedicated etcd resources. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
fba9fa8278 |
docs(release): add the v1.7.0 release notes (#5163)
## What this PR does
This PR adds `docs/releasenotes/v1.7.0.md`, short hand-written release
notes used as v1.7.0 release body. File is the same as in
[
|
||
|
|
bfc9aec823 |
docs(release): add changelog for v1.7.0 (#5162)
This PR adds the changelog for release `v1.7.0`.
✅ Changelog has been automatically generated in
`docs/changelogs/v1.7.0.md`.
|
||
|
|
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. ``` |
||
|
|
eec761a40f |
feat(kubernetes-nodes): choose a cozyplane route table
A worker pool in a VPC always routed by the VPC's default table. routeTable names a cozyplane RouteTable for every worker VM of the pool and renders sdn.cozystack.io/route-table on the worker VM template, the same contract as vm-instance's routeTable. It fails the render where cozyplane does not serve sdn.cozystack.io, on proxmox workers, and without network.name. Assisted-by: LLM Signed-off-by: Timofei Larkin <lllamnyp@gmail.com> |
||
|
|
9e7741449c |
feat(kubernetes): run tenant clusters inside a cozyplane VPC
On the cozyplane networking variant a VPC refuses cluster-internal destinations, so a tenant cluster whose workers join a VPC must bring its control plane along: the workers, the tenant's own pods and the konnectivity agents all need an apiserver address inside the VPC. The platform side keeps working unchanged, since it reaches VPC pods by their fabric IPs and through ClusterIPs that resolve to them. network.name on the Kubernetes cluster puts the apiserver pods in the VPC, attaches their Service to it, and stamps the cluster's own etcd, whose operator copies the annotation onto the members and both etcd Services, so the apiserver reaches its DataStore inside the VPC too. The same value on each KubernetesNodes pool stamps its worker VM template. Kamaji's advertise address must be an IP that tenant consumers reach, which here is the VIP the VPC knows the apiserver Service by. Only a pod inside the VPC can learn it, so the pools' talos-reconcile Job starts a probe pod in the VPC, reads the address it resolves back from its termination message, advertises it, and gives it to the workers' host entries in place of the ClusterIP. The cluster refuses a VPC where sdn.cozystack.io is not served, on the proxmox substrate, on the tenant's shared DataStore, and on a running cluster outside that VPC, since etcd-operator never moves a running member. A pool refuses a network that differs from its control plane's. Both checks hold where a live object does not exist yet: the pools' reconcile Job compares the apiserver Service's VPC before the probe, and the etcd render compares the live EtcdCluster's. The probe's Role grants only get and delete, so a probe left by an interrupted attempt is deleted without waiting and polled with get. network.name is a DNS-1123 label in both apps, and every annotation carrying it is quoted. Assisted-by: LLM Signed-off-by: Timofei Larkin <lllamnyp@gmail.com> |
||
|
|
16d0f1fd19 | chore(deps): update module golang.org/x/net to v0.62.0 [security] | ||
|
|
c55c05d351 |
chore(deps): update module golang.org/x/crypto to v0.59.0 [security] (#5285)
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [golang.org/x/crypto](https://pkg.go.dev/golang.org/x/crypto) | [`v0.58.0` → `v0.59.0`](https://cs.opensource.google/go/x/crypto/+/refs/tags/v0.58.0...refs/tags/v0.59.0) |  |  | --- ### The golang.org/x/crypto/openpgp package is unmaintained, unsafe by design, and has known security issues [GO-2026-5932](https://pkg.go.dev/vuln/GO-2026-5932) <details> <summary>More information</summary> #### Details The golang.org/x/crypto/openpgp package is unsafe by design, has numerous known security issues, is not maintained, and should not be used. If you are required to interoperate with OpenPGP systems and need a maintained package, consider github.com/ProtonMail/go-crypto/openpgp which is a maintained fork that aims to be a drop-in replacement for this package. #### Severity Unknown #### References - [https://go.dev/issue/44226](https://go.dev/issue/44226) - [https://go.dev/issue/81227](https://go.dev/issue/81227) This data is provided by [OSV](https://osv.dev/vulnerability/GO-2026-5932) and the [Go Vulnerability Database](https://redirect.github.com/golang/vulndb) ([CC-BY 4.0](https://redirect.github.com/golang/vulndb#license)). </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/cozystack/cozystack). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4yMjguMCIsInVwZGF0ZWRJblZlciI6IjQ0LjI0OS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWF0ZWQiLCJzZWN1cml0eSJdfQ==--> |
||
|
|
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 --> |
||
|
|
40b4fc6ad4 |
fix(ingress-nginx): pick up the nginx rebuild with the remaining CVE fixes (#5436)
## What this PR does Moves the ingress-nginx controller from `v1.11.6-cozystack.1` to `v1.11.6-cozystack.3`. It is the same v1.11.6 controller and nginx 1.25.5, rebuilt with the rest of the nginx fixes the controller can reach. cozystack.1 had only the two HTTP/2 fixes. | Fork PR | nginx commits | Fixes | | --- | --- | --- | | cozystack/ingress-nginx-with-protobuf-exporter#14 | 6, from 1.30.7 | CVE-2026-118899 (SSL request body loop, also HTTP/3), CVE-2026-123634 (resolver), CVE-2026-121810 (HTTP/3), CVE-2026-125283 (`try_files` with `alias`) | | cozystack/ingress-nginx-with-protobuf-exporter#15 | 10, from 1.26.3 to 1.30.8 | CVE-2025-23419 (TLSv1.3 resumption across SNI names), CVE-2026-1642 (HTTPS backends), CVE-2026-42945 and CVE-2026-9256 (`rewrite`), CVE-2026-42055 (gRPC backends), CVE-2026-97629 (session tickets), CVE-2026-132779 (`ssl-early-data`) | Advisories that need a module the controller does not build (mail, dav, mp4, slice) or a directive the template does not emit are left out, as is the CVE-2026-42533 series: it rewrites the script engine the Lua modules build on, and the template's maps carry no regex that reaches it. The fork's `images/controller/PROVENANCE.md` lists every patch. CVE-2026-97629 is the one reachable on platform defaults; #5407 already turned session tickets off as a mitigation. This image fixes it in nginx, and the `ssl-session-tickets: "false"` setting stays as it is. Checked on the published image (`sha256:059a75d5…`, amd64 and arm64), without running it: - the nginx binary reports 1.25.5 with the same configure arguments as in cozystack.1 and .2, and differs from the one in cozystack.2; - it carries strings the new patches add, such as the gRPC header length errors and `SSL_SESSION_get0_hostname`; - it keeps `cap_net_bind_service` in its file capabilities. The fork's build compares the configure arguments with the shipped binary and fails on a mismatch. `nginx -t` and a live request were not run for this image, and neither was a live cluster. `nginx -v` still says 1.25.5, so scanners that match on the version will keep flagging it. ### Screenshots N/A, no UI changes. ### Downstream repositories Walked the trigger map against the diff: an image tag and digest in `packages/system/ingress-nginx/values.yaml`. No package, values key, schema or app README changes. - [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(ingress-nginx): the ingress-nginx controller's nginx 1.25.5 now carries the fixes for CVE-2025-23419, CVE-2026-1642, CVE-2026-9256, CVE-2026-42055, CVE-2026-42945, CVE-2026-97629, CVE-2026-118899, CVE-2026-121810, CVE-2026-123634, CVE-2026-125283 and CVE-2026-132779. nginx still reports version 1.25.5. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Updates** * Updated the ingress controller to a newer build. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
74e103d6f2 |
ci(workflows): run push and schedule workflows only in cozystack/cozystack (#5186)
## What this PR does GitHub runs no CI in a security advisory's temporary private fork, and merging from the advisory skips branch protection, so an embargoed fix currently reaches `main` with nothing having run on it. This PR prepares the repository for verifying such a fix in a separate private copy of the repository (an embargo mirror), and documents that process. - Every job of a workflow that a push or a schedule starts now runs only in `cozystack/cozystack`. A mirror receives all workflow files on each sync, and without the guard it would build, publish, prune and cut releases from that copy on every sync and cron tick. Workflows that also run on `pull_request` keep running on pull requests, which is what the mirror is for. Every job carries the guard rather than only the root jobs, because a job whose condition calls a status function such as `!cancelled()` runs even when the job it needs was skipped. - `hack/workflow-repo-guard.bats` holds every current and future push or schedule workflow to that guard, accepting it only as the leading conjunct so nothing ORed after it can reopen the job. - `docs/security/incident-response.md` describes the verification flow: sync the mirror on demand, open the fix PR inside it, record the green run in the advisory, then merge from the advisory. It also records why the mirror must not hold the public registry credentials: pull request CI pushes every image and the packages artifact (the full chart tree) to a registry that is anonymously readable, tag listing included, so a run there would publish the fix before the release. Behaviour in `cozystack/cozystack` is unchanged: the guard is true there, and each existing condition is kept intact inside the new conjunction. Contributor forks with Actions enabled stop running these workflows too. Out of scope, as a follow-up: letting pull request CI push to a private registry and pull from it in the E2E cluster, so the mirror can run the E2E suite and not only planning, pre-commit and the unit tests. Verification: - `hack/workflow-repo-guard.bats` was red before the workflow changes (30 unguarded jobs) and is green after; removing the guard from `tags.yaml` `rc-e2e`, dropping the pull request clause from `zizmor.yml`, or adding an unguarded scheduled workflow each turns it red. - Every changed workflow is identical to `main` once job `if` fields are removed (`yq 'del(.jobs[].if)'`). - `zizmor --offline` reports no findings; `actionlint` reports the same findings on the changed files as on `main`. - `hack/stitch-multiarch_test.bats` pinned the exact `if` of two `tags.yaml` jobs and is updated to the guarded form. ### Screenshots Not a UI change. ### 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 trigger map entry that touches this diff is `cozystack/ccp` for `tags.yaml`: its `package-bump` skill describes the release pipeline of `cozystack/cozystack`, which this PR does not change. ### Release note ```release-note ci(workflows): push- and schedule-triggered workflows run only in cozystack/cozystack, so a private mirror used to verify embargoed security fixes does not build, publish or release from its copy. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **CI** * Scheduled, release, and maintenance workflows now run only in the canonical repository. Pull-request checks continue to run where configured. * Build, validation, and security workflows now follow repository-specific run conditions. * **Documentation** * Updated incident-response guidance with steps for verifying fixes in a private advisory mirror, including CI limitations, check requirements, and credential restrictions. * **Tests** * Added workflow checks to verify repository guards and event-specific conditions. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
180c01170f |
fix(ingress): restore visitor IPs through SSL passthrough (#5443)
## What this PR does Closes #5327. With `cloudflareProxy: true`, HTTPS reaches nginx through ssl-passthrough on loopback, so an IP whitelist sees `127.0.0.1` instead of the visitor and rejects legitimate Cloudflare traffic. This change validates the original transport peer before the whitelist, restoring the visitor IP for Cloudflare requests without reopening the spoofing fixed by #4444. Direct HTTPS requests that bypass Cloudflare still appear as `127.0.0.1`, as before. ### Validation - `helm unittest packages/extra/ingress`: 34/34 tests passed, including a separate run with helm-unittest 1.1.2. - `make --directory=packages/extra/ingress show NAMESPACE=tenant-root`: passed against the test cluster after rebasing on `upstream/main`. - On an isolated ingress-nginx v1.11.6 controller, `nginx -t` passed. Spoofed headers over HTTP and HTTPS returned 403. A trusted Cloudflare PROXY-protocol source with an allowed visitor passed the whitelist and the access log contained the visitor IP; an untrusted source or a visitor outside the whitelist returned 403. - A real Cloudflare end-to-end request was not tested. ### Screenshots Not applicable; this PR does not change the UI. ### 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(ingress): restore visitor IP handling for Cloudflare-proxied HTTPS through ssl-passthrough while rejecting spoofed `CF-Connecting-IP` headers before IP whitelists ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Bug Fixes** * Cloudflare-proxied ingress accepts `CF-Connecting-IP` only from trusted Cloudflare address ranges and returns HTTP 403 when an untrusted source provides the header. * When no PROXY protocol address is available, source checks use the direct connection address. * Loopback addresses are included in trusted real-IP ranges, and the existing keepalive setting is preserved. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
ed4a378428 |
style(ingress): drop blank lines from the Cloudflare geo block
The range over the Cloudflare ranges kept the newlines around its actions, so the rendered geo block had an empty line between every entry. nginx accepts either form; the trimmed one is easier to read when debugging the generated config. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <f@lex.la> |
||
|
|
00a540eb62 |
fix(ingress): restore visitor IPs through SSL passthrough
With cloudflareProxy enabled, HTTPS reaches nginx from the ssl-passthrough proxy on loopback. Without trusting that proxy, the whitelist sees 127.0.0.1 instead of the visitor address; trusting it without checking the PROXY-protocol peer would reopen the spoofing closed by #4444. Checking the transport peer before the whitelist preserves that protection, while port 80 needs its direct peer because no PROXY-protocol address exists there. Tested with helm-unittest and an isolated ingress-nginx controller: trusted PROXY peers pass the whitelist with the restored visitor address, while spoofed headers on HTTP and HTTPS return 403. Closes: #5327 Assisted-by: LLM Signed-off-by: toribru <161638395+toribru@users.noreply.github.com> |
||
|
|
8cab9b7d7b |
refactor(tenant): make gateway a plain bool (#5408)
<!-- 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 #4542. Makes `tenant.spec.gateway` a plain boolean defaulting to `false` and removes the unset-specific helper branch. Both `false` and an omitted key retain the existing behavior: the tenant owns no Gateway and inherits the nearest ancestor Gateway. Setting `true` still gives the tenant its own Gateway. The API now serializes `gateway: false`, and the dashboard shows the `gateway` checkbox next to `ingress`, unchecked by default. The chart test now verifies the rendered namespace label for both `false` and `true`. ### 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. --> N/A ### 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. --> I walked the trigger map against the diff. The tenant `gateway` default and API serialization change reaches the hand-written Terraform provider's documentation and key-presence/null assumptions. Follow-up is tracked in cozystack/terraform-provider-cozystack#88; no provider change is included in this PR. The website already lists tenant in its managed app set, and its stable-tag automation regenerates the tenant reference from README, so no manual website follow-up is required. No other downstream trigger applies. - [ ] 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#88 - [ ] [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(tenant): make `gateway` a plain boolean defaulting to `false`; the dashboard now shows the `gateway` checkbox next to `ingress`, unchecked by default. Existing routing behavior is unchanged: `false` or an omitted value inherits the nearest ancestor Gateway, while `true` gives the tenant its own Gateway. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Documentation** * Clarified that `gateway: false` is the default and uses the nearest ancestor’s Gateway, falling back to Ingress when no ancestor owns one. * Updated tenant configuration references to display the Gateway setting and its class in the dashboard. * **Bug Fixes** * Confirmed that `gateway: false` inherits the parent Gateway without creating a tenant-owned Gateway, while `gateway: true` identifies the tenant namespace as owning its dedicated Gateway. * Tenant configuration now includes the Gateway value explicitly when it is false. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
22843c5c5c |
fix(kubernetes-nodes): surge one worker at a time during a pool rollout (#5399)
<!-- 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 A worker pool rollout (instance type, image or version change) currently surges up to `maxReplicas` new VMs before draining an old one, so a pool running 8 workers under a ceiling of 10 can reach 18 VMs at its peak. Those VMs land in the tenant's namespace: today they count against its `ResourceQuota`, and under [tenant quotas as reservation limits](https://github.com/cozystack/community/pull/48), where a pool reserves `maxReplicas` workers, they are capacity nobody reserved. This PR fixes the surge at one Machine per pool. The surge is treated as platform margin rather than tenant budget: rollouts are mostly platform-driven, and charging them to the tenant would block a platform upgrade for any tenant whose pool sits at its ceiling. Bounding that margin is what this PR does. `maxUnavailable` is untouched, so a node is still only drained once its replacement is up (#5153). The value is the open question for maintainers. **1** keeps the loan to a single worker per pool and is what this PR ships; a large pool then rolls one worker at a time. **2** halves the rollout time of a large pool at twice the margin. I would rather not make it a chart value, since tenants write the values and would then size the platform's margin themselves. Tested with `helm unittest` on `kubernetes-nodes`; the three golden renders change only in `maxSurge`. Refs: cozystack/community#48, cozystack/cozystack#5397 ### Screenshots 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. --> I walked the trigger map against the diff: one template line, its comment and its tests. No values key, schema, default, version enum or release name changes. - [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(kubernetes-nodes): a worker pool rollout now adds one replacement worker at a time instead of up to the pool's maxReplicas, bounding the extra capacity a rollout uses in the tenant's namespace. Large pools roll out more slowly. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Behavior Changes** * Rolling updates now allow a fixed surge of one worker at a time, regardless of the pool’s maximum replica count. Pools with higher replica limits no longer increase the surge allowance. This change applies even when the pool’s minimum and maximum replica counts are both set to five. The existing default and explicitly configured `maxUnavailable` behavior remain unchanged. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
054b4ef4bc |
fix(linstor): gate group snapshots on the v1 group snapshot API (#5430)
## What this PR does The linstor group snapshot gate and the linstor `VolumeGroupSnapshotClass` were tied to `groupsnapshot.storage.k8s.io/v1beta2`, on the grounds that piraeus-operator probes v1beta2. On main it does not: piraeus-operator v2.12.1 probes v1, csi-snapshotter v8.7.0 reads the content and class kinds at v1, and snapshot-controller v8.7.0 watches all three kinds at v1. The vendored chart serves v1, v1beta1 and v1beta2 today, so nothing is broken yet, but once upstream stops serving v1beta2 the gate would turn group snapshots off while every component that acts on them could still use them. The first commit gates on v1 and moves the class to v1. It also replaces the comment that said csi-snapshotter stalls when the gate is on and the API is missing: v8.7.0 logs a warning and runs without group snapshots. Velero 1.18 reads group snapshots at v1beta2, so the vm-instance hook, which gates on v1beta2 for Velero, stays as it is. The second commit rewrites the snapshot-controller CRD test. It pinned the vendored chart's layout (six CRD documents, v1beta2 as the storage version, no v1alpha1) and would go red on a correct `make update` that moves storage to v1. It now asserts what the platform needs: every group snapshot CRD serves v1 and v1beta2, the three volume snapshot CRDs are rendered, and every rendered CRD is kept on uninstall. On upgrade, an install running the CRDs from this chart sees no change in the gate and no csi-controller rollout. The class is updated in place, since Helm matches release objects by group and kind. The only install that flips is one whose distribution ships group snapshot CRDs with v1beta2 but not v1: the gate goes from on to off and the class is removed, and csi-snapshotter there was already disabling the feature at startup. I left the `-eq 3` check in the platform `image-migrations` target alone. It stops an image from shipping where migration 62 deletes the old CRDs and has nothing to recreate them from; asserting the three file names instead would copy the list migration 62 already holds, and the count fails loudly if upstream adds a CRD. Tested with `helm unittest` on `packages/system/linstor` and `packages/system/snapshot-controller`. I also checked that the new CRD test fails when v1 or v1beta2 stops being served, when `keepCRDs` is false, and when no CRD renders. Nothing was run against a cluster. ### Screenshots Not a UI change. ### 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(linstor): enable volume group snapshots based on the groupsnapshot.storage.k8s.io/v1 API that csi-snapshotter and snapshot-controller use, so they keep working once upstream stops serving v1beta2. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * LINSTOR group snapshot support now uses the stable `groupsnapshot.storage.k8s.io/v1` API when all required resources are available. * Group snapshot resources are served through both v1 and v1beta2, supporting components that use either API version. <!-- 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 --> |
||
|
|
7067313c95 |
fix(kubernetes): stop refusing extraOutputs hooks monitoring-agents accepts (#5427)
## What this PR does
The tenant Kubernetes application checked fluent-bit `extraOutputs` with
a regular expression over the text of an `outputs` override, written
against the exact layout of the default hook. The monitoring-agents
chart decides the same question by rendering `outputs`, so a hook
written with `{{- if .Values.config.extraOutputs }}` / `{{
.Values.config.extraOutputs }}` / `{{- end }}`, or a bare `{{
.Values.config.extraOutputs }}`, was refused by the application although
monitoring-agents renders it into `fluent-bit.conf`. I confirmed this
with `helm template` on both charts.
I kept a check in the application, because the addon fails in a
HelmRelease the tenant cannot read and the Application status reflects
only its own release. It now only requires `outputs` to mention
`.Values.config.extraOutputs`. The check stays textual because executing
a tenant template in this chart would run it in the management cluster,
and the exact check is already made by the monitoring-agents render
guard.
A new test covers the `if` form. The application tests for a
commented-out or newline-trimming hook are removed, since only the
monitoring-agents guard catches those now, and it already has tests for
both.
Follow-up to #5376.
### Screenshots
Not a UI change.
### 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(kubernetes): an `addons.monitoringAgents.valuesOverride` that overrides fluent-bit `outputs` and emits `extraOutputs` with an `if` block or a bare `{{ .Values.config.extraOutputs }}` is no longer refused by the application.
```
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Bug Fixes**
* Monitoring-agent output configuration now accepts a wider range of
template formats when including extra destinations, including
conditional hooks. Validation still requires the configuration to
reference the extra destinations setting.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
|
||
|
|
0d75b0e352 |
fix(seaweedfs): stop reserving storage pool name suffixes (#5426)
## What this PR does The SeaweedFS chart refused any storage pool named `public` or ending in `-lock`, `-readonly` or `-public`. A second check in the same template compares the class names each pool actually renders, against each other and against the instance's base classes, and it already refuses every one of those names that clashes with something. `public`, `lock` and `readonly` clash with the base classes. `x-public`, `x-lock` and `x-readonly` clash only when a pool `x` exists. The suffix list therefore refused only names that clash with nothing, such as `cdn-public` with no pool `cdn`, and it would have needed another breaking change for every new class variant. I removed the suffix list and kept the rendered-name check as the only rule. Every values set that rendered before renders the same objects now. Names that were refused without a real clash are now accepted. Nothing that was accepted is refused, so this is not a breaking change. The tests now cover both sides of the rule. `cdn-public`, `cdn-lock` and `cdn-readonly` without a `cdn` pool are accepted, in `volume.pools` and in a zone. A pool next to its own `-public`, `-readonly` or `-lock` variant is refused with the clash message, and so is a pool named `public`. Related: #5316 is already handled on main by the rendered-name check (pools named exactly `lock` or `readonly` are refused there). #5412 takes the opposite approach and extends the reserved-name list in the same files. ### Screenshots Not a UI change. ### Downstream repositories - [ ] No downstream repository is affected by this change - [ ] [cozystack/website](https://github.com/cozystack/website) - follow-up: the storage pools page says pool names ending in `-lock` or `-readonly` are reserved; it should say a pool name must not render a class name another pool or the base classes already use. - [ ] [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(seaweedfs): storage pool names are no longer refused for a reserved suffix; a pool is refused only when one of its BucketClass or BucketAccessClass names is already rendered by another pool or by the instance's base classes. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Bug Fixes** * Pool names ending in `-public`, `-lock`, or `-readonly` are now accepted when their rendered class names don’t conflict with another pool or a base class. * Name collisions are still rejected with errors that identify the conflicting rendered class. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
ea9ef1f7ed |
refactor(computeplane): stop copying pool defaults into the default md0 (#5425)
## What this PR does
When a ComputePlane has no `nodeGroups`, the module renders a default
`md0` pool. That pool also wrote `maxReplicas: 10`, `instanceType:
u1.medium` and `diskSize: 20Gi`, which are copies of the KubernetesNodes
schema defaults. That put the pool's size in two places, and the next
change to the KubernetesNodes defaults would leave the ComputePlane copy
behind.
The comment that justified the copy said a reservation read from the
release would otherwise need to know another chart's defaults. That is
not how the evaluator works: `pkg/reservation` defaults stored values
against the kind's own structural schema before evaluating, and
`TestEvaluateDefaultsStoredValues` already checks that a sparse `{roles,
minReplicas}` pool reserves exactly what the explicit one does.
This PR returns `md0` to what it was before the copy was added, `{roles:
[ingress-nginx], minReplicas: 0}`, and drops the comment. The unit test
now pins the whole `spec.values` of the default pool rather than each
copied key.
Upgrade: the md0 HelmRelease loses three keys from `spec.values`, so
Flux runs one Helm upgrade of the pool release. I rendered the
kubernetes-nodes chart with the old and the new md0 values (instance
type lookups mocked) and the output is byte-identical, including the
content-hashed KubevirtMachineTemplate name. The pool keeps its size and
does not roll. The copy has not shipped in any release tag.
### Screenshots
Not a UI change.
### 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 touches one template and its unit test. No values key, schema
or package is added, renamed or removed.
### Release note
```release-note
refactor(computeplane): the default md0 pool no longer duplicates the KubernetesNodes size defaults; rendered pools are unchanged.
```
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Configuration**
* The automatically created `md0` pool now specifies only its ingress
role and a minimum of zero replicas. Maximum replicas, instance type,
and disk size are no longer explicitly set there and use the pool
chart’s defaults instead.
<!-- 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 --> |
||
|
|
194d681c20 |
feat(vpc): cozyplane variant of the VPC application (#4508)
## What this PR does Stacked on #3149. The cozyplane networking variant skips the kube-ovn/multus-backed `virtualprivatecloud` application, which left the VirtualPrivateCloud catalog kind absent on cozyplane clusters. This PR adds an **alternative flavor of the same catalog kind**, backed by cozyplane's `sdn.cozystack.io` API, and wires it in as a second variant of the existing delivery: - **`packages/apps/vpc-cozyplane`** — a chart that creates a namespaced `VPC` (address ranges may overlap between VPCs; isolation is by overlay), the owner-namespace `VPCBinding` (attachment is default-deny even for the owner), one `VPCPeering` half per declared peer (bidirectional declaration, same UX as the kubevirt flavor's `peers`), and an optional `VPCGateway` (`gateway.enabled` / `nat` / `ingressLoadBalancer` / `loadBalancerClass`). - **`virtualprivatecloud-rd`** now selects which ApplicationDefinition it installs by a `variant` value: both flavors register the same kind with the same release prefix, but each definition must point at its own variant's ExternalArtifact. The cozyplane definition is generated by the same `hack/update-crd.sh` flow; the script now honors `VARIANT`/`OUT` from the environment instead of always reading `variants[0]` of the PackageSource. - **`cozystack.virtualprivatecloud-application`** gains a `cozyplane` variant whose ordering edge is `cozystack.cozyplane-apiserver` (the group is aggregated-only) instead of `cozystack.multus`, and the iaas bundle selects the flavor by `bundles.system.networkingVariant`, replacing the previous skip. Covered by helm-unittest suites in all three places: chart rendering (binding always present, gateway/peering shapes, `loadBalancerClass` absent when empty), rd variant selection (exactly one definition, correct chartRef, unknown variant fails the render), and platform wiring (bundle flavor selection, dependency edges with no multus edge on cozyplane). Not in scope, deliberately: cross-namespace VPCBindings (sharing a VPC with another tenant's namespace), reserved NAT identities (`addressClaimName` waits on the address substrate), and e2e — real-cluster validation of the whole cozyplane stack is tracked on #3149. **VM attachment (added 2026-10-08).** `vm-instance` now joins a VM to a cozyplane VPC: when the cluster serves `sdn.cozystack.io` (API discovery, the same gate as the Kube-OVN IP pinning), the chart stamps `sdn.cozystack.io/vpc: virtualprivatecloud-<networks[0].name>` on the virt-launcher pod and renders no multus networks and no secondary interfaces — the VM keeps its single pod interface. The values contract is unchanged for consumers: `networks: [{name: <VPC catalog name>}]`, the name without the `virtualprivatecloud-` prefix, same convention as `peers[].vpcName`; at most one entry (more fails the render by name, since a cozyplane pod joins exactly one VPC). The Cilium-variant multus path is untouched and both branches are unit-tested. **Route table (added 2026-11-20).** `vm-instance` takes `routeTable`, the name of a cozyplane RouteTable in the VM's namespace (a DNS-1123 name, empty by default). When it is set and the VM joins a VPC through `networks`, the chart renders `sdn.cozystack.io/route-table: <routeTable>` on the virt-launcher pod next to `sdn.cozystack.io/vpc`; empty renders nothing and leaves the VPC's default table in effect. Setting it without a VPC network, or on a cluster that does not serve `sdn.cozystack.io`, fails the render by name. Still to verify on a live stand, not by rendering: which KubeVirt interface binding the default interface needs on cozyplane (the template uses `bridge: {}`; masquerade may be required), whether the guest acquires the VPC address over DHCP, and whether `kubevirt.io/allow-pod-bridge-network-live-migration` still applies — the CNI stamps `sdn.cozystack.io/vpc-ip`/`-mac` on the launcher pod to check against. ### Compatibility Existing installations are unchanged. `bundles.system.networkingVariant` defaults to `kubeovn-cilium`, which keeps the `kubevirt` flavor of `cozystack.virtualprivatecloud-application` and its ApplicationDefinition exactly as before; the `cozyplane` flavor is selected only together with `networkingVariant: cozyplane`. On a running cluster that switch changes the `cozystack.networking` variant, which the platform render refuses unless `networking.acknowledgeVariantChange` names the new variant (#3149). No migration moves kube-ovn-backed VPCs onto the cozyplane flavor. ### Screenshots Not a UI change. ### Downstream repositories The trigger map fires for cozystack/website (a new package under `packages/apps/` needs an entry in the website Makefile's app lists, and the variant recomposition touches the variants page) and arguably for terraform-provider-cozystack (the VirtualPrivateCloud spec differs per flavor, so the hand-maintained schema will not match cozyplane clusters). Both follow-ups are deferred while this stack is draft — filing them against an unmerged experimental variant would be noise; they should be opened when #3149 leaves draft. Boxes left unticked so a human decides. - [ ] 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 feat(vpc): the cozyplane networking variant now serves the VirtualPrivateCloud application, backed by sdn.cozystack.io — namespaced VPCs with peering and an optional north-south gateway ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * Added a Cozyplane-backed VirtualPrivateCloud option with configurable network ranges, peer connections, and optional gateway, NAT, and ingress settings. * The platform now selects the VPC option based on the configured networking variant. * VMs using Cozyplane networking can join one VirtualPrivateCloud while retaining a single pod interface; multiple network entries are rejected. * **Documentation** * Updated VPC and VM networking guidance, including configuration options and Cozyplane-specific behavior. * **Tests** * Added coverage for VPC configuration, networking variant selection, and VM attachment behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
6115d2d6ad |
docs(security): describe verifying an embargoed fix in a private mirror
GitHub runs no CI in an advisory's temporary private fork, and merging from the advisory skips branch protection, so a security fix reached main with nothing having run on it. The incident-response process now records where the fix is verified instead, how the mirror is kept in step with the public branches, and why the mirror must never hold the public registry credentials: pull request CI pushes the full chart tree to an anonymously readable registry, which would publish the fix before the release. Without those credentials a mirror run of any code change is red at the registry login, so the process names the jobs that must pass instead of asking for a green run. It records the main commit the run was based on and asks for a rerun when main has moved before the merge, because a change elsewhere on main can break the fix without a merge conflict. It also records what a sync still starts: a release line carries the workflows it was cut with, so pushing one runs its build there, and a tag cut before the guard runs tags.yaml unguarded, which is why tags are never synced. Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io> Assisted-by: LLM |
||
|
|
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 --> |
||
|
|
9bb661408a |
refactor(tenant): make gateway a plain bool
Assisted-by: LLM Signed-off-by: toribru <161638395+toribru@users.noreply.github.com> |
||
|
|
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> |
||
|
|
d6a4835ea5 |
ci(workflows): run push and schedule workflows only in cozystack/cozystack
A private copy of the repository, used to verify an embargoed security fix because GitHub runs no CI in an advisory's temporary fork, receives every workflow file with each sync. Without a repository guard, each sync and each cron tick there would build, publish, prune and cut releases with that copy's credentials. Pull request events stay allowed in the workflows that also check pull requests, since checking the fix is what the copy is for. Every job carries the guard rather than only the root jobs, because a job whose condition calls a status function runs even when the job it needs was skipped. A contract test holds new push and schedule workflows to the same rule. It reads 'on' in every form GitHub accepts, requires whatever follows the guard to be one parenthesized group, because && binds tighter than || and a trailing '|| (...)' would reopen the job, and fails on a workflow it cannot parse instead of leaving that workflow unchecked. Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io> Assisted-by: LLM |
||
|
|
f8403279be | chore(deps): update module golang.org/x/crypto to v0.59.0 [security] | ||
|
|
37486083b9 |
feat(vm-instance): choose a cozyplane route table
cozyplane routes a pod by the RouteTable its sdn.cozystack.io/route-table annotation names, and the VPC's default table when it names none. A VM had no way to pass one, so a route such as 0/0 to the internet could only be reached by annotating the VM by hand. routeTable renders the annotation next to the VPC one, and fails the render where no VPC or no cozyplane would read it. Assisted-by: LLM Signed-off-by: Timofei Larkin <lllamnyp@gmail.com> |
||
|
|
a24bdb758b |
feat(vm-instance): join a cozyplane VPC by pod annotation
On the cozyplane networking variant there is no multus, so a VM that listed a network rendered a multus attachment that can never resolve and sat Pending forever. When the cluster serves sdn.cozystack.io — detected by API discovery, the same way the Kube-OVN IP pinning is — the chart now stamps sdn.cozystack.io/vpc: virtualprivatecloud-<networks[0].name> on the virt-launcher pod (the bare name resolves in the VM's own namespace) and renders no multus networks and no secondary interfaces: the VM keeps its single pod interface and the CNI gives it its VPC identity. A cozyplane pod joins exactly one VPC, so more than one network entry fails the render by name rather than attaching silently to the first. The Cilium-variant multus path is unchanged, and the suite pins both branches. Assisted-by: LLM Signed-off-by: Timofei Larkin <lllamnyp@gmail.com> |
||
|
|
e4ac5dbb9c |
feat(vpc): cozyplane variant of the VPC application
The kubevirt flavor of virtualprivatecloud is kube-ovn/multus-backed, so the cozyplane networking variant skipped it and the VirtualPrivateCloud catalog kind was simply absent there. This adds an alternative flavor serving the same kind from sdn.cozystack.io: the chart creates a namespaced VPC, the owner-namespace VPCBinding (attachment is default-deny even for the owner), one VPCPeering half per declared peer, and an optional VPCGateway as the north-south boundary. Delivery follows the networking variant: the PackageSource gains a cozyplane variant whose ordering edge is the aggregated sdn apiserver instead of multus, the iaas bundle selects the flavor by networkingVariant, and virtualprivatecloud-rd installs the matching ApplicationDefinition. Each flavor's definition must point at its own variant's ExternalArtifact, which is why hack/update-crd.sh now honors VARIANT from the environment instead of always reading variants[0]. Assisted-by: LLM Signed-off-by: Timofei Larkin <lllamnyp@gmail.com> |
||
|
|
f91ffd8fa7 |
test(reservation): check shipped consumption declarations on the rendered charts (#5411)
## What this PR does The shipped-declaration test in `pkg/reservation` enforced a file layout that no requirement asks for, and a correct open PR went red because of it. The test came with #5349. It read `packages/system/*-rd/cozyrds/*.yaml` as raw files and failed when two files carried the same `metadata.name`. An `-rd` chart may keep one definition per variant under one name and render only one of them. #4508 does this for the VPC cozyplane variant and has been red since #5349 merged. The same test also parsed cozy-lib's preset template with a regexp, pinned about seventy figures the shipped declarations compute, and required the IaaS kinds to declare consumption while nothing reads the declarations yet. The first commit moves the evaluator and classifier tests to fixtures. They used to read schemas from the `cozyrds/` files and instance types from the kubevirt-instancetypes templates. The expected figures stay the same, and the exact product past int64 gets its own case. The second commit checks the shipped declarations where the charts live. `hack/check-rd-consumption.sh` renders each `-rd` chart with `values.yaml`, and once more for each `values-<variant>.yaml` next to it, together with the kubevirt-instancetypes chart. `cmd/check-consumption` reads that stream and knows nothing about charts. It fails when a declaration does not compile or does not evaluate on its kind's defaults, and when a rendered instance type does not classify. Presets come from a cozy-lib template helper and nothing renders them, so an evaluation that reaches `preset()` stops there and is reported as compiled. Only that lookup is tolerated, an unknown instance type still fails. The check is a new `rd-consumption-check` target under `make unit-tests`, which the Unit & controller tests job runs. The third commit deletes `pkg/reservation/shipped_test.go`. Open PRs that add tests to that file (#5401, #5397) will need to move them. I checked it against #4508 merged onto this branch, with no changes to #4508: the Go tests and the new check pass, and the VPC cozyplane variant is rendered on its own; it declares no consumption, so the check has nothing to evaluate there. A broken shipped declaration fails the check. Comparing a declaration with the requests and limits its chart actually renders is left for #5416. ### Screenshots Not a UI change. ### 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(reservation): shipped consumption declarations are checked on the rendered -rd charts instead of their source files, so an -rd chart can ship one definition per variant under the same name. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit - **Tests** - Automated checks now validate resource consumption declarations across system application charts and their value variants, reporting chart rendering or validation failures. - Unit tests now cover additional resource classification and calculation cases, including products that exceed the supported integer range. - **Chores** - The new validation check is included in the standard unit test workflows. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
30ce2a3cb1 |
fix(postgres): move tenant PostgreSQL to patched standard-trixie images (#5405)
## What this PR does Moves the tenant `postgres` application to PostgreSQL minors that fix CVE-2026-116331, and makes the upgrade repair the indexes that the move can break. ### Why the images change CVE-2026-116331 is a type confusion in the min/max aggregate optimisation: a role that can create objects runs code as the operating system user of the server. Tenants hold such roles, so this application is the exposed one. The fixed minors are 18.7, 17.12, 16.16, 15.20 and 14.25. The default flavor pins bare image tags (`postgresql:17.7`). A bare tag is the `system` variant on Debian bullseye, and upstream stopped building it: the fixed minors are published for bookworm and trixie only. This PR takes `standard-trixie`: the standard variant, because backups go through the barman-cloud plugin and need none of the barman binaries the `system` variant adds, and trixie, because the postgis flavor is on it already, so both image families share one Debian release. `hack/update-versions.sh` selects bare tags, so it would have settled on 17.11 and 18.6, which are still affected. This PR: - pins `<minor>-standard-trixie` for the default flavor and bumps every major to its fixed minor; - bumps the postgis flavor to the same minors (it was already on `standard-trixie`), which moves PostGIS from 3.6.1 to 3.7.0; - teaches `hack/update-versions.sh` to pick minors from `standard-trixie` tags. PostgreSQL 13 has no fixed release. It keeps the minor 13.22 and stays exposed to the CVE, and it moves to the trixie variant with every other major, so it takes the base image change and the index rebuild without getting the fix. 14.25 is the last release of the 14 line. ### Why the upgrade needs a repair step For a running default-flavor cluster the image moves from bullseye to trixie, so glibc goes from 2.31 to 2.41 and ICU's collator version from 153.14 to 153.128 under an existing data directory. An index ordered by a collation of either library is then ordered by rules the server no longer applies. PostgreSQL only logs a warning. Reproduced on a live cluster with 60 000 rows of mixed Unicode text: | Index collation | After the image change | |---|---| | `C` (what the chart creates by default) | intact | | libc `en_US.utf8` | intact on this data, version mismatch warning | | ICU `en-x-icu` | `amcheck`: item order invariant violated; 2 604 rows not found through the index | A database the chart created with its defaults uses `C` and is not affected. A tenant who declared `COLLATE` on a column, used an ICU collation, or created a database with a locale is. ### What the init Job does now The post-install/post-upgrade Job gets one more pass. It runs after the passes that manage roles and databases, so a rebuild that fails or runs out of time costs none of them. In every connectable database it: 1. finds the indexes that depend on a collation whose recorded library version differs from the one the server reports. PostgreSQL records a collation for an index only where it orders a key, so the collations of the columns an index reads in its expressions and its predicate count as well; 2. rebuilds them with `REINDEX INDEX CONCURRENTLY` (plain `REINDEX` for an exclusion constraint's index, which cannot be rebuilt concurrently, so its table is neither read nor written meanwhile); 3. refreshes the recorded versions with `ALTER COLLATION ... REFRESH VERSION` and `ALTER DATABASE ... REFRESH COLLATION VERSION`, once every rebuild in that database succeeded. **Timing.** Helm runs the hook as soon as the `Cluster` is patched, while CloudNativePG is still rolling the instances, so the primary can answer from the old image for minutes. The Job runs the new image, so it waits until the server reports the same PostgreSQL version and Debian release as its own `psql`. The rebuild counter of the package is left out, because a tag is rebuilt in place and the Job can pull a newer rebuild than the instances run. It waits only when an index depends on a versioned collation; a cluster with nothing to rebuild is not delayed. **Retries.** `REINDEX CONCURRENTLY` gives an index a new OID, so the highest OID seen when a repair begins separates the indexes still to rebuild from the ones already done. That mark is kept as a setting of the database (`cozystack.collation_repair`) with a fingerprint of the stale collations and the list of indexes rebuilt in place, and removed when the repair is complete. A retry therefore continues instead of starting over. **Failures.** A rebuild that fails does not stop the others. The pass reports the failures and exits non-zero at the end. A failed or interrupted `REINDEX CONCURRENTLY` leaves an invalid `_ccnew` index on the table; two of those mean two runs failed there, and the pass then leaves that table's stale indexes to an operator instead of scanning the table again on every retry. A rebuild that succeeds drops the leftovers; dropping them by hand lets the next run try again. An in-place rebuild leaves no such trace, so the setting records each attempt with the index's storage file: a changed file means the index was rebuilt, by a run or by hand, and two attempts on the same file leave it to an operator. A rebuild that waits for a lock behind an open transaction gives up when the Job runs out of time, and an in-place rebuild is cut off at the same point, so no backend is left waiting or holding the table after the Job is gone. A concurrent rebuild that is already running is not cut short. **Privileges.** The Job connects as the superuser, so every session of the pass sets `search_path` to `pg_catalog, pg_temp`. A function or operator that a tenant defined in `public` cannot be picked in place of a built-in. **Before PostgreSQL 15** the server records no version for a database's default collation. The version recorded for the libc collation of the same locale stands in for it; the two are matched as glibc matches them, so `en_US.UTF-8` finds `en_US.utf8`. A locale with no such collation cannot be checked, and a run that saw the image change says so in a warning that names the database. **Range partition keys.** Rebuilding an index does not move a row to the partition the new ordering assigns it. A collation that such a key depends on keeps its recorded version, so PostgreSQL keeps logging the mismatch, and the Job prints a warning that names the table on every run. Its indexes are still rebuilt, once. The pass is driven by the version mismatch, not by this particular image change, so it also applies to later glibc or ICU bumps. ### Verified `helm unittest` passes for the chart (236 tests). The e2e suite gains a step that creates a collation with a stale version, upgrades the release and checks that the index was rebuilt and the version refreshed. On a live cluster, applications were installed from the v1.7.0 chart and upgraded with this change applied on top of v1.7.0. Each had a client holding a connection, which is what makes the primary restart take minutes. | Case | Outcome | |---|---| | v17, two instances, default `C` collation only | Job finished in 15 s without waiting; data identical; `amcheck` clean | | v17, two instances, ICU, libc, expression, unique, exclusion and partition indexes | Job waited about 3.5 min for the primary, rebuilt seven indexes; `amcheck` clean; every row found through the ICU index again (run with the first revision of the pass) | | v17, two instances, backups to the system bucket | a backup taken before and one taken after the upgrade both succeed; WAL archiving continues with no failed segment, so the barman-cloud plugin covers the binaries the `standard` variant lacks | | v18, an application that had been running for months (18.1 to 18.7) | row counts identical; `amcheck` clean | | v14 (14.20 to 14.25) and v13 (13.22, base image only) with the same index set | Job waited, rebuilt six indexes; `amcheck` clean | The pass itself was also run against a live server for the cases an upgrade does not produce on demand: - a second run does nothing; - a failed rebuild leaves the other indexes rebuilt, and a later run rebuilds only the failed one; - after two failed runs the index is left alone until it is rebuilt by hand, and the pass then completes; - an exclusion constraint's index is rebuilt in place once, not again by a retry; when a writer blocks it twice it is left alone, and after a manual `REINDEX INDEX` the pass completes; - a collation under a range partition key stays stale and its indexes are not rebuilt twice; - a rebuild blocked by an open transaction fails on its lock wait and leaves no waiting backend; it succeeds once the transaction ends; - a tenant function named like a built-in is not called by the pass, while a session with the default `search_path` does call it; - on PostgreSQL 14 an index on the database default collation is rebuilt, also when the locale is spelled `en_US.UTF-8`, and a database with a locale that has no stand-in gets the warning only in a run that saw the image change; - an index whose expression or partial-index predicate reads a column of a stale collation is rebuilt, although PostgreSQL records no collation for it. ### Known limits - **A window of wrong results.** Between the primary restart and the end of the rebuild, queries through an affected index can miss rows and a unique index can accept a duplicate. The index cannot be built ahead of time, because it has to be built by the new library. A duplicate that slipped in makes that index's rebuild fail until the duplicate is removed. - **The hook budget.** The wait ends 120 seconds before the Job's deadline. A roll that takes longer fails the Job, and the next run finds the server ready. One index must be rebuilt within one run of the Job. A very large index on a non-`C` collation does not fit that: after two attempts the pass stops trying and asks for a manual `REINDEX`, and the release stays failed until then. - **Range partition keys** are reported, not repaired. - **Other dependents** of a collation, such as `CHECK` constraints and materialized views, are not examined. - **PostgreSQL 13 and 14, default collation.** A database whose locale has no libc collation in the catalog has no stand-in. Its default-collation indexes are not rebuilt; the Job warns about it and names `REINDEX DATABASE` as the remedy. - **Collations inside expressions.** An index is found through the collations that order its keys and through the columns its expressions and predicate read. A collation that an expression applies to a column of another collation, with `COLLATE` inside the expression, leaves no trace in the catalog and is missed. - **The wait is not in the e2e suite.** The e2e step does not swap the image, so it runs the rebuild but not the wait for the roll. That part is covered by the live runs above. - **PostGIS 3.6.1 to 3.7.0** on the postgis flavor is not exercised here. - **Upstream `REINDEX` advice for these minors** is not automated. The 17.12 [release notes](https://www.postgresql.org/docs/17/release-17-12.html) ask for a `REINDEX` of btree indexes on unconstrained `bpchar` columns and of `gist_trgm_ops` indexes, among others. The flavor guard is unchanged in behaviour; its comment and messages no longer claim that the two image families always differ in Debian release. ### Screenshots N/A — no UI changes. ### Downstream repositories Walked the trigger map against the diff: two version maps, the image template, the init script, a comment in `db.yaml`, the version update script and one unit test of `packages/apps/postgres`, plus one e2e suite. The `version` enum, `values.yaml`, `values.schema.json`, the README, the `ApplicationDefinition` and the release prefix are untouched. - [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): tenant PostgreSQL moves to the minors that fix CVE-2026-116331 (18.7, 17.12, 16.16, 15.20, 14.25) on the standard-trixie image variant. Upgrading rolls every Postgres instance. - PostgreSQL 13 has no fixed release: it keeps 13.22 and stays exposed to CVE-2026-116331, and it still takes the image move and the index rebuild described below. 14.25 is the last release of the 14 line. Plan a move to a newer major for clusters on 13 and 14. - For the default flavor the image moves from Debian bullseye to trixie, which changes glibc and ICU. The upgrade rebuilds the indexes that depend on a non-C collation. Until that rebuild finishes such an index can return incomplete results and a unique one can accept duplicates, so plan a maintenance window if you use ICU or locale-specific collations. Databases created with the chart defaults use the C collation and are not affected. - An exclusion constraint's index is rebuilt in place, and its table is neither read nor written meanwhile. - When a rebuild cannot finish inside the upgrade Job, the release stays failed and the Job is retried. After two failed attempts the Job stops rebuilding that index, names it in its log and keeps failing until an operator steps in. Expect this for a large index on a non-C collation: rebuild it by hand with `REINDEX INDEX CONCURRENTLY`, drop the invalid `_ccnew` indexes the failed attempts left on its table, and the next run completes. A unique index fails the same way while it holds duplicates, which have to be removed first. - Tables range-partitioned on a text key with a non-C collation need a manual check, after which the collation version is refreshed by hand. - On the postgis flavor PostGIS moves from 3.6.1 to 3.7.0, and the upgrade does not update the extension in existing databases: once the new image has rolled out to the primary, run `ALTER EXTENSION postgis UPDATE` in each database that uses it. ``` |
||
|
|
907d369813 |
feat(postgres): add an audit toggle for access and statement logging (#5404)
## What this PR does Managed Postgres can already load pgaudit through the `sharedPreloadLibraries` allowlist and set `pgaudit.log`/`log_connections` through `postgresql.parameters`, but that leaves an orchestrator such as a customer-facing panel depending on internal parameter names to answer "who connected and what did they run". This adds an `audit` block that bundles access and statement auditing behind a single switch. With `audit.enabled`, the chart adds `pgaudit` to `shared_preload_libraries` and seeds `pgaudit.log` (set by `audit.log`, default `write, ddl, role`), `log_connections` and `log_disconnections`. The audit parameters are seeded as defaults, so an explicit `pgaudit.log` or `log_connections` in `postgresql.parameters` still takes precedence. The audit records go to the instance log, which the platform log stack already collects, so they are queryable per database by its labels without extra wiring. `audit` is off by default, and toggling it restarts PostgreSQL because pgaudit is a preloaded library. Postgres only; MariaDB, MongoDB and ClickHouse auditing are left for follow-ups. ### Screenshots Not applicable — no UI change. ### Downstream repositories Walked the trigger map against the diff. One repository is reached: `cozystack/terraform-provider-cozystack` hand-models each postgres `values.schema.json` field, and this diff adds the `audit` block to that schema, so the provider would need the field added to its postgres schema and its expand/flatten pair. That is separate work there, tracked in cozystack/terraform-provider-cozystack#87. The website postgres reference page regenerates from the package `README.md` on release, so it needs no manual follow-up, and `ansible-cozystack` carries no postgres values key. - [ ] 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#87 - [ ] [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 feat(postgres): managed PostgreSQL gains an `audit` toggle that enables pgaudit statement auditing and connection logging, with the audited classes set by `audit.log` (default `write, ddl, role`). ``` |
||
|
|
90e52bb633 |
test(snapshot-controller): assert the group snapshot versions consumers read
The CRD test pinned the vendored chart's layout: exactly six CRD
documents, v1beta2 as the storage version of each group snapshot CRD
and no v1alpha1. None of that is something the platform relies on, and
an upstream release that moves storage to v1 or adds a CRD would turn
the test red on a correct make update.
What the platform needs is that each group snapshot CRD serves v1,
which snapshot-controller, csi-snapshotter and the linstor gate read,
and v1beta2, which Velero 1.18 and the vm-instance hook read. The test
now asserts those two served versions, that the three volume snapshot
CRDs CDI and the CSI drivers read are rendered, and that every rendered
CRD is kept on uninstall, without counting documents. Removing either
served version, dropping a volume snapshot CRD, setting keepCRDs to
false, or rendering no CRDs fails it.
Fixes:
|
||
|
|
c873a50c24 |
fix(ingress-nginx): pick up the nginx rebuild with the remaining CVE fixes
The v1.11.6-cozystack.3 controller image adds to nginx 1.25.5 the fixes for the remaining advisories the controller can reach, from nginx 1.26.3 to 1.30.8. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@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> |
||
|
|
0c66790a54 |
feat(dashboard): manage application credentials from the console
Converted applications no longer let tenants read their passwords from a Secret: the API mints a password on request and shows it once. Without a console path, tenants who only use the dashboard would have no way to log in to a fresh database or to replace a migrated password. The Credentials tab lists an application's accounts with where the live password came from and its history, and offers mint and revoke behind a confirmation. Every request carries the resourceVersion the user saw, so a concurrent mint surfaces as a conflict instead of silently killing the password someone else just received. Actions are gated on a SelfSubjectAccessReview so viewers see the record without the buttons. The Credential API serves no watch, so the tab polls, the one exception to the console's no-polling rule besides the metrics panels. Mint and revoke bypass the mutation hooks because React Query keeps a mutation's result in its cache, and a minted password must live only in the dialog's state. The console's agent notes record both, since either would otherwise look like a mistake. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com> |