Commit Graph
8960 Commits
Author SHA1 Message Date
Aleksei Sviridkin d707e994ca fix(build): apply the PUSH and LOAD rules to make command-line values (#5502)
## What this PR does

With `OCI_EXPORT_DIR` set, `hack/common-envs.mk` forces `PUSH := 0` and
`LOAD := 0` so that a fork build only exports archives (#3257), and
since #4654 an empty `PUSH` or `LOAD` falls back to the default. Both
are plain assignments, and a variable given on the make command line
skips a plain assignment, so neither rule held for one. With `make -n -C
packages/system/cozystack-controller image IMAGE_TAG=pr-1-abc BUILDER=b`
plus:

| on the command line | before | after |
|---|---|---|
| `OCI_EXPORT_DIR=/tmp/x PUSH=1` | `--output type=oci,… --push=1
--load=0` | `--output type=oci,… --push=0 --load=0` |
| `OCI_EXPORT_DIR=/tmp/x LOAD=1` | `--push=0 --load=1` | `--push=0
--load=0` |
| `PUSH= LOAD=` | `--push= --load=` | `--push=1 --load=0` |
| `PUSH= LOAD=1` | `--push= --load=1` | `--push=0 --load=1` |

Both blocks now use `override`. The assignment then wins over the
command line while its right-hand side still reads the command-line
value, so an explicit `PUSH=1 LOAD=1`, `LOAD=1` or `PUSH=0` behaves as
before, and so do the environment cases. No workflow passes `PUSH` or
`LOAD` on the make command line today, so this closes a gap rather than
a leak that is happening.

Two cases in `hack/common-envs_test.bats` cover it, a command-line
`PUSH=1`/`LOAD=1` under `OCI_EXPORT_DIR` and an empty command-line
`PUSH=`/`LOAD=`. Both fail on main and pass here. The whole file passes
under `bats` (18/18) and through `hack/cozytest.sh`,
`hack/installer-image-packages-push_test.bats` still passes, and
`hack/check-commit-trailers.sh origin/main..HEAD` is clean.

Closes #4655

### Screenshots

Not a UI change.

### Downstream repositories

I walked the trigger map against the diff (`hack/common-envs.mk` and its
test). The closest entry is developer tooling and the website's
`development.md`, which documents `LOAD=1 PUSH=0`. That behaves as
before, and nothing else downstream reads these variables.

- [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(build): a PUSH=1 or LOAD=1 on the make command line no longer turns pushing or loading back on under OCI_EXPORT_DIR, and an empty PUSH= or LOAD= there falls back to the default, as an empty environment value already does.
```


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

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

## Summary by CodeRabbit

* **Bug Fixes**
* Build image export settings now consistently disable pushing and
loading when an export directory is configured, even if conflicting
values are supplied.
* Empty push and load settings now correctly fall back to their
defaults. When loading is enabled, pushing defaults to off; otherwise,
pushing defaults to on.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-12-04 00:52:54 +03:00
Aleksei Sviridkin 288c564f58 test(kubernetes-nodes): isolate Talos version fixtures from defaults (#5552)
## What this PR does

Talos patch bumps require edits to tests unrelated to the shipped
version. I gave those tests explicit versions and added a separate
assertion for the default. The render snapshot and worker-image catalog
check stay unchanged.

Closes #5456.

Validation: 293 Helm tests and 12 snapshots pass. Changing the default
patch release in a chart copy fails only the render snapshot and the new
default assertion. The full local Bats run fails the same tests as on
`main`.

Helm lint reports the same icon URL and cozy-lib dependency errors on
the base chart. The pre-commit package-generation hook could not run
because flock is unavailable.

### Screenshots

Not applicable (test-only 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
NONE
```


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

## Summary by CodeRabbit

* **Tests**
* Expanded Kubernetes node chart coverage for default Talos image URLs,
image selection, template tags, and storage-class behavior.
* Updated test scenarios to pin Talos versions explicitly, keeping
expected image names and template hashes consistent with each scenario.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-12-03 19:10:31 +03:00
Aleksei Sviridkin 0cc3948180 fix(api): preserve Application update concurrency constraints (#5234)
<!-- Thank you for making a contribution! Here are some tips for you:
- Use Conventional Commits for the PR title: `type(scope): description`
- Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore
- Scopes are not an exhaustive list — pick the most specific scope for
the change and extend the list when a genuinely new area appears.
Examples:
- System components: dashboard, platform, operator, cilium, kube-ovn,
linstor, fluxcd, cluster-api
- Managed apps: postgres, mariadb, redis, kafka, clickhouse,
virtual-machine, kubernetes
- Development and maintenance: api, hack, tests, ci, docs, maintenance
- Breaking changes: append `!` after type/scope (`feat(api)!: ...`) or
add a `BREAKING CHANGE:` footer
- If it's a work in progress, consider creating this PR as a draft.
- Don't hesistate to ask for opinion and review in the community chats,
even if it's still a draft.
- Add the label `kind/backport` if it's a bugfix that needs to be
backported to a previous version.
-->

## What this PR does

A stale application update could succeed after a backend conflict.
Retries now rebuild and validate the update against a fresh HelmRelease
snapshot. Caller UID and resourceVersion constraints are checked again.

Updates without a resource version remain supported. A resource version
that parses to zero is unconditional too, as in the Kubernetes generic
registry. A nonzero version older than the live release conflicts. A
retry is judged like a fresh unconditional PUT, including for garbage
collector finalizers. HTTP PUT, PATCH and apply tests cover it. Durable
SSA ownership is not fixed here: Application conversions still omit
managedFields.

Build and vet pass. Race tests for the Application registry and API
server pass. Scoped lint reports one unchanged errcheck that is also
present on main.

Updated the head to the current fix on top of main, including the
workload memory validation from #5348. Please review this head.

### Screenshots

Not applicable; no UI changes.

<!-- 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(api): honor Application update preconditions and recompute patches after conflicts instead of retrying an outdated admitted object.
```


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

## Summary by CodeRabbit

* **Bug Fixes**
* Application updates now enforce object identity and resource-version
preconditions. Requests with stale versions or mismatched identities
return a conflict rather than modifying a newer or different object.
* Concurrent updates preserve unrelated HelmRelease fields and lifecycle
metadata when the update can safely be retried. When the request is
based on stale state or the conflict cannot be safely resolved, it
returns a conflict instead of overwriting newer changes.
* Updates from watch events now reject stale resource versions while
allowing updates based on current events.
* Retries no longer restore a removed finalizer on a release being
deleted; the request returns a validation error instead.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-12-03 18:05:36 +03:00
Can Sentay 94bd0e3ecf fix(build): apply the PUSH and LOAD rules to make command-line values
A variable set on the make command line skips a plain assignment in a
makefile, so neither rule in common-envs.mk applied to one. With
OCI_EXPORT_DIR set, PUSH=1 on the command line still expanded to
--push=1 beside the OCI archive output, the anonymous push the export
guard exists to stop, and LOAD=1 still loaded. An empty PUSH= or LOAD=
reached buildx as an empty flag instead of falling back to the default,
as an empty environment value already does.

No workflow passes PUSH or LOAD on the command line today, so this
closes a gap rather than a leak that is happening.

Maintainer check: bats --filter 'on the make command line' passed 2/2 on HEAD; replacing common-envs.mk with pinned main failed 2/2: 'command-line PUSH=1 pushes under OCI_EXPORT_DIR' and 'empty command-line PUSH/LOAD reach buildx as empty flags'.

Fixes: 529efa7e01 ("build(hack): add OCI_EXPORT_DIR archive-export build mode")
Closes: #4655
Assisted-by: LLM
Signed-off-by: Can Sentay <cansen1392@gmail.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-12-03 17:50:31 +03:00
Aleksei Sviridkin d380f2e8fc fix(tenant): ship sub-tenant logs and metrics to the ancestor monitoring (#5257)
## What this PR does

A tenant (and the guest clusters inside it) whose monitoring resolves to
an ancestor runs monitoring agents (Fluent Bit + VMAgent) that write to
the owner tenant's `vlinsert` (logs) and `vminsert` (metrics). The
generated tenant Cilium egress dropped part of this traffic:

- The egress never opened `vlinsert`, so log shipping was always dropped
at the source (fluent-bit `no upstream connections available to
vlinsert-generic.<owner>.svc:9481`).
- For metrics, the egress derived the target by walking the namespace
prefix. The walk reaches an ancestor only when its namespace is a prefix
of the writer's, so it never reaches `tenant-root` from below the first
level. In the common layout where only `tenant-root` has monitoring and
descendants inherit it, a guest two levels deep had its metrics dropped
on egress (a first-level tenant, or an intermediate monitoring owner
that is a prefix, still worked).

This change replaces the prefix walk with a single egress rule that
targets the monitoring owner namespace directly. The owner is the value
already computed in `namespace.yaml` and inherited through
`_namespace.monitoring`, so it resolves to the real owner at any depth
and covers both `vminsert` and `vlinsert` in one rule. The rule is
skipped when the tenant owns its monitoring (writes stay in-namespace)
or when no ancestor owns it.

No ingress policy is added on the owner side: the owner tenant already
accepts the traffic through its `allow-external-communication` rule
(`fromEntities: [world, cluster]`), which matches every pod in the
cluster.

Helm unittests cover the owner-targeted egress one level down, the deep
case targeting `tenant-root`, the self-owned case (the `monitoring:
true` override wins over the inherited owner, no cross-namespace rule),
and the no-owner case (monitoring disabled with the inherited owner
absent or empty, no rule rendered).

Fixes #5256

### Downstream repositories

- [x] No downstream repository is affected by this change

### Release note

```release-note
fix(tenant): sub-tenant monitoring agents now ship logs and metrics to the monitoring owner tenant's VictoriaLogs/VictoriaMetrics at any nesting depth. Previously the generated Cilium egress never opened vlinsert, so logs were always dropped, and it reached vminsert only by walking the namespace prefix, so metrics were dropped when the monitoring owner was tenant-root and the writer sat below the first level.
```


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

## Summary by CodeRabbit

* **Updates**
* Tenant monitoring write traffic now targets the configured monitoring
owner’s namespace for `vminsert` and `vlinsert`, including when the
owner is not the tenant’s parent.
* Tenants that own their monitoring, or have no configured monitoring
owner, do not receive a separate cross-namespace monitoring egress rule.
* Network access rules continue to allow required connections to
ancestor namespaces, including etcd and ingress endpoints.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-12-03 17:43:20 +03:00
Aleksei Sviridkin 3d001ed37d feat(cluster-api): update capmox to v0.9.2 and in-cluster IPAM to v1.1.1 (#5243)
## What this PR does

Updates the two vendored Cluster API providers of the Proxmox substrate:

- `capi-providers-infraprovider-proxmox`: capmox **v0.7.7 → v0.9.2**
- `capi-providers-ipam-in-cluster`: in-cluster IPAM **v1.0.3 → v1.1.1**

Both are refreshed with the existing `make components` target (pinned
SHA-256 of the release assets, `gzip -n`), and the ConfigMap name and
`spec.version` move with them. The charts that render capmox objects
(`kubernetes`, `kubernetes-nodes`) are not touched.

A second commit raises the capmox manager memory limit from 256Mi to
512Mi (see "Found while testing").

Why:

- v0.9.1 and v0.9.2 are security roll-ups (32 Go vulnerabilities in
dependencies between them), and v0.9.2 fixes several provisioning races:
VMID collisions, retries of the bootstrap ISO injection, waiting for the
boot-disk resize and for active Proxmox tasks before changing a VM.
- v0.8 introduced the `v1alpha2` API (CAPI `v1beta2` contract). It is
the base for the next Proxmox changes (per-namespace hypervisor
credentials, zones).

**Depends on #4902.** capmox v0.9 is built against Cluster API v1.12 and
declares the `v1beta2` contract; the in-cluster IPAM v1.1 needs CAPI ≥
v1.11. `main` still ships core v1.10.1, so this must not merge before
#4902 (core v1.14.4, capi-operator v0.30.0). It is deliberately not
stacked on that branch. Both Proxmox package sources now depend on
`cozystack.capi-provider-core`, so a release carrying both PRs rolls out
core first. The comments in both `providers.yaml` now say what they
need.

### What changes for users

- capmox serves `v1alpha1` and `v1alpha2`; `v1alpha2` becomes the
storage version. Existing objects are converted by the provider's
webhook; the charts keep writing `v1alpha1`, which is still served.
Moving the charts to `v1alpha2` is a separate follow-up.
- `kubectl get proxmoxcluster` (no version) now returns `v1alpha2`,
which has no `status.ready`: tooling that reads it has to use the
`Ready` condition or ask for `v1alpha1` explicitly.
- Read through `v1alpha1`, an unset `spec.providerID` comes back as `""`
(the `v1alpha2` field is a plain string). Nothing in Cluster API reads
that version.
- capmox upstream documents v0.7 → v0.8 → v0.9 as the supported path;
the direct v0.7.7 → v0.9.2 jump is what was tested below.
- capi-operator v0.30 (from #4902) accepts exactly one ConfigMap per
provider selector. The chart renames the ConfigMap with the version, so
a helm upgrade removes the old one; a hand-made install has to delete
it, otherwise the operator stops upgrading every provider.

### Tested

On a live management cluster with Cluster API core v1.13.7 (the #4902
versions), three Proxmox-backed tenant clusters (Talos and Kairos
workers, Kamaji control planes), Proxmox VE 9.2:

- Package tests: `hack/capi-provider-components_test.bats` 6/6;
helm-unittest `core/platform` 285/285, `apps/kubernetes` 367/367,
`apps/kubernetes-nodes` 243/243.
- Before the upgrade, every live `ProxmoxCluster`,
`ProxmoxMachineTemplate` and `ProxmoxMachine` (16 objects) was
round-tripped through the v0.9.2 conversion functions (`v1alpha1 →
v1alpha2 → v1alpha1`): specs unchanged apart from the `providerID` note
above.
- Upgrade IPAM then capmox through capi-operator: both
`ProviderUpgraded`, CRD storage `v1alpha2`, all three `ProxmoxCluster`
Ready, every existing `ProxmoxMachine` kept its VMID and provider ID, no
MachineDeployment rollout, every `IPAddressClaim` bound, no reconcile
errors.
- Every tenant release re-applied through `v1alpha1` with a server-side
dry run (conversion, webhooks, template immutability): accepted.
- Live Proxmox checks (worker joined, machineconfig, guards, tenant
apiserver and nodes): 23/23 on two tenants.
- One worker created and deleted end to end, twice per version (seconds
from the scale-up; Proxmox API calls are approximate, they include the
other tenants' reconciles):

| | v0.7.7 run 1 | v0.7.7 run 2 | v0.9.2 run 1 | v0.9.2 run 2 |
|---|---|---|---|---|
| `InfrastructureReady` (VM cloned, configured, started) | 131 s ¹ | 11
s | 26 s | 11 s |
| `NodeReady` (Talos booted and joined) | 193 s ¹ | 89 s | 94 s | 89 s |
| delete → Machine gone (VM destroyed) | 11 s | 16 s | 16 s | 16 s |
| Proxmox API calls by the capmox token | 255 | 181 | 140 | 168 |

¹ about two minutes of this run went on waiting for the static IP from
the in-cluster IPAM (v1.0.3).

What we got: no latency regression. In the warm runs both versions take
the same 11 s to a running VM, 89 s to a Ready node and 16 s to a
destroyed VM; node readiness is dominated by the Talos boot, not by the
provider. v0.9.2 made fewer Proxmox API calls per worker (140–168 vs
181–255). The count is approximate, and two runs per version is a small
sample. v0.9.2 logs one transient `VM … is running - destroy failed` per
deletion, and the deletion still completes in the same 16 s.

### Retest on Cluster API v1.14.4

The same management cluster now runs the #4902 head: Cluster API core
and kubeadm bootstrap v1.14.4, cluster-api-operator v0.30.0, Talos
bootstrap v0.6.13, with capmox v0.9.2 and in-cluster IPAM v1.1.1 from
this PR. The capmox bump itself was applied while the cluster was still
on core v1.13.7 (table above); the core v1.14.4 upgrade came after it,
so the upgrade step was not repeated on v1.14.4.

- All three `ProxmoxCluster`s are Ready and every `Machine` is Running
(6 workers). The capmox manager has 0 restarts over 5 days, including
the move to core v1.14.4.
- One worker created and deleted end to end, twice, on the
`kubernetes-px` tenant (cluster-autoscaler paused during the runs):

| | v1.14.4 run 1 | v1.14.4 run 2 |
|---|---|---|
| `InfrastructureReady` | 11 s | 26 s |
| `NodeReady` | 94 s | 99 s |
| delete → Machine gone | 16 s | 16 s |

  The timings match the v1.13.7 runs above (11-26 s, 89-94 s, 16 s).
- capmox logged the one `VM … is running - destroy failed` per deletion
already noted above, plus a transient `vm not initialized` right after
creation. Both cleared on their own.

Not repeated on v1.14.4: the conversion round trip and the server-side
dry runs of the tenant releases. capmox v0.9's compatibility table lists
only Cluster API v1.11 and v1.12, so v1.14 is outside what upstream
documents; the runs above are the evidence for it.

### Found while testing (not caused by this bump)

capmox reads the bootstrap data Secret through the controller-runtime
cached client (`MachineScope.GetBootstrapSecret`, the same in v0.7.7 and
v0.9.2), so the first machine it provisions starts a cluster-wide Secret
informer. On the test cluster that is 1236 Secrets / 87 MB of JSON (706
Helm release Secrets), and the manager hits the 256Mi limit set in
`providers.yaml`: both v0.7.7 and v0.9.2 were `OOMKilled` while
provisioning (working set up to 232–255 MiB before the kill). Each kill
restarts the controller and provisioning resumes, so the runs above
still completed. The second commit of this PR raises the manager limit
to 512Mi (request unchanged at 64Mi), twice the last measured working
set. With 512Mi, a provisioning run on the same cluster peaked at 246
MiB with no restarts. The proper fix is to read that Secret with the API
reader in capmox: ionos-cloud/cluster-api-provider-proxmox#958 (open,
review requested). The limit can come back down once that is released.

### Downstream repositories

- [ ] No downstream repository is affected by this change
- [x] [cozystack/website](https://github.com/cozystack/website) -
follow-up: cozystack/website#792
- [ ]
[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/website#792 adds the Proxmox substrate page to `next/` with
these versions (it was only in `v1.7/`) and two troubleshooting rows
from the findings above; it stays a draft until this PR is merged.
Terraform and Ansible were not checked against the trigger map, so those
boxes are left for a maintainer.



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

## Summary by CodeRabbit

* **New Features**
* Added IPv6 prefix pools for cluster-wide and namespace-scoped
allocation.
  * Added configurable IP address reuse grace periods to IP pools.
* **Improvements**
* Updated the Proxmox infrastructure provider to v0.9.2 and the
in-cluster IPAM provider to v1.1.1, with support for the v1beta2 Cluster
API contract.
* Increased the Proxmox provider manager’s memory limit and enabled the
IPAM provider to run on master and control-plane nodes.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-12-03 17:38:07 +03:00
Aleksei Sviridkin 51f74d9f77 test(kubernetes-nodes): isolate Talos version fixtures from defaults
Talos patch bumps should not rewrite image-selection, storage-class,
Proxmox or heredoc tests. Give those cases their own version and pin
the shipped default separately. Keep the existing versions in hash
fixtures so they still check byte-for-byte compatibility.

Validated with the chart suite and focused Bats tests; changing the
default in a chart copy leaves unrelated suites green and fails the
dedicated default assertion.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-12-03 17:27:35 +03:00
Aleksei Sviridkin 39c452c260 docs(agents, tests): ask what a new check protects and how a test fails (#5417)
## What this PR does

Adds two asks to the contribution rules, for people and for agents: show
that a new test can fail, and say what a new repository-wide check
protects.

A test merged in #5349 that read chart sources from a Go package, pinned
hand-typed expected values, and guarded declarations that no code read
yet. Review checked that it passed and that the author's claims were
true. Nobody asked what requirement it enforced, and I approved it.
#4508, which ships a chart variant the test did not expect, went red on
it without being wrong.

The template asks what requirement on the system's behaviour a check
protects and who consumes the checked artifact. The contribution guides
ask for failure evidence: revert a behaviour change, or mutate the
behaviour a test pins. A rule that has no existing requirement needs
agreement in an issue or an accepted design proposal before the check's
PR. A test plan alone does not justify the check.

Nothing here is machine-checked. Rules about where a contract should be
enforced (schema against Go test) and about where expected values come
from are left out on purpose: they need a discussion first.

### New checks

None. This PR adds prose rules and no check that can fail a change.

### 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.
-->

- [ ] 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:
- [x] [cozystack/community](https://github.com/cozystack/community) -
follow-up: cozystack/community#139 (an issue: `contributors/README.md`
restates how to fill the template in, and should change once this
merges)

### 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
NONE
```


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

## Summary by CodeRabbit

* **Documentation**
* Added guidance for showing that changed tests detect the behavior they
cover, including what to report when tests cannot be run locally.
* Clarified how to document checks that may affect other changes,
including the requirement they protect and the code that uses their
results.
* Added a “New checks” section to the pull request template, with
instructions to describe applicable checks or write “None.”
* Updated review and commit guidance, and linked to detailed conventions
for tests and checks.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-12-03 14:58:45 +03:00
Aleksei Sviridkin e1119854f3 test(clickhouse): run the base e2e server on the micro preset (#5504)
<!-- 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

The base ClickHouse e2e case now runs the server on the `micro` preset
instead of `nano`. Under the 128Mi limit of `nano` the server can be
OOMKilled seconds after start, so the replica never gets ready and the
endpoint Service the case waits for is never created. The pod status
from a failed run is in [this
comment](https://github.com/cozystack/cozystack/issues/3852#issuecomment-7257633334).

Refs #3852. The issue stays open, because whether tenants need a memory
floor for ClickHouse on `nano` is a separate question.

### 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
test(clickhouse): run the base ClickHouse e2e server on the micro preset so it is not OOMKilled at startup.
```


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

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

## Summary by CodeRabbit

* **Chores**
* Increased the resources allocated to ClickHouse in the end-to-end test
environment.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-12-03 13:55:18 +03:00
myasnikovdaniil bfbb79382f fix(velero): bump Velero to 1.18.5 so VM backups with grouped disks finish (#5535)
## What this PR does

Every VM backup through the Velero strategy failed after 10 minutes, and
for those 10 minutes the guest filesystems stayed frozen. The
vm-instance chart labels a VM's claims with `velero.io/volume-group`, so
Velero snapshots them as one VolumeGroupSnapshot and thaws the guest
after a single freeze. Velero 1.18.1 then waits for the member
VolumeSnapshots, and it accepts a member only when its owner reference
says `groupsnapshot.storage.k8s.io/v1beta2`. snapshot-controller v8.7.0
writes `v1` owner references, so no member ever matched and the wait ran
out at `CSISnapshotTimeout`. The other claims of the group then failed
on the orphaned group snapshots that were left behind.

Velero 1.18.5 matches group members by kind and UID and negotiates
whichever group snapshot version the cluster serves ("Detect the
VolumeGroupSnapshot API version at runtime" in its release notes). This
PR moves the server and node-agent to 1.18.5 through an image tag
override, because no velero chart release ships 1.18.5 yet. It is a
patch release on the line the platform already runs, so the chart, the
plugins and the CRDs stay as they are. The only CRD difference between
1.18.1 and 1.18.5 is an optional `resourcePolicy` field on Restore,
which nothing in the platform sets.

Alternatives considered:

- Stop labelling the claims until Velero handles v1. Backups would pass,
but each disk would be snapshotted separately, so a VM with several
disks loses its crash consistency across disks and the guest would be
frozen once per volume, which Windows VSS does not tolerate past 10
seconds.
- Make snapshot-controller write v1beta2 owner references. That means
downgrading below the release that serves v1, which the linstor group
gate and csi-snapshotter already read.
- Velero 1.19.0 also handles v1, but it is a new minor with breaking
changes listed, and 1.18.5 is enough.

Also in this PR: a VMInstance with `disks: []` and no cloud-init
rendered `disks:` and `volumes:` as null, and the KubeVirt webhook
refused the VirtualMachine because both must be arrays. The chart now
renders them as empty lists.

Tests: `helm unittest` passes in `packages/system/velero` (new case:
node-agent runs the same release as the server),
`packages/system/snapshot-controller` and `packages/apps/vm-instance`
(new cases for a VM without disks, with and without cloud-init).

### 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(velero): Velero is bumped to 1.18.5. A VM backup that snapshots the VM's disks as one group no longer times out after 10 minutes with the guest filesystems frozen. A VMInstance with no disks is no longer refused by KubeVirt.
```


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

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

## Summary by CodeRabbit

* **Bug Fixes**
* VM configurations without disks now render empty disk and volume lists
correctly. Cloud-init-only configurations continue to include the
cloud-init disk and its volume.
* **Updates**
* Velero and its node agent now use version 1.18.5. Group snapshot API
version information is aligned with the versions used by the related
components. These changes improve consistency across VM and backup
configurations.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-12-03 15:49:47 +05:00
Myasnikov Daniil fb00301f0b test(hack): check chart output for arbitrary tenant values in unit-tests
hack/values-injection renders every chart under packages/apps and
packages/extra with generated values for each string field and map
key its schema allows, including the charts its HelmReleases install,
and fails when a value changes the structure of the output rather
than only its content. Fields multiline by design are listed in
hack/testdata/values-injection/allowlist.txt.

It runs as values-injection-check, a prerequisite of unit-tests, and
the Helm Charts conventions in docs/agents/overview.md gain the rule it
enforces.

Assisted-by: LLM
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-12-03 10:03:22 +00:00
Myasnikov DaniilandTimofei Larkin 4b8eaffa53 security(apps): quote and validate tenant values in chart templates
Application values reach chart templates as strings, maps and lists,
and several templates rendered them as-is. Values are now quoted or
converted to their type where they are rendered, map keys used as
names or config keys are checked against what their target accepts,
hook Jobs read their data from environment variables, and values
handed to upstream charts are passed in the form those charts expect.

cozy-lib gains cozy-lib.yaml.toYaml and cozy-lib.yaml.fromYaml, which
fail the render on a value they cannot encode or decode instead of
returning an empty result. external-dns GoDaddy credentials move from
args to a Secret.

Values that were valid before keep rendering: NATS units, restic short
keep flags, MongoDB database names by MongoDB's own rule, uppercase and
IPv6 VPN hosts, bootbox hostnames that are subdomains, netmask
whitelists, bracketed IPv6 registries for the Talos installer, time
zones and intervals in the MongoDB backup schedule.

Co-authored-by: Timofei Larkin <lllamnyp@gmail.com>
Assisted-by: LLM
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-12-03 10:03:17 +00:00
IvanHunters 0b119ea18b fix(tenant): ship sub-tenant logs and metrics to the monitoring owner at any depth
A tenant whose monitoring resolves to an ancestor runs Fluent Bit and
VMAgent that write logs to the owner's vlinsert and metrics to its
vminsert. The generated Cilium egress dropped part of this traffic: it
never opened vlinsert, so log shipping was always dropped at the source,
and it reached vminsert only by walking the namespace prefix, which never
reaches tenant-root from below the first level, so a guest two levels deep
under a tenant-root-owned monitoring lost its metrics.

Replace the prefix walk with a single egress rule that targets the
monitoring owner namespace directly for both vminsert and vlinsert. The
owner is already computed in namespace.yaml and inherited through
_namespace.monitoring, so it resolves at any depth, and the rule is
skipped when the tenant owns its monitoring or when no ancestor owns it.
The owner already admits the traffic through allow-external-communication
(fromEntities: cluster), so no ingress policy is added.

The etcd and ingress ancestor egress now comes from
tenant.ancestorNamespaces (merged separately onto main), so the monitoring
tests assert that shape and the ancestor-egress suite no longer asserts the
removed vminsert prefix-walk rule.

Assisted-by: LLM
Signed-off-by: IvanHunters <xorokhotnikov@gmail.com>
2026-12-03 11:45:34 +03:00
Aleksei Sviridkin d0f22f5135 docs(contributing): ask what a new check protects and how a test fails
A repository-wide test merged that read chart sources from a Go
package, pinned hand-typed values, and guarded declarations nothing
read yet. Review checked that it passed and never asked what
requirement it enforced. The next legitimate change went red on it.

Such a check is a new rule for every contributor, and an ordinary
approval of the PR that adds it does not show the rule was weighed,
so the rule is agreed before that PR, and a test plan does not count
as the requirement behind it.

The failure evidence goes into the commit body rather than a separate
failing commit: branches merge without squash, so each commit has to
pass on its own. A test pinning unchanged behaviour has nothing to
revert, so it proves it can fail by a mutation instead. When an e2e
failure cannot be observed locally or in CI, recording that limit and
its reason lets the reviewer decide without inventing evidence.

Validation: the 79 relevant Bats checks pass on the branch and base;
no executable tests or checks are added.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-12-03 10:28:30 +03:00
Aleksei Sviridkin 8e430c011f ci: widen the docs-only gate to Markdown, images and repository metadata (#5235)
## What

The PR pipeline skips build, Talos and E2E only when every changed path
is under `docs/` or one of the two CI-only Go tools. A PR that touches
`README.md`, `GOVERNANCE.md`, an issue template or `LICENSE` still
builds every image, boots a sandbox and runs the suite, for files
nothing in that pipeline reads.

This PR moves the classifier into `hack/code-changed.sh` and widens what
counts as non-code:

- `docs/` tree, Markdown outside `packages/`, `img/`, `LICENSE`
(Markdown under `packages/` stays code: Go controller tests read chart
READMEs)
- `.github/ISSUE_TEMPLATE/`, `CODEOWNERS`, `PULL_REQUEST_TEMPLATE.md`,
`labels.yml`, `renovate.json`, `.gemini/`, `.coderabbit.yaml`,
`security-insights.yml`

Both lanes read the same script: the in-tree `plan` job feeds it the
`--no-renames` merge diff, and the fork `resolve` job feeds it the
base-repo PR file list (`filename` + `previous_filename`, so a
`packages/… -> docs/…` rename still reads as code). The fork lane checks
out `hack/` from the base repository's default branch, never from the
fork.

The `push` triggers of `build-main`, `build-release` and CodeQL mirror
the classifier with a `paths` filter (`**`, one `!` glob per non-code
path, then `packages/**.md` re-included; `paths` rather than
`paths-ignore` because only `paths` documents re-including after a
negation), so a docs-only push to main no longer rebuilds it.
`hack/code-changed_test.bats` keeps the three filters equal, checks that
every `!` glob is non-code and every re-include is code for the script,
so a push of real code can never skip its build, and pins CodeQL's
`pull_request` trigger to having no path filter.

## What still checks non-code files

- Markdown under `packages/` is code, so chart READMEs keep the full
pipeline: `packages/system/flux-plunger/README.md` is checked by a Go
test (`TestDocs_StateTheTimingsTheBinaryAndTheChartUse` in
`internal/controller/fluxplunger/hook_contract_test.go`) that runs only
on the code path, and all chart READMEs are regenerated by `make
generate` under pre-commit. The Bats lane of `checks` runs for every
path except the two CI-only tools (`cmd/backport-batch/`,
`cmd/api-gate/`), so `labels.yml`, `CODEOWNERS`, `renovate.json`, the PR
template and the Markdown outside `packages/` keep their `hack/*.bats`
contract tests; they only skip build, Talos and E2E.
- `labels.yml` has its own workflow; zizmor still runs on workflow
changes.
- CodeQL is a required check on `main`, so its `pull_request` trigger
has no `paths-ignore`: a path-filtered required workflow would leave the
PR on "Expected". Only the `push` trigger keeps the mirrored list, so a
docs-only merge does not rerun it.

## Numbers

Over the 200 merged PRs returned by `gh pr list --state merged --limit
200` on 2026-11-18 (merged 2026-10-14 to 2026-11-18; the list is ordered
by creation, not merge date) the gate on main (`docs/` plus the two
CI-only tools) skips 8, the new one 10. The extra two: #5168 and #5188.
None of them touches Markdown under `packages/`, so keeping it as code
costs nothing in this window.

## Not changed

- `.gitignore`, `.dockerignore`, `packages/tests/` fixtures and
`dashboards/*.json` stay code: the first two change what gets built, the
fixtures feed helm-unittest (code lane only), the dashboards ship in
charts.
- `select-e2e.sh`'s `inert_config_pattern` is untouched;
`docs/agents/e2e-testing.md` already says the `plan` gate is the place
to widen.



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

## Summary by CodeRabbit

* **CI Improvements**
* Main and maintained release-branch builds are skipped for changes
limited to documentation, images, selected tooling, repository metadata,
and Markdown outside `packages/`. Changes to Markdown files under
`packages/` still trigger builds.
* CodeQL is skipped on pushes to `main` for those non-code changes; pull
requests targeting `main` remain subject to CodeQL checks.
* End-to-end checks are skipped when all changed files are classified as
non-code, including renames. Status messages clarify when checks are not
required.
* **Documentation**
* Updated end-to-end testing guidance to distinguish the build gate from
test-suite selection; dashboard-only changes still install dependencies
but skip the Chainsaw suite.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-12-03 10:12:33 +03:00
Aleksei Sviridkin 2d487d2bfa fix(kubernetes-nodes): scale a pool capped at zero down to zero (#5539)
## What this PR does

Setting `maxReplicas: 0` on a pool didn't stop its workers. The chart
leaves `spec.replicas` out and expects CAPI to clamp it into `[min,
max]`, but on a real cluster the MachineDeployment stayed at `replicas:
1` with min 0 / max 0, and the autoscaler only removes nodes it
considers unneeded. We hit this when a managed cluster was suspended for
lack of funds, and with Stop group in the console.

Now a pool with `maxReplicas: 0` renders `replicas: 0`. When
`maxReplicas` goes back up the field is dropped again, CAPI keeps the
live 0 and the autoscaler scales the pool back to its minimum. Pools
with a non-zero cap render as before.

### Screenshots

No UI changes.

### Downstream repositories

Only the `maxReplicas` description changed in the generated docs. I did
not walk the website sync for it, so the boxes are left for a human.

- [ ] 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-nodes): a worker pool set to maxReplicas 0 now scales its workers down to zero instead of keeping the running ones.
```



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

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

## Summary by CodeRabbit

* **New Features**
* Setting a worker pool’s maximum replicas to `0` now pauses the pool
and scales its workers down to zero. The pool can resume when the limit
is raised.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-12-03 08:13:26 +03:00
Andrei Kvapil 7fb2bc785a feat(rabbitmq)!: mint tenant passwords through the credentials API (#5381)
## What this PR does

This PR now carries three conversions: RabbitMQ, Redis/Valkey (reviewed
in #5382) and Bucket (reviewed in #5383). Those two were merged into
this branch instead of main by mistake, and since each was already
reviewed and approved on its own, they land here together rather than
being split out again.

RabbitMQ passwords are no longer readable from the per-user Secrets, and
tenants lose the administrator login from the operator's
`<release>-default-user`. Every tenant tier can read both today. An
administrator mints a password on the user's `Credential` and sees it
once, the topology operator applies it within seconds, and the next mint
or a revoke kills it. The broker hashes passwords itself, so the account
Secret keeps the plaintext, readable only by the platform. This is the
RabbitMQ part of the user secrets API design (cozystack/community#137).

Stacked on #5380. Review only the top four commits:

- The chart renders a `plaintext` CredentialTemplate per user and points
each `User`'s `importCredentialsSecret` at its account Secret. Password
generation and the `lookup` are gone.
- The lineage webhook package gets a helper that tells whether a
definition shows a Secret, with tests that load the converted
definitions.
- `credentials-migrate` gets `--source-selector`, to find per-user
Secrets by label, and `--hide-secret-suffix`, to hide a Secret the
operator created once the kind's new definition is in the API.
- Migration 68 seeds the account Secrets before the chart switches. Its
finish Job deletes the old per-user Secrets and hides `-default-user`.
It waits for the new definition first: on the upgrade run the operator
rewrote the Secret 7 s before rabbitmq-rd upgraded, and the webhook
stamped it tenant-visible again from the old definition. The exclude in
the new definition keeps it hidden on every later rewrite.

The design assumed the topology operator imports a password only when it
creates a user. Version 1.20.2 re-imports on every reconcile and watches
the Secret, so a mint applies live.

Tested on a three-node cluster, fresh install: a minted password works
after 5 s, the old one is rejected right after the next mint, revoke
works, and removing a user removes the broker user too. Every fresh
install fails once: the operator's webhook rejects a `User` whose Secret
doesn't exist yet, and the retry 32 s later converges. Full upgrade from
1.7.1 on the same cluster, all engines at once with a client loop each:
migrations 64-71 ran in order and every account was adopted with its old
password. The RabbitMQ client loop had no failures. That run showed the
7 s window above; the last two commits close it and are covered by
tests, not by a second run.

Breaking for users: tenants lose the administrator login and the
management UI, since chart users carry no tags. Passwords can't be read
any more. A fresh install, or an upgrade that adds a user, shows one
failed attempt before it converges.

Open questions:

1. The first failed attempt: accept it, or seed the account Secret
before the chart renders?
2. Add `users.<name>.tags`, so tenants can have an admin user again?
3. Rotate `-default-user` in the finish Job? That needs `pods/exec` for
`rabbitmqctl`. Otherwise the value tenants could read stays valid.

### Screenshots

No UI change.

### Downstream repositories

- [ ] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up: needed, a RabbitMQ note for the credentials API docs
(cozystack/website#753) and an upgrade note that tenants lose the
administrator login
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up: needed, `cozystack_rabbitmq` still sends
`users.<name>.password`
- [ ]
[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: needed, the RabbitMQ row in the design, and a fix to its
claim that the operator imports a password only on user creation

### Release note

```release-note
feat(rabbitmq)!: RabbitMQ passwords are issued through the credentials API. The per-user Secrets are removed, `users.<name>.password` is ignored, and tenants can no longer read the administrator login in `<release>-default-user`. An administrator mints a password on the user's Credential; it is shown once and applies within seconds. Existing passwords keep working through the upgrade. Switch clients to minted passwords after the upgrade.
```



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

## Summary by CodeRabbit

* **New Features**
* Added credential templates for RabbitMQ, Redis, Valkey, and bucket
accounts, with credentials issued and managed through the credentials
API.
* Added platform-account settings for bucket users and support for
engine-issued bucket access keys.
* Credential mint responses now include an access key ID for services
that issue key pairs.
* **Improvements**
* Redis and Valkey passwords can be rotated without restarting; internal
accounts support replication and monitoring.
  * Tenant-visible access to platform credentials is more restricted.
* Added migrations for existing RabbitMQ, Redis, Valkey, and bucket
credentials.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-12-02 19:06:38 -05:00
Marian Koreniuk 87bc0e30ca fix(platform): order capmox and in-cluster IPAM after Cluster API core
capi-operator only waits for the CoreProvider to be Ready and accepts either
contract, so the providers could roll out while core is still on the old
version. Add cozystack.capi-provider-core to dependsOn in both sources.

Assisted-by: LLM
Signed-off-by: Marian Koreniuk <moriarti@cp.if.ua>
2026-12-02 21:56:12 +01:00
Marian Koreniuk eeb0072ef2 fix(cluster-api): raise the capmox manager memory limit to 512Mi
capmox reads the bootstrap data Secret through the controller-runtime
cached client, so provisioning the first machine starts an informer
over every Secret in the management cluster. On a Cozystack management
cluster most of those are Helm release revisions.

On a cluster with 1236 Secrets (87 MB as JSON, 706 of them Helm
release revisions) the manager was OOMKilled at the 256Mi limit while
provisioning a worker, with both capmox v0.7.7 and v0.9.2. The last
working set before the kills was 232 MiB (v0.7.7) and 255 MiB
(v0.9.2); the same manager without the Secret cache uses 19 MiB.

512Mi is twice the last measured working set. The request stays at
64Mi. The limit can come back down once capmox stops caching Secrets.

Assisted-by: LLM
Signed-off-by: Marian Koreniuk <moriarti@cp.if.ua>
2026-12-02 21:56:12 +01:00
Marian Koreniuk a6928c765d feat(cluster-api): update capmox to v0.9.2 and in-cluster IPAM to v1.1.1
capmox v0.9.1/v0.9.2 are security roll-ups with provisioning fixes, and v0.8
moved the provider to the v1alpha2 API and the Cluster API v1beta2 contract.
capmox v0.9 is built against Cluster API v1.12 and needs the in-cluster IPAM
provider v1.1, so both packages move together, and both need
capi-providers-core >= v1.12 (cozystack/cozystack#4902).

The vendored manifests are refreshed with make components against the pinned
release sums; the ConfigMap names and spec.version follow the Makefile. The
charts keep writing v1alpha1, which capmox still serves.

Assisted-by: LLM
Signed-off-by: Marian Koreniuk <moriarti@cp.if.ua>
2026-12-02 21:56:12 +01:00
Aleksei Sviridkin 34d2b0eb6c fix(linstor-gui): keep concurrent and slow sign-ins from failing on CSRF (#5538)
<!-- 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, a `fix` included. What counts as
breaking:
https://github.com/cozystack/cozystack/blob/main/docs/agents/contributing.md#what-counts-as-breaking
- 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

The linstor-gui gatekeeper runs oauth2-proxy with the same CSRF cookie
setup that #5536 and #5537 change for the dashboard: one shared
`kc-access_csrf` cookie with a 15-minute lifetime.

Once the session ends, for example after a logout from the dashboard,
every linstor-gui tab that gets reloaded starts its own sign-in and
overwrites the CSRF cookie of the others. Finishing the login in any tab
but the last one ends on a `403 Forbidden` with `CSRF token mismatch,
potential attack` in the log. A login page left open for more than 15
minutes fails the same way with `CSRF cookie ... was not found`,
although Keycloak still accepts it.

The gatekeeper now runs with `--cookie-csrf-per-request=true`,
`--cookie-csrf-per-request-limit=10` and `--cookie-csrf-expire=1h`: one
CSRF cookie per sign-in, a cap on how many can pile up in the request
headers, and a lifetime that outlives Keycloak's 30-minute login
lifespan. The lifetime stays well below `--cookie-expire` (168h),
because a CSRF cookie with an older signature fails validation and the
limit skips it instead of deleting it.

Verified on a test cluster with oauth2-proxy v7.12.0 run on the
chart-rendered gatekeeper arguments against the live Keycloak. With two
tabs signing in after the session ended, the current arguments fail the
first tab with the CSRF mismatch and the new ones sign both in. The
lifetime change was measured on the dashboard gatekeeper, which shares
the mechanism: a login page left open for 16 minutes fails on the
default lifetime and signs in once the cookie outlives the wait (#5537).
The realm used for the test has no `linstor-gui` client, so the run used
another confidential client and left out `--allowed-group`, which
oauth2-proxy checks only after the CSRF state. A helm-unittest case pins
all three flags.
<!-- Uncomment the next line when this PR adds or changes a downstream
patch:
https://github.com/cozystack/cozystack/blob/main/CONTRIBUTING.md#patches-to-other-projects-code
-->
<!-- Upstream: link to the upstream pull request, or to the issue or
thread where the change was raised -->

### Screenshots

No visual change: only the gatekeeper's oauth2-proxy flags 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
fix(linstor-gui): signing in no longer fails with a 403 "CSRF token mismatch" when several linstor-gui tabs sign in at once, or when the Keycloak login page was left open for more than 15 minutes.
```


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

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

## Summary by CodeRabbit

* **Bug Fixes**
* Improved sign-in CSRF cookie handling by limiting concurrent
per-request cookies to 10 and setting them to expire after one hour.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-12-02 23:18:45 +03:00
Aleksei Sviridkin 2f225f8757 fix(dashboard): keep a slow re-login from failing on an expired CSRF cookie (#5537)
<!-- 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, a `fix` included. What counts as
breaking:
https://github.com/cozystack/cozystack/blob/main/docs/agents/contributing.md#what-counts-as-breaking
- 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

After a logout the dashboard lands straight on the Keycloak login page.
If that page stays open for more than 15 minutes before the password is
entered, the callback ends on the oauth2-proxy `403 Forbidden` page and
the gatekeeper logs `unable to obtain CSRF cookie: ... CSRF cookie with
name 'kc-access_<state>_csrf' was not found`.

oauth2-proxy sets the CSRF cookie's `Max-Age` from
`--cookie-csrf-expire` (15m by default), while Keycloak keeps a login
page usable for 30 minutes and then restarts the flow with the original
state. The browser therefore drops the cookie while the login it belongs
to is still alive. The gatekeeper now runs with
`--cookie-csrf-expire=1h`, which outlives Keycloak's 30-minute login
lifespan. In v7.12.0 that value only sets the cookie's `Max-Age`; the
server validates the CSRF cookie signature against `--cookie-expire`
(168h). The lifetime is finite and well below that on purpose: a CSRF
cookie with an older signature fails validation, and the per-request
limit from #5536 skips such cookies instead of deleting them, so a
cookie the browser keeps longer than that (a browser-session cookie in a
browser that restores its session, for one) would pile up in the request
headers.

Verified on a test cluster with the chart-rendered oauth2-proxy v7.12.0
config against the live Keycloak, waiting in real time with no cookie
manipulation: after a logout, a login page left open for 16 minutes
fails with the 403 above on the default lifetime and signs in once the
cookie outlives the wait. At 31 minutes, past Keycloak's own 30-minute
login lifespan, Keycloak shows "Your login attempt timed out" and asks
for the password again, and the login then completes. Those runs used a
cookie without `Max-Age`; the final `1h` value was checked against the
same binary, which sets `Max-Age=3600` on the CSRF cookie. A
helm-unittest case pins the flag and rejects `0`.
<!-- Uncomment the next line when this PR adds or changes a downstream
patch:
https://github.com/cozystack/cozystack/blob/main/CONTRIBUTING.md#patches-to-other-projects-code
-->
<!-- Upstream: link to the upstream pull request, or to the issue or
thread where the change was raised -->

### Screenshots

No visual change: only the gatekeeper's oauth2-proxy flags 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

```


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

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

## Summary by CodeRabbit

* **Bug Fixes**
* CSRF cookies for OIDC sign-in now expire after one hour, while
authentication cookies can remain valid for up to seven days.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-12-02 23:18:40 +03:00
Aleksei Sviridkin 90530e1efb fix(workloadmonitor): read the MetalLB pool from the metallb.io annotation (#5562)
## What this PR does

The WorkloadMonitor controller records a LoadBalancer Service's public
addresses on its `svc-<name>` Workload under the key
`<pool>.ipaddresspool.metallb.io/requests.ipaddresses` (#788, #831). It
takes `<pool>` from the Service annotation
`metallb.universe.tf/ip-allocated-from-pool`.

MetalLB renamed its annotation prefix in v0.14.9: it now writes the pool
to `metallb.io/ip-allocated-from-pool` and keeps the
`metallb.universe.tf` keys only as deprecated *inputs*
(`controller/service.go`, `AnnotationIPAllocateFromPool`). Cozystack has
shipped MetalLB v0.15.2 and later (now v0.16.1) since mid-2025, so the
old key is never set, and every Service Workload has recorded its
addresses under the `default` pool regardless of where they came from. A
Service with no annotations at all got an empty pool name
(`.ipaddresspool.metallb.io/...`).

This reads `metallb.io/ip-allocated-from-pool` first, falls back to the
deprecated key for Services annotated by an older MetalLB, and then to
`default`.

### Why it matters

The pool is the only thing that tells two kinds of public address apart
in usage data. The billing UsageReport turns this resource key into an
`IPAddressHours` line and puts the pool into its metadata
(`ipAddressPool`). With every address reported as `default`:

- a provider who prices or accounts addresses by pool (for example a
general auto-assign pool versus a pool of addresses customers reserve
separately and pay for on their own) cannot tell them apart, and either
bills both at one rate or has to drop IP-hours altogether;
- an address that is already paid for as a reserved address cannot be
excluded from hourly IP billing by its pool, so it is either charged
twice or the pool split has to be done outside Cozystack;
- usage reports and dashboards attribute all public addresses to a pool
that may not exist.

The address count was and stays correct (it comes from
`status.loadBalancer.ingress`); only the pool label was wrong.

Seen on a live cluster with MetalLB v0.16.1: a Service carrying
`metallb.io/ip-allocated-from-pool: <pool>` and no `metallb.universe.tf`
key.

### Test

`TestReconcile_ServiceIPPoolResourceKey`: the current key, the
deprecated key, both (current wins), no annotations, an empty value. `go
test ./internal/controller/` and `go vet` pass.

### Screenshots

N/A — no UI changes.

### Downstream repositories

Walked the trigger map against the diff: the change is inside
`reconcileServiceForMonitor` and a new helper; no API type, CRD, values,
schema, metric name or annotation written by Cozystack 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(workloadmonitor): LoadBalancer Service workloads record their public addresses under the MetalLB pool the address came from again. MetalLB has written the pool to `metallb.io/ip-allocated-from-pool` since v0.14.9, and the controller still read `metallb.universe.tf/ip-allocated-from-pool`, so every address was reported under the `default` pool.
```


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

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

## Summary by CodeRabbit

* **Bug Fixes**
* LoadBalancer workloads now report the allocated MetalLB IP pool when
it is specified using either the current or legacy annotation. When both
are present, the current annotation takes precedence. If neither
provides a usable value, the pool is reported as `default`.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-12-02 22:55:25 +03:00
Andrei Kvapil c0c0ce65ca feat(platform): keep existing bucket keys through the conversion
A BucketAccess's keys are bound to its UID, so letting Helm delete the
BucketAccess the converted chart no longer renders would revoke every
existing user's keys. Migration 71 runs before any chart changes version
and marks each tenant BucketAccess the bucket chart rendered with
helm.sh/resource-policy=keep, which Helm reads off the live object, and
with the adoption label cozystack-controller looks for, so clients keep
working until the first mint. It also marks the backup bucket's system
user platform, so that bucket keeps its readable Secret whichever chart
is upgraded first.

The old chart wrote a tenant user's accessKey and secretKey through
stringData, so the manifest Helm diffs against never named them in data
and the upgrade to the converted bucket-system chart would keep them:
tenants could read working keys until the first mint. The migration
removes the two keys from each tenant user's Secret before the chart
switch, checking for them without reading the values, and leaves a
platform user's Secret alone.

It applies the baked CredentialTemplate CRD first, as migration 64 does.
A cluster that ran 64 in an earlier release keeps the CRD without
spec.bucketAccess until cozystack-controller upgrades, which can be
after the bucket releases switch; the API server would prune the field
and the controller would skip the template for good.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2026-12-02 20:38:26 +01:00
Andrei Kvapil b089c8bee6 refactor(platform): share the CredentialTemplate CRD apply
The bucket conversion adds fields to the CredentialTemplate CRD, so its
migration has to apply the baked CRD for the same reason migration 64
does: cozystack-controller can upgrade after the tenant charts switch.
Move 64's apply, label, annotate and wait into a lib helper, the way
the version stamp is shared, so both run the identical sequence and a
later fix reaches both.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2026-12-02 20:38:26 +01:00
Andrei Kvapil d2bd291a10 feat(bucket)!: issue tenant user keys through platform credentials
Tenants read every user's S3 keys in plain text from the per-user
credentials Secret, and the only way to rotate them was to delete the
BucketAccess and force two Helm upgrades. The chart now renders a
CredentialTemplate per tenant user that names the BucketAccess, in the
plaintext format, instead of rendering the BucketAccess itself, so
cozystack-controller owns the grant, a mint re-creates it and a revoke
deletes it; the keys are shown once, by the mint. The per-user Secret of
a tenant user keeps only the endpoint and bucket name. It is rendered as
data rather than stringData: Helm's three-way merge removes a live key
only when the previous manifest named it, and a stringData key never
shows up in data, so a key the chart stops emitting would otherwise
stay.

A tenant user's BucketAccess keeps the name the chart gave it, which
the conversion hands over by name; a user name that is not a valid
object name never had one and takes the account name instead. A user
whose account name is longer than 63 characters is refused at render,
as credentials-migrate refuses it.

A user marked platform, which backupstrategy-controller now sets on the
backup bucket's system user, keeps its chart-rendered BucketAccess and
its keys in a Secret no tenant role selects or grants, so default
backups keep reading it; its keys are never minted. Clearing the flag
drops that BucketAccess, which revokes those keys, and the user becomes
a normal account whose keys are minted. values.yaml documents both.

BREAKING CHANGE: clients that read accessKey and secretKey from
<bucket>-<user>-credentials must mint the user's credential instead;
every mint rotates both keys.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2026-12-02 20:38:26 +01:00
Andrei Kvapil 0f97ae304a feat(api): mint engine-issued credentials by waiting for the new grant
The keys of an engine-issued account, one whose template names a
BucketAccess, come from a COSI grant the API cannot make, so a mint
writes the account Secret without keys and with a request id, waits a
bounded time for cozystack-controller to store the keys of a new grant
marked with that id, and returns them once together with the access key.
A revoke waits the same way for the controller to mark the Secret once
the old grant is gone, and returns nothing. A wait that runs out answers
a retryable timeout and shows nothing, so the same keys are never
disclosed twice. Both operations are refused while a BucketAccess the
controller did not create holds the template's name, since the
controller could serve neither. The wait is set by
--credentials-cosi-wait.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2026-12-02 20:38:26 +01:00
Andrei Kvapil 1c4f433fec feat(controller): re-create the BucketAccess of an engine-issued account
The COSI driver issues a Bucket user's keys and never accepts chosen
ones, so the password reconciler cannot seed such an account. A separate
reconciler creates and owns the BucketAccess a template names, adopts
the one the conversion marked so existing keys survive, and copies the
keys of the live grant into the account Secret. A mint or a revoke
reaches it as a request id on that Secret: a BucketAccess created for an
older request is deleted, which makes the sidecar revoke its identity. A
mint gets a new BucketAccess; a revoke gets none, so it locks the
account out until the next mint.

A changed readonly flag or storage pool gives the template another
BucketAccess class. The controller records that as a revoke of its own:
the account Secret loses its keys and gets a request id and a Revoke
entry by the controller, so the revoke path deletes the old grant,
creates none, and the next mint is granted under the new class.
Re-granting at once would leave keys nobody was shown under a record
that says the last mint issued the live ones. A mint the Secret already
carries is served under the new class instead.

The sidecar has the driver grant an identity before it puts its
finalizer on the BucketAccess, so a BucketAccess is deleted only once it
carries that finalizer, or once the sidecar can no longer grant it, its
class or claim gone or the bucket not ready: a delete in between would
skip the driver revoke and leave a working identity behind. A finalizer
on the template holds a deleted one until then, so a user removed inside
the grant window does not orphan its identity at the provider. The
template's status mirrors the account Secret while a request is pending,
so a request that never completes does not turn every later one into a
conflict, and a lost account Secret is rewritten from the live grant
instead of rotating keys under its clients. Lost after a revoke, it is
written again as revoked from that status, so it does not take the
create path and re-grant keys nobody minted. The password reconciler
skips templates that name a BucketAccess and is otherwise unchanged. The
account Secret names its BucketAccess in an annotation, which is how the
controller tells an engine-issued account Secret from the others.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2026-12-02 20:38:26 +01:00
Andrei Kvapil 08cb839283 feat(api): describe engine-issued keys on CredentialTemplate
A Bucket user's keys come from the COSI driver, which accepts no
caller-chosen secret, so the platform cannot choose them the way it
chooses a password. The optional bucketAccess field lets a template name
the BucketAccess whose grant issues the keys, which makes the account
engine-issued whatever its format. The keys are stored as they are
issued, so a CEL rule requires the plaintext format on such a template;
a format name of its own would say who issues the secret, which
bucketAccess already says, and would stop format meaning only how a
password is stored. A mint can return the access key that goes with the
secret key through one optional field on CredentialRequestStatus.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2026-12-02 20:38:26 +01:00
Andrei Kvapil 94807d93f3 feat(platform): migrate Redis and Valkey passwords to minted credentials
The converted charts stop rendering <release>-auth and point the
operator at the account Secret of the default credential. Without a
migration that Secret would be seeded with a new random password, and
every existing client, and the running servers, would lose the one they
have.

Migrations 69 (Redis) and 70 (Valkey) seed that Secret from the password
in <release>-auth before the charts switch, so the operator finds the
same password under the new name; then a finish Job per kind deletes
whatever is left of the old Secret. Each Job's ClusterRole,
ServiceAccount and binding are named for its migration, so the two
conversions in one upgrade share none.

Both hold every release of their kind, suspended, until the
redis-operator Deployment runs its new revision, and the finish Jobs,
which may read Deployments, resume them. The new chart changes the pod
template, and the old operator rolls such a change by deleting the
master, which failed client writes for up to 78 s per instance on a test
cluster before the new operator, which moves the master off first and
applies the password without a restart, had started.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2026-12-02 20:38:26 +01:00
Andrei Kvapil 5f9d6b9a87 feat(credentials-migrate): convert a kind with fixed accounts
Redis and Valkey have no accounts map: one default user exists while
authEnabled is on, and its password sits under the single key password
of <release>-auth. The conversion read accounts only from the keys of a
values map.

--fixed-account names the users such a chart always renders, and
--enabled-flag the boolean that switches them off; unset counts as
true, the chart default, and a non-boolean leaves the release out
rather than guess what the chart renders. The password key comes from
the existing --source-key, which already covers a source not keyed by
user name, rather than from a flag of its own.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2026-12-02 20:38:26 +01:00
Andrei Kvapil 3c0a113c14 feat(valkey)!: issue the password through the credentials API
Valkey runs on the same operator as Redis and had the same chart-made
password in a tenant-readable <release>-auth. The chart now renders a
CredentialTemplate for the default account while authEnabled is on and
points the operator at that account's Secret. As for Redis, the operator
keeps replication, the Sentinels and the exporter on its internal
account, so a mint reaches only the default user and applies with no
restart, and the ResourceDefinition excludes the internal account's
Secret.

BREAKING CHANGE: <release>-auth is no longer rendered or readable;
clients get the password by minting the default credential.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2026-12-02 20:38:25 +01:00
Andrei Kvapil 0999d9cfd2 feat(redis)!: issue the password through the credentials API
The chart generated the password of the default user itself, kept it
readable by the tenant in <release>-auth, and shared it with
replication, the Sentinels, the exporter and backups. It now renders a
CredentialTemplate for the default account while authEnabled is on, and
points the operator at that account's Secret, which the platform seeds
and rewrites on a mint and which the tenant cannot read.

The operator keeps replication, the Sentinels, the probes and the
exporter on an internal account of its own, so the minted password
reaches only the servers' default user and the backup Job, which is why
the backup strategy reads the same Secret, and a mint restarts no pod.
The ResourceDefinition no longer selects <release>-auth and excludes the
internal account's Secret, which carries an ownerReference to the
RedisFailover, so the tenant-visible set holds the trust anchor alone.
The e2e mint step fails if a mint restarts a pod or moves the master.

BREAKING CHANGE: <release>-auth is no longer rendered or readable;
clients get the password by minting the default credential.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2026-12-02 20:38:25 +01:00
Andrei Kvapil 8346e98d24 feat(redis-operator): apply a minted password without a restart
The operator reads the auth Secret on every reconcile but applies the
password only through redis.conf, which a server reads at start, and
everything it runs authenticated with that client password. A changed
Secret therefore moved the operator, the Sentinels and any restarted pod
onto the new password while every running server still required the old
one, and rolling the pods to fix that deleted the master: about 30 s of
failed writes per mint on Redis and Valkey alike. Platform-minted
credentials rewrite that Secret, so a mint has to be cheap.

Replication, the Sentinels, the probes and the shutdown hook
authenticate as an internal ACL user, rf-internal, and the exporter as a
user of its own, rf-exporter, both kept in the operator's own Secret.
The auth Secret's password belongs to the default user alone, so a mint
applies it on every running server: no restart and no failover. An
existing RedisFailover gets both users live on every server and Sentinel
before its ConfigMap and pod template switch to them, which rolls its
pods once.

The client password can read masterauth with CONFIG GET, so rf-internal
has two passwords. The pod password, which the probes and the shutdown
hook read from their environment at start, is on the servers only as a
SHA-256 hash in the ACL, never appears in CONFIG, and stays fixed, since
changing it would restart those containers. The link password, which
masterauth and the Sentinels' auth-pass carry, is rotated on every
change of the client password. The stages keep the old link password
valid until no server, replica or Sentinel uses it, and the ConfigMap
records the new client password only after that, so a completed revoke
leaves the old link password valid nowhere. Each stage reads before it
writes and the Secret records progress, so a pass that stops anywhere is
finished by the next one. rf-internal may run only what replication, the
Sentinels, the probes and the shutdown hook send, on the Sentinels'
hello channel alone, and has no CONFIG GET; rf-exporter may run only
what redis_exporter sends.

CONFIG SET requirepass alone would leave every connection that
authenticated with the old password open, and the default user may run
CONFIG GET requirepass, so a holder of a leaked password could keep one
connection across a mint or revoke and read the new password from it. A
client password change is therefore one MULTI/EXEC per server: reset the
operator's users, delete any other user, set requirepass, and kill every
connection of the default and exporter users. No connection made with
the old password, or with a password its holder added to an operator
user, sees the new one. Replication and Sentinel links and the liveness
probe stay up. A server is changed only while it still takes the old
password, so a pass that stops halfway resumes on the servers left.

A connection that needs no new password can still outlive a revoke: a
replication stream opened as rf-internal with the link password read
from masterauth, or a MONITOR, which ACL checks only when it starts. The
link rotation therefore ends, before it is recorded as done, by killing
every MONITOR and every operator-user connection from an address that is
no pod of the RedisFailover and not loopback.

For the roll that switches an existing RedisFailover, and any other, the
operator moves the master role off a stale master with SENTINEL FAILOVER
and relabels the pods before rolling it as a replica, so writes stop
only for the failover rather than until the Sentinels notice a deleted
master. The roll reports a moved master and the pass ends there, so the
next pass starts from the new master instead of pointing the Sentinels
back at the old one. When a quorum of Sentinels names one of two
masters, the other becomes its replica; with no quorum the operator asks
for a manual fix.

The tenant's default user can run ACL, CONFIG and, on the
unauthenticated Sentinels, SENTINEL SET, so the operator does not trust
its own setup to stay. Every pass reads the operator's users with ACL
GETUSER and resets one that is missing, disabled, has another password,
other rules or an extra selector, checks masteruser/masterauth with
CONFIG GET, and re-sends a Sentinel's auth-user/auth-pass when CLIENT
LIST shows it connected as another user, since SENTINEL SET cannot be
read back. Between passes a guard checks the internal user on every
server every 2 s from what the last pass left in memory, with no API
call, and resets it and every Sentinel's auth where it differs, well
before a tenant's ACL DELUSER rf-internal on the master would make the
Sentinels fail it over, about 9 s later.

Every rotation and every guard run also deletes any ACL user but
default, rf-internal, rf-exporter and the liveness probe's pinger, which
disconnects clients authenticated as them, since such a user would keep
a tenant in after a revoke. Nothing a tenant changes outlives a restart,
because redis reads redis.conf from the read-only ConfigMap volume and
no aclfile is configured. Every mint and revoke disconnects the tenant's
clients. The redis-tls e2e reads INFO replication as REDIS_USER, since
the redis container's REDIS_PASSWORD is now rf-internal's.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2026-12-02 20:38:09 +01:00
Andrei Kvapil acb5310526 feat(platform): migrate RabbitMQ users to minted credentials
Migration 68 writes the account Secret of every existing RabbitMQ user
from the per-user Secret the old chart generated, before the chart
switches, so clients keep their passwords through the upgrade and the
CredentialTemplate controller adopts the Secrets afterwards. The finish
Job strips leftover users.<name>.password values, deletes a per-user
Secret Helm did not prune, and labels the operator's -default-user
Secret not tenant-visible once the converted definition excludes it,
which removing it from the definition alone does not do for a Secret the
lineage webhook already stamped.

The Job's ServiceAccount, ClusterRole and binding carry the migration
number: migration 64 deletes and re-owns a ServiceAccount with a shared
name, which would cut off a finish Job of another conversion running in
the same upgrade. The role adds list on Secrets for the per-user sources
and list on ApplicationDefinitions for the visibility check.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2026-12-02 20:38:09 +01:00
Andrei Kvapil 6b7694a3ef feat(credentials-migrate): read per-account sources and hide Secrets
Some charts keep one generated Secret per account, holding username and
password, instead of one Secret keyed by username. RabbitMQ does, under
names derived with sprig's kebabcase. --source-selector finds those
Secrets by label and by the Helm release that rendered them, so the CLI
does not re-implement the chart's name mapping, and retires them once
the chart has switched. It is the second way to locate the per-account
sources --source-per-account finds by name, so it shares --source-key
for the password key and the same retire path, and the two are mutually
exclusive.

A platform account can also live in a Secret no chart renders, such as
the -default-user Secret the RabbitMQ cluster operator creates. The
lineage webhook stamped its visibility at admission, so dropping it from
the ApplicationDefinition does not hide it. --hide-secret-suffix labels
it not tenant-visible in finish, but only once the definition in the API
excludes it, and waits for that within the Job's timeout. An operator's
rewrite replaces the Secret's labels, and the webhook then stamps it
from the definition it sees; the cluster operator's first pass after an
upgrade rewrites it before rabbitmq-rd upgrades, so a label written
earlier would be undone and the administrator's Secret readable again.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2026-12-02 20:38:09 +01:00
Andrei Kvapil b9652c4faa feat(lineage-webhook): tell whether a definition shows a Secret
The webhook decides a Secret's tenant visibility from the owning
ApplicationDefinition on every write that drops the lineage labels, as
an operator's rewrite does. A conversion that hides an operator Secret
has to know whether the definition in the API already excludes it,
because a label it writes earlier is undone by the next rewrite.

SecretTenantVisible evaluates a definition exactly as the webhook does.
The tests also load the converted RabbitMQ, MongoDB, MariaDB and
ClickHouse definitions and pin that each one hides the platform Secrets
its conversion keeps, as an operator rewrite would present them.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2026-12-02 20:38:09 +01:00
Andrei Kvapil a4397fda90 feat(rabbitmq)!: render a CredentialTemplate per user
RabbitMQ passwords were generated at render time, kept with lookup and
stored in a per-user Secret that every tenant tier could read, next to
the operator's administrator in -default-user. The chart now renders a
CredentialTemplate per user and points each User's
importCredentialsSecret at the account Secret the credentials API mints
into. messaging-topology-operator 1.20.2 watches that Secret and puts
the password to the broker again on every change, so a mint applies
without a Helm run.

The operator hashes the password itself, so the account Secret holds
the plaintext, as the design's wave 2 does; no tenant role reads it.
The User objects keep their names, since a rename would make the
operator delete and recreate the broker user.

-default-user is a platform account: the ApplicationDefinition stops
selecting it and excludes it instead. Tenants lose the administrator
login and the per-user Secrets; users.<name>.password is no longer read,
and a value left there draws an admission warning that points at a mint
on the user's Credential. A user whose account name is longer than 63
characters, does not start and end with a letter or a digit, or is
shared with another user is refused at render.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2026-12-02 20:38:08 +01:00
Andrei Kvapil 1791336e04 feat(mongodb)!: mint tenant passwords through the credentials API (#5380)
## What this PR does

MongoDB passwords are no longer readable from the per-user
`<release>-user-<name>` Secrets, and tenants lose the `databaseAdmin`
login from `<release>-credentials`. Every tenant tier can read both
today. An administrator mints a password on the user's `Credential` and
sees it once, the operator applies it live, and the next mint or a
revoke kills it. MongoDB computes SCRAM itself, so the account Secret
keeps the plaintext, readable only by the platform. A user removed from
`users` is now also dropped from the database. This is the MongoDB part
of the user secrets API design (cozystack/community#137).

Stacked on #5379. Review only the top three commits:

- `credentials-migrate` gets `--source-key` and `--source-per-account`,
to read one source Secret per user.
- The chart renders a `plaintext` CredentialTemplate per user, points
`passwordSecretRef` at its account Secret and hides
`<release>-credentials` from tenants. Every declared user holds an empty
marker role, and a post-upgrade hook drops users that hold it but are no
longer declared, since the Percona operator never drops a user removed
from `spec.users`.
- Migration 67 seeds the account Secrets from the per-user Secrets
before the chart switches. Its finish Job deletes the per-user Secrets
Helm left behind.

Tested on a three-node cluster, fresh install: a minted password logs in
after 3 s, the old one fails 3 s after the next mint, revoke works, no
pod restarts. That run showed a removed user staying in the database,
which the last commit fixes. Full upgrade from 1.7.1 on the same
cluster, all engines at once with a client loop each: migrations 64-71
ran in order and every account was adopted with its old password. The
MongoDB loop had one server-selection timeout during the platform roll
and no authentication error. After the upgrade, a removed user is gone
from `admin.system.users`.

Breaking for users: tenants lose `databaseAdmin`, their only admin login
today. Passwords can't be read any more. A user name that collides with
a system user, maps to an invalid account name (such as `_backup`), is
longer than 63 characters, or maps to the same account as another name
(`a.b` and `a-b`) now fails the render. A user removed from `users` is
dropped on the next upgrade.

Open questions:

1. Should the conversion rotate `databaseAdmin`? Tenants could read it.
2. Without `databaseAdmin`, no tenant user can manage users or the
cluster. Add a per-database admin role, or leave it like that?
3. The drop hook fails the upgrade if there's no writable primary within
5 minutes, on purpose. Is that the right trade?

### Screenshots

No UI change.

### Downstream repositories

- [ ] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up: needed, a MongoDB note for the credentials API docs
(cozystack/website#753) and an upgrade note that tenants lose
`databaseAdmin`
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up: needed, `cozystack_mongodb` still sends
`users.<name>.password`
- [ ]
[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: needed, the MongoDB row in the design, and the
`databaseAdmin` row once question 1 is decided

### Release note

```release-note
feat(mongodb)!: MongoDB passwords are issued through the credentials API. The per-user `<release>-user-<name>` Secrets are removed, `users.<name>.password` is ignored, and tenants can no longer read `databaseAdmin`. An administrator mints a password on the user's Credential; it is shown once and applies within seconds without a restart. A user removed from `users` is now dropped from MongoDB. Existing passwords keep working through the upgrade. Clients that log in as `databaseAdmin` must move to a declared user, and user names that collide with a system user must be renamed before upgrading.
```


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

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

## Summary by CodeRabbit

* **New Features**
* MongoDB user passwords are now managed through platform account
credentials, with one-time issuance and revocation. Password values in
app configuration are ignored, and reserved MongoDB system-user names
are rejected.
  * Obsolete chart-managed MongoDB users are removed during upgrades.
* Migration support transfers existing MongoDB passwords to
platform-managed account credentials.

* **Bug Fixes**
* MongoDB credential Secrets are excluded from tenant access and
enumeration.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-12-02 11:45:53 -05:00
Alexey Artamonov cabbb8faf0 fix(linstor-gui): keep concurrent and slow sign-ins from failing on CSRF
The linstor-gui gatekeeper runs oauth2-proxy with the same single,
15-minute CSRF cookie the dashboard had. Once the session ends, for
example after a logout from the dashboard, every linstor-gui tab that
is reloaded starts its own sign-in and overwrites the cookie of the
others, so finishing the login in any tab but the last one fails with
a 403 and "CSRF token mismatch, potential attack"; a login page left
open for more than 15 minutes fails the same way with "CSRF cookie
... was not found", although Keycloak still accepts it.

Give each sign-in its own CSRF cookie, cap how many can pile up in the
request headers, and keep them for 1h instead of 15 minutes, which
outlives Keycloak's 30-minute login lifespan. The lifetime stays
finite and well inside --cookie-expire (168h): an older CSRF cookie
fails signature validation and the per-request limit skips it instead
of deleting it, so a longer-lived cookie would accumulate.

Tested by running oauth2-proxy v7.12.0 with the chart-rendered
gatekeeper arguments against a live Keycloak: with two tabs signing in
after the session ended, the current arguments fail the first tab
with the CSRF mismatch and the new ones sign both in.

Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
2026-12-02 16:11:15 +03:00
Alexey Artamonov 777721f5f7 fix(dashboard): keep a slow re-login from failing on an expired CSRF cookie
After a logout the console lands straight on the Keycloak login page.
If that page stays open for more than 15 minutes before the password
is entered, the callback fails with a 403 and the gatekeeper logs

  unable to obtain CSRF cookie: ... CSRF cookie with name
  'kc-access_<state>_csrf' was not found

oauth2-proxy gives the CSRF cookie a fixed Max-Age of
--cookie-csrf-expire (15m by default), while Keycloak keeps a login
page usable for 30 minutes and then restarts the flow with the
original state, so the browser drops the cookie while the login it
belongs to is still alive.

The lifetime becomes 1h, which outlives Keycloak's login lifespan. It
stays finite and well below --cookie-expire (168h) on purpose: a CSRF
cookie with an older signature fails validation, and the per-request
limit skips such cookies instead of deleting them, so a cookie the
browser keeps longer than that would stay in the request headers.

Tested by running the chart-rendered oauth2-proxy v7.12.0 config
against a live Keycloak, waiting in real time: after a logout, a login
page left open for 16 minutes fails with the 403 above on the default
lifetime and signs in once the cookie outlives the wait; at 31 minutes
Keycloak asks for the password again and the login then completes.
The same binary sets Max-Age=3600 on the CSRF cookie with this flag.

Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
2026-12-02 16:10:53 +03:00
Aleksei Sviridkin 06c2be9745 fix(platform): stop handing tenants a root S3 the root tenant does not run (#5097)
## What this PR does

`cozystack-basics` writes `seaweedfs: tenant-root` into the
`cozystack-values` Secret of the root tenant unconditionally, so every
tenant without its own SeaweedFS inherits `tenant-root` as its S3, even
when `Tenant/root` has `spec.seaweedfs: false`. On a v1.6.5 cluster
whose root tenant runs no SeaweedFS, a tenant created a Bucket, its
BucketClaim asked for bucket class `tenant-root`, and the objectstorage
controller logged `bucketclasses.objectstorage.k8s.io "tenant-root" not
found` 8796 times over three days while the app stayed Ready. #5096
makes that state visible in WorkloadsReady, this PR removes its cause.

The new platform value `seaweedfs.rootEnabled` reaches cozystack-basics
as `_cluster.seaweedfs-enabled`, the same way `monitoring.rootEnabled`
reaches it as `_cluster.monitoring-enabled` for #3181, and
`_namespace.seaweedfs: tenant-root` is written only when it is true. The
default `true` keeps today's behaviour. The slim variants, which do not
install SeaweedFS for the root tenant, set it to `false` next to
`monitoring.rootEnabled`. Without S3 up the tenant chain the bucket and
harbor charts now fail to render with a message that names the problem,
instead of creating a claim for a class that never appears. A lookup of
the live Tenant is not used, for the reason
`monitoring-external-services.yaml` gives for the monitoring gate.

An existing Bucket or Harbor in a tenant without S3 up its chain fails
its next upgrade with that message once the flag is false. Its
BucketClaim was never provisioned, so nothing that worked stops working.

The platform tests cover propagation of seaweedfs.rootEnabled. Rendering
the root Secret with a missing flag keeps S3 enabled for older
installations. For a present key, only true or the string "true" enables
it. The bucket and harbor tests also cover the error when the tenant has
no S3. All 546 Helm tests across the four charts passed locally.

### Screenshots

Not a UI change.

### Downstream repositories

`packages/core/platform/values.yaml` gains `seaweedfs.rootEnabled`,
which the trigger map routes to `platform-package.md` on the website.
The variants page lists what the slim variants need for SeaweedFS, so it
gets the same note as monitoring. No app schema, values default or other
contract changes.

- [ ] No downstream repository is affected by this change
- [x] [cozystack/website](https://github.com/cozystack/website) -
follow-up: https://github.com/cozystack/website/pull/774
- [ ]
[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): new platform value seaweedfs.rootEnabled. Set it to false when the root tenant runs no SeaweedFS, so tenants stop inheriting tenant-root as their S3 and a Bucket or Harbor without S3 up its tenant chain fails to render with a clear message instead of waiting on a bucket class that does not exist. The slim variants set it to false, so a slim cluster that runs SeaweedFS on Tenant/root must set seaweedfs.rootEnabled: true before the upgrade, or its Buckets and Harbors stop rendering.
```


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

## Summary by CodeRabbit

* **New Features**
* Added a setting to control whether the root tenant provides SeaweedFS
for S3. It is enabled by default and disabled in slim ISP
configurations.
* Tenant configuration now includes SeaweedFS when root provision is
enabled or the setting is unspecified, and omits it when disabled.
* **Bug Fixes**
* Bucket and Harbor deployments now report a clear error when neither
the tenant nor an ancestor provides SeaweedFS, rather than rendering an
unusable S3 bucket claim.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-12-02 15:46:00 +03:00
Andrei Kvapil 69f5d07c1d feat(mariadb)!: mint tenant passwords through the credentials API (#5379)
## What this PR does

MariaDB passwords are no longer readable from `<release>-credentials`,
which every `use` member and every parent tenant can read today. An
administrator mints a password on the user's `Credential` and sees it
once. The database stores only its `mysql_native_password` hash, and the
next mint or a revoke kills it within seconds. `root` stays the
platform's account and is hidden from tenants. This is the MariaDB part
of the user secrets API design (cozystack/community#137).

Stacked on #5378. Review only the top three commits:

- `credentials-migrate` gets `--skip-account`, so no account is written
for `users.root`, which the chart always ignored.
- The chart renders a `mysql-native` CredentialTemplate per user and
points each `User` at its account Secret through
`passwordHashSecretKeyRef`.
- Migration 66 writes the hashed account Secrets before the chart
switches. Its finish Job removes the tenant keys from
`<release>-credentials` and keeps `root`.

Tested on a three-node cluster, fresh install: a minted password logs in
after 3 s, the old one gets `Access denied` 3 s after the next mint,
revoke works, and removing a user drops the `mysql.user` row too. Full
upgrade from 1.7.1 on the same cluster, all engines at once with a
client loop each: migrations 64-71 ran in order and every account was
adopted with its old password. The MariaDB client loop had no failures.

Breaking for users: passwords can't be read any more. A user name longer
than 63 characters, one that starts or ends with a character other than
a letter or digit (such as `_backup`), or two names that map to one
account (`a.b` and `a-b`), now fail the render; such a release is not
converted. A password changed inside MariaDB is reverted by the
operator.

Open questions:

1. `root` is not rotated, although the design says it should be. The
operator reads it on every reconcile and the pods take it as
`MARIADB_ROOT_PASSWORD` for their probes, so changing it needs a
coordinated restart. So the `root` password tenants could read stays
valid. Accept that and fix the design, or rotate it before merge?
2. Not from this diff: the backup CronJob reads `root-password` from a
Secret `<release>` that doesn't exist. It needs a separate fix.

### Screenshots

No UI change.

### Downstream repositories

- [ ] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up: needed, a MariaDB note for the credentials API docs
(cozystack/website#753), an upgrade note, and `backup-classes.md` still
points at credentials in `<release>-credentials`
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up: needed, `mariadb_schema.go` tells users the password is in
`mariadb-<name>-credentials`
- [ ]
[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: needed only if `root` stays unrotated, to fix the design

### Release note

```release-note
feat(mariadb)!: MariaDB passwords are issued through the credentials API and are no longer readable from `<release>-credentials`. An administrator mints a password on the user's Credential; it is shown once and applies within seconds. `root` is no longer visible to tenants. Existing passwords keep working through the upgrade. A user name longer than 63 characters, one that starts or ends with a character other than a letter or digit (such as `_backup`), or two names that map to one account name (such as `a.b` and `a-b`), now fail the render and keep the release unconverted until renamed. Switch clients to minted passwords after the upgrade.
```


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

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

## Summary by CodeRabbit

* **New Features**
* MariaDB tenant accounts now use individually issued credentials.
Passwords are returned when minted, while only password hashes are
stored; credentials can be rotated or revoked through the credentials
API.
* Existing MariaDB accounts are migrated to the new credential system.
The platform-managed `root` account remains separate from tenant
accounts.
* **Bug Fixes**
* Tenant-supplied `password` values and `root` entries are ignored, with
admission warnings for supplied passwords. Password changes made
directly in MariaDB are reverted during reconciliation.
  * Tenant access to MariaDB credentials Secrets is restricted.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-12-02 07:18:24 -05:00
Andrey Kolkov 6729dd8cfe fix(workloadmonitor): read the MetalLB pool from the metallb.io annotation
MetalLB writes the pool a Service's address came from to
metallb.io/ip-allocated-from-pool since v0.14.9; the
metallb.universe.tf key is only read on input now. The controller still
looked for the old key, so every Service Workload has recorded its
addresses under the "default" pool since MetalLB was updated to v0.15.2,
and a Service without annotations got an empty pool name.

Read the current key first and fall back to the deprecated one, then to
"default".

Assisted-by: LLM
Signed-off-by: Andrey Kolkov <androndo@gmail.com>
2026-12-02 17:30:58 +07:00
Marian Koreniuk ceb2063f34 ci: widen the docs-only gate to Markdown, images and repository metadata
The PR pipeline skipped build, Talos and E2E only when every changed path
was under docs/. A pull request that touched README.md, GOVERNANCE.md, an
issue template or LICENSE still built every image, booted a sandbox and
ran the suite, for files nothing in that pipeline reads.

Move the classifier into hack/code-changed.sh, the one source of truth for
both lanes: the in-tree `plan` job feeds it the --no-renames merge diff and
the fork `resolve` job feeds it the base-repo PR file list (filename and
previous_filename, so a packages/… -> docs/… rename still reads as code).
Non-code is the docs/ tree, Markdown outside packages/, img/, LICENSE and
the GitHub and review-bot metadata.

Markdown under packages/ stays code: Go controller tests read chart
READMEs. TestDocs_StateTheTimingsTheBinaryAndTheChartUse checks
packages/system/flux-plunger/README.md and runs only under
make test-controllers, i.e. only when hack/code-changed.sh prints true, so
a README-only PR there would skip the test and turn the next code PR on
main red. The classifier uses awk rather than grep to express that
exception. Other chart READMEs are generated by `make generate`, which
pre-commit re-runs, and contract-tested by hack/*.bats, which the `checks`
job still runs for every path except the two CI-only tools.

The push triggers of build-main, build-release and CodeQL mirror the
classifier so a docs-only merge no longer rebuilds main. They use a
`paths` filter (`**`, one `!` glob per non-code path, then `packages/**.md`)
because only `paths` documents re-including after a negation.
hack/code-changed_test.bats checks that the three filters are equal, that
every `!` glob is non-code, that every re-include is code, and that
CodeQL's pull_request trigger carries no path filter at all: it is a
required check on main.

Over the 200 merged PRs returned by `gh pr list --state merged --limit
200` on 2026-11-18 the gate on main (docs/ plus the two CI-only tools)
skipped 8, the new one 10 (#5168 and #5188 are newly skipped).

Assisted-by: LLM
Signed-off-by: Marian Koreniuk <moriarti@cp.if.ua>
2026-12-02 10:53:49 +01:00
Aleksei Sviridkin 236d039ae3 docs(agents): require an upstream reference for downstream patches (#5437)
<!-- 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 patch this repository carries on top of someone else's code (an image
source patch, a vendored chart patch, a fork pin, a carried backport) is
meant to live only until the same change lands upstream. Nothing written
down asks for that link today, so whether a patch was ever offered
upstream, and when it can be dropped, depends on whoever wrote it.
Existing patch headers provide examples of upstream references and drop
conditions.

The rule is written once, in a new "Patches to other projects' code"
section of `CONTRIBUTING.md`: a PR that adds or changes a downstream
patch links the upstream pull request or submission, or at least the
issue or thread where it was raised; the patch header carries the link
next to its drop condition; a patch with no upstream counterpart says
why in the PR. The other places point to it rather than restating it:

- `AGENTS.md` gets a working principle that links the section and adds
what only agents need: an agent prepares the upstream change and its
text but does not open a pull request, issue or thread in another
project without explicit approval for that submission.
- The PR checklist in `docs/agents/contributing.md` gets one line
linking the section.
- The PR template gets a commented-out `Upstream:` field under "What
this PR does", with a one-line note to uncomment it when the PR touches
a downstream patch.

I checked what reads the PR body or the template: `pr-labeler.yaml`
reads only the title and a `BREAKING CHANGE:` footer, and
`hack/downstream-trigger-map.bats` reads only the `- [ ]
[cozystack/...]` checklist lines. A commented field reaches neither.
`hack/downstream-trigger-map.bats`, `hack/md-no-hardwrap.bats` and
`hack/label-workflows-contract.bats` pass.

### Screenshots

<!-- REQUIRED for UI changes: attach screenshots or screen recordings
demonstrating
the visual impact of your changes. PRs with UI changes without
screenshots will not be merged. -->

Not a UI change.

### Downstream repositories

<!--
Cozystack is upstream for repositories that are NOT kept in sync with it
automatically, and nothing in CI compares the two sides, so a change
here can break them silently.

Which change forces what, and which file to touch, is the trigger map in
docs/agents/contributing.md under "Downstream Repositories". Walk it
before you tick anything.

IF YOU ARE AN AI AGENT OR AN LLM, THIS IS PART OF THE TASK, NOT A FORM
TO FILL IN:

1. Walk the trigger map against the actual diff of this PR, file by
file. Do not decide from the PR title or from your memory of what you
changed.
2. For every repository you tick, open the follow-up PR there and link
it on the same line. A ticked box with no link claims work that does not
exist, which is worse than an empty box. Search that repository for an
open PR or issue covering it first, and link that instead of filing a
duplicate.
3. When the follow-up is out of scope, or needs a decision that is not
yours to make, open an issue in that repository instead, link that, and
say so in the PR body. Do not push a speculative PR into another
repository just to fill a line here.
4. Do not tick "No downstream repository is affected" to make the
checklist go away. If you are unsure, leave every box empty and say so
in the PR body, so a human decides.
-->

I left every box empty for a maintainer to decide. The trigger map lists
a PR template change under `cozystack/community`: its
`contributors/README.md` "Open the pull request" section restates the
required parts of the template. The new field is commented out and
optional, so that section stays correct, but the onboarding guide may
also want the new rule itself.

- [ ] 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
docs(agents): a pull request that adds or changes a downstream patch now links the same change offered upstream, or says why there is none.
```


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

## Summary by CodeRabbit

* **Documentation**
* Added guidance requiring downstream patches to link to the related
upstream submission or discussion, or explain why no counterpart exists.
* Clarified that upstream submissions require explicit user approval;
without approval, prepare the change and submission text and ask first.
* Updated the pull request template and checklist to prompt for upstream
links or an explanation when none exists.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-12-02 12:46:39 +03:00
Aleksei Sviridkin 137b68f07a test(hack): skip request-timeout calls that name a kubeconfig or context (#5406)
## What this PR does

`hack/check-hook-request-timeout.bats` exempts a file only when it names
`KUBECONFIG`. A hook script under `files/` that gets `KUBECONFIG` from
its template's env has no reason to name it, so a call that goes through
that kubeconfig with `--context` is flagged as an in-cluster call. That
is what turned `capi-providers-core/files/upgrade-providers.sh` red on
main; #5398 fixed that script by naming `KUBECONFIG`, and this keeps the
next script written the same way from hitting it again.

The check now skips a line that passes a non-empty `--context` or
`--kubeconfig`. client-go serves such a call from the loaded kubeconfig,
and without one `--context` fails with "context was not found" instead
of falling back to localhost:8080. An empty value (`--context ""`,
`--context=`, `--kubeconfig=`) does fall back, so it is still reported,
and so is a bare call in the same file. The header notes the limits: a
variable that is empty at runtime is not visible to the check, and the
match is per line.

Tested with `bats hack/check-hook-request-timeout.bats`: 11 of 11 pass,
the new cases fail without the change, and each part of the filter is
pinned by a mutation. The empty-value fallback was reproduced with
kubectl v1.37.2.

### 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
NONE
```

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

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

## Summary by CodeRabbit

* **Bug Fixes**
* Timeout checks now exclude matching lines that specify a non-empty
context or kubeconfig value. Empty option values and bare calls on
separate lines are still reported; files naming `KUBECONFIG` remain
excluded.
* **Documentation**
* Clarified how context and kubeconfig options affect timeout reporting.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-12-02 12:46:11 +03:00
Aleksei Sviridkin 79ed8e1164 fix(redis): let the operator delete a disabled Sentinel PDB instead of a per-upgrade hook (#5429)
## What this PR does

When a Redis instance runs a single pod, the chart runs one Sentinel and
sets `disablePodDisruptionBudget` on it. The redis-operator stops
ensuring the Sentinel PDB once that flag is set, but never deletes the
PDB it created earlier, and the PDB's owner reference only removes it
together with the RedisFailover. An instance scaled down from three pods
therefore keeps a `minAvailable: 1` PDB on its only Sentinel, and every
node drain blocks on it.

The chart worked around this with a post-upgrade Helm hook: a
ServiceAccount, a Role, a RoleBinding and a kubectl Job, rendered on
every upgrade of every single-replica instance, to delete a PDB the
operator should have removed itself. The operator image is already built
in this repository with carried patches, so I fixed it there instead.

- `redis-operator`: a new source patch makes the operator look the
Sentinel or Redis PDB up on reconcile while its
`disablePodDisruptionBudget` is set, and delete it only when the
RedisFailover is its controller. A PDB without that owner is left alone,
no delete is sent when there is no PDB, and one that disappears between
the lookup and the delete counts as done. It has a unit test next to the
operator's own `EnsureSentinelDeployment` tests, which the image build
runs for every package a patch touches. The patch header says it is
carried until an upstream release includes the change.
- `redis`: the hook, its RBAC, its chart tests and the
`redis.sentinelReplicas` helper extracted for it are removed. The
single-Sentinel change and its tests stay as they were.
- e2e: the base Redis case now scales its instance from two replicas to
one and asserts that `rfs-<name>` existed before and is gone after, and
that the data pods' PDB stays.

Upgrade: an instance that still has the stale PDB loses it on the first
reconcile by the updated operator, which resyncs every RedisFailover
every 30 seconds. Until the operator Deployment rolls, the PDB stays, so
drains on such an instance can block for that window. Hook objects from
earlier upgrades are not release resources, so Helm does not touch them;
the successful runs already deleted theirs through `hook-succeeded`. A
run that failed leaves its ServiceAccount, Role and RoleBinding named
`<release>-sentinel-pdb` behind (its Job goes after an hour through
`ttlSecondsAfterFinished`). They grant only get and delete on one PDB
and can be removed by hand.

Cost: while a PDB is disabled, every reconcile (on each RedisFailover
change and on the 30-second resync) reads it once from the API server; a
delete is sent only when an owned PDB is still there.

I have not run the image build or the e2e suite. The patch series
applies on the v3.3.5 tarball, alone and together with the operator
patch of the open draft #5382, and every package it touches passes `go
test` and `go vet -tags integration`. `helm unittest
packages/apps/redis` passes. Upstream v3.3.5 is the latest release and
its master still has the same code, so there is no version to bump to; a
version of the patch rebased onto upstream master, without the `tlsHash`
parameter the carried TLS patch adds, is open as
freshworks-oss/redis-operator#93, and the patch header links to it.

### 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:

No values key, schema, README or version enum changes; the diff touches
an image patch, chart templates and tests, and the Redis e2e suite only.

### Release note

```release-note
fix(redis): the redis-operator now deletes the Sentinel or Redis PodDisruptionBudget it created once that budget is disabled, so a Redis scaled down to one replica no longer keeps the Sentinel PDB that blocks node drains, and the chart no longer runs a cleanup Job with its own RBAC on every upgrade of a single-replica instance.
```


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

## Summary by CodeRabbit

* **Bug Fixes**
* Redis and Sentinel PodDisruptionBudgets are removed when their
respective settings disable management, provided they are owned by the
RedisFailover. Missing or unrelated budgets are left unchanged.
* Sentinel replica counts remain at one when Redis is configured with
one replica, and three otherwise.
* When switching to one Sentinel replica with PDB management disabled,
the Sentinel budget is removed while the data-pod budget remains. The
Helm release is then verified as ready.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-12-02 12:46:07 +03:00
Aleksei Sviridkin 17eb78d952 docs(agents): require accepted designs before merging implementations (#5465)
<!-- Thank you for making a contribution! Here are some tips for you:
- Use Conventional Commits for the PR title: `type(scope): description`
-->

## What this PR does

The contributing guide sends architectural changes to a design proposal
in cozystack/community, but it never said when the code implementing one
may merge. A clean implementation could land while its proposal was
still under review, and the design then had to follow the code that
shipped first.

`CONTRIBUTING.md` now says that such a pull request stays in draft until
the proposal is merged into community, that opening it early as a proof
of concept is welcome, and that it closes if the proposal is closed
without being accepted. The `triage/needs-proposal` line in `AGENTS.md`
and the pull request checklist in `docs/agents/contributing.md` point to
that paragraph, so the rule lives in one place.

### Screenshots

Not a UI change.

### 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:
- [ ]
[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 of the code repositories is reached. I left the community box open
on purpose: its `design-proposals/README.md` could state the same rule
from the proposal side, and whether to add it is a maintainers' call, so
I have not opened anything there.

### Release note

```release-note
docs(contributing): a pull request that implements a design proposal stays in draft until the proposal is accepted in cozystack/community.
```


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

## Summary by CodeRabbit

* **Documentation**
* Clarified that implementation pull requests for design proposals may
be opened early as drafts for proof-of-concept work, but can merge only
after the proposal is accepted.
* Added guidance to link early proof-of-concept work from the proposal
and to close the implementation if the proposal is not accepted.
* Clarified that accepted proposals require a separate implementation
issue, which may be an existing issue that references the proposal.
* Updated the contributor checklist to reference the draft pull request
guidance.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-12-02 12:46:03 +03:00
Yan Bondarenko 19ab55c030 fix(platform): stop handing tenants a root S3 the root tenant does not run
cozystack-basics wrote seaweedfs: tenant-root into the root values
unconditionally, so every tenant without its own SeaweedFS inherited
tenant-root as its S3 even when Tenant/root runs none. A Bucket there got
a BucketClaim for a bucket class that never appears, and Harbor got its
registry bucket the same way.

seaweedfs.rootEnabled records that choice the way monitoring.rootEnabled
does for monitoring, and the bucket and harbor charts refuse to render
without S3 up the tenant chain rather than wait on a class that does not
exist.

Older configurations have no SeaweedFS flag. Keep their root S3 enabled.
For an explicit value only true or the string "true" enables it.

Assisted-by: LLM
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
2026-12-02 07:11:22 +01:00