Commit Graph
8543 Commits
Author SHA1 Message Date
Alexey Artamonov b62f2f385f fix(clickhouse): record the bucket setting a ClickHouse backup was taken with
A ClickHouse application writes its archives either to the system
bucket, which nothing prunes, or to its own bucket, whose lifecycle is
the tenant's. A Backup did not say which applied, so nothing deciding
the fate of the archive when the Backup goes could tell them apart.

The application's useSystemBucket is read when the backup Job is
created, stamped on the Job and copied onto the Backup from there,
because the application may switch before the controller sees the Job
complete. It is the setting, not an observation of the bucket: the
sidecar uploads to the bucket it was last restarted with, so a switch
made just before the backup can be recorded while the sidecar still
writes to the previous bucket. A Job created before the stamp existed
falls back to the application as it reads then.

Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
2026-11-23 12:15:04 +03:00
Aleksei Sviridkin 319c2c81f7 test(migrations): build each migration test image once per file (#5362)
## What this PR does

Closes #5299

In `hack/migration-{54,55,57,58,59,61}-*.bats`, every test calls
`prep()`, and `prep()` ran `docker build -q -t "$TESTIMG"` for one fixed
tag derived from the alpine pin. Under `bats -j N`, the tests in a file
run concurrently. On a cold cache, several uncached builds of that tag
therefore ran at the same time. The issue traces how a retag on the
containerd image store deletes the old image before creating the new
one, so a sibling's `docker run` can find the tag missing and fall back
to a pull.

This PR takes the first fix the issue suggests:
- `build_test_image()` holds the existing Dockerfile for each file,
unchanged (`jq`, plus `bash` for migration 61). Its exit status is
`docker build`'s, so a failed build still fails the caller.
- `setup_file()` builds the image once, before any test in the file
starts. If docker isn't available it does nothing, so `prep()` still
prints its existing "docker is required" message.
- `prep()` now runs `docker image inspect "$TESTIMG" ||
build_test_image`, so it only builds as a fallback when the tag is
missing (for example, a run without bats' `setup_file`). Under bats the
image already exists, so tests never build concurrently.

The issue lists 54, 55, 57, 58 and 59.
`migration-61-strimzi-v1-conversion.bats` has the same `prep()` pattern,
so it's included. Its separate `cozystack-migration61-test:ubuntu` build
stays where it is: only one test builds and uses it.

I chose this over `--no-parallelize-within-files` because it keeps these
files parallel and doesn't change the Makefile for every other bats
file.

### How I checked it

- I had no Docker daemon here, so I ran each file with a stub `docker`
on `PATH` that logs its calls and treats the tag as present once built:
- **On this branch:** one `docker build` per file (two for migration 61,
the second being the ubuntu image), with one `image inspect` per
`prep()` call.
  - **On main:** migration 54 ran four builds for its four tests.
- `bats --count` parses all six files.
- None of these files sources a `.sh` file, so they run only under real
bats (`bats-unit-tests`), not the `cozytest.sh` POSIX lane.
- Please rely on CI to run them against a real daemon.

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

These are repository-internal tests only.

### Release note

```release-note
NONE
```


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

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

## Summary by CodeRabbit

* **Tests**
* Improved migration test setup by building the required test image once
per test file and reusing it across tests.
* Preserved the existing Docker prerequisite checks and fallback
behavior.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-23 12:01:18 +03:00
Aleksei Sviridkin cac0bb9b28 test(hack): check hook scripts under files/ for --request-timeout (#5360)
## What this PR does

Closes #5304

`hack/check-hook-request-timeout.bats` built its candidate list with
`grep -rl 'kubectl' packages/*/*/templates/`. A chart that loads its
hook script with `.Files.Get "files/<name>.sh"` runs that script with
the same in-cluster credentials, but the guard never looked at it.
That's how the flag got through in the first revision of #4915. The
guard also matched only `--request-timeout=<value>`, while kubectl also
accepts `--request-timeout <value>`.

Changes:
- Candidates now include shell scripts under `packages/*/*/files/`,
recognised by a `.sh` suffix or a `sh`/`bash`/`dash` shebang, also
through `env` or `env -S`. Other files there (CAPI component manifests,
YAML defaults) are left out, as the issue suggests. Files that name
`KUBECONFIG` are still skipped.
- The pattern now catches the space form as well:
`--request-timeout(=["']?[^0[:space:]"']|[[:space:]]+["']?[1-9])`, which
also covers quoted values such as `--request-timeout "30s"`. The space
form only counts when a non-zero number follows. Several templates have
comments like "a non-zero --request-timeout on an in-cluster kubectl
call", and a looser pattern would flag them.
- The scan is split into small functions. Seven new cases run it on a
throwaway tree under `$BATS_TEST_TMPDIR`:
- a `files/hook.sh` with `--request-timeout=30s` is reported, which is
the case from the issue;
  - a script without the `.sh` suffix is picked up through its shebang;
  - `--request-timeout 30s` and `--request-timeout=5` are reported;
  - quoted `"30s"` and `'30s'` values are reported;
- an `#!/usr/bin/env -S bash -e` script is collected, and an `env -S
python3` script is not;
- `=0`, ` 0s`, prose in a comment, a script that sets `KUBECONFIG`, and
a non-script YAML under `files/` are not reported.

The existing repository-wide case still passes on main with the wider
scope. `cilium/files/ipam-migration.sh` and both seaweedfs hook scripts
are now checked, and none of them uses the flag.

### How I checked it

`bats hack/check-hook-request-timeout.bats` (bats 1.12.0): 8/8 pass.

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

This is a repository-internal test only.

### 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 automated checks for request-timeout options in chart
templates and eligible shell scripts, covering both
`--request-timeout=value` and `--request-timeout value` formats,
including quoted values.
* Added coverage for zero-valued timeouts, prose mentions, files that
reference `KUBECONFIG`, and non-shell files.
* The check continues to require a minimum number of candidate files and
report files with non-zero timeout values.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-23 11:58:30 +03:00
Aleksei Sviridkin dec14c736d docs(gateway): stop saying the route-hostname policy admits hostname-less routes (#5352)
## What this PR does

Refs #4938

The edge-termination section of `packages/extra/gateway/README.md` said
that on a class sharing one edge address the class controller has to
keep route hostnames inside the tenant apex, "since the platform's
route-hostname policy admits routes that declare no hostnames at all".

That stopped being true in 1.7.
`packages/system/cozystack-basics/templates/route-hostname-policy.yaml`
now requires `spec.hostnames` to be present and non-empty for
`HTTPRoute`, `TLSRoute` and `GRPCRoute` in `tenant-*` namespaces
(#3475), and it rejects any hostname outside the namespace's
`namespace.cozystack.io/host` apex. The policy doesn't depend on the
Gateway class. This PR replaces the sentence with one that says so and
links to the policy's entry under "Security model".

This fixes only the line the issue points at. I didn't audit the rest of
the README against the code, so I used `Refs` and not `Closes`. The
issue asks for that full review, and it should stay open for it.

`make generate` (cozyvalues-gen) only rewrites the parameter table, and
this change doesn't touch it.

### Screenshots

Not a UI change.

### Downstream repositories

I left every box below unticked on purpose. The only downstream copy of
this text is the Gateway reference page on cozystack/website. Per
`docs/agents/contributing.md`, the release bot regenerates that page
from this README on the next stable tag, so I don't think any manual
follow-up is needed. A maintainer should confirm that.

- [ ] 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
docs(gateway): the Gateway README no longer says the route-hostname policy admits routes without hostnames; since 1.7 it rejects them in tenant namespaces.
```


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

## Summary by CodeRabbit

* **Documentation**
* Clarified that the route-hostname policy applies to `HTTPRoute`,
`TLSRoute`, and `GRPCRoute` resources in `tenant-*` namespaces on
creation and update. It rejects routes with no hostnames or hostnames
outside their namespace’s apex. Routes stored before the policy is
installed are not rejected unless they are subsequently updated.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-23 11:56:48 +03:00
Aleksei Sviridkin 02b8a26738 fix(securitygroups): reject port ranges and malformed FQDNs on the SecurityGroup path (#5134)
<!-- 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

Fixes #5130.

`validatePortRules` sent any non-numeric port to `IsValidPortName`, so
`"80-90"` came back as "must contain at least one letter (a-z)". A
`first-last` value now gets "port ranges are not supported; list each
port as its own entry" on the same field. `PortProtocol` carries a
single port and Cilium's `endPort` is not exposed, so the limit itself
is unchanged.

`validateFQDNs` only checked that a selector was not empty. A malformed
`matchName` or `matchPattern` passed, and the backing write then failed
on the CiliumNetworkPolicy CRD, which surfaced as an error about a
`cilium.io` object. The validator now applies the CRD's own rules for
`spec.egress[].toFQDNs[]`, with a field error on the SecurityGroup path:
`^([-a-zA-Z0-9_]+[.]?)+$` for `matchName`, `^([-a-zA-Z0-9_*]+[.]?)+$`
for `matchPattern`, `maxLength: 255` for both, and the `oneOf` that
allows only one of the two per selector. These are copied from the CRD
served by Cilium 1.19.5 and match the agent's `FQDNSelector.sanitize`,
which also refuses a selector that sets both fields.

`TestCreateRejectsInvalidPortOrFQDN` lists each rejected value and
checks that the error carries a single cause, on the expected field,
with the expected reason. All 13 cases fail on `main`.
`TestCreateAcceptsValidPortOrFQDN` lists accepted values (named port
`http-8080`, trailing dot, underscore labels, `**.` prefix, infix and
lone `*` patterns, 255 characters) and checks they project 1:1. `go test
./pkg/registry/sdn/...` passes.

As a cross-check, every FQDN value in both tables was also sent to the
CiliumNetworkPolicy CRD of a lab running Cilium 1.19.5, with `kubectl
create --dry-run=server`. The CRD rejects exactly the values the
validator rejects and accepts exactly the ones it accepts.

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

The diff touches `pkg/registry/sdn/securitygroup/validate.go` and its
tests only: the SecurityGroup schema does not change, and no package,
chart, CRD, `hack/` or convention is touched. Neither the website nor
the Terraform provider documents or models SecurityGroup fields.

<!--
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(securitygroups): a port range now gets a clear "port ranges are not supported" error, and a malformed toFQDNs matchName or matchPattern is rejected on the SecurityGroup field instead of failing on the backing CiliumNetworkPolicy.
```


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

## Summary by CodeRabbit

* **Bug Fixes**
* Security group egress rules now reject port ranges with a clear
validation error; list each port separately.
* FQDN selectors are checked for supported name or pattern formats,
required selector fields, and a maximum length of 255 characters.
* Invalid egress settings are rejected without creating a policy, while
valid ports and FQDN selectors can be saved.
* **Documentation**
  * Updated guidance to reflect egress port and FQDN validation rules.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-23 11:51:46 +03:00
Aleksei Sviridkin 04fb5215a8 fix(kubernetes): apply addons.monitoringAgents.valuesOverride (#5375)
<!-- 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

`addons.monitoringAgents.valuesOverride` on a managed Kubernetes cluster
is accepted, stored and documented in the schema and README, but the
addon's HelmRelease template never reads it. The application stays
`Ready` and nothing reaches the agents, so a user who adds a second
vmagent remote-write URL or an extra Fluent Bit output to ship a copy of
metrics or logs to their own store gets no error and no effect. Every
other addon with a `valuesOverride` (coredns, cert-manager,
ingress-nginx, vertical-pod-autoscaler, cilium) already merges it.

The single commit moves the defaults into a
`cozystack.defaultMonitoringAgentsValues` helper and merges
`valuesOverride` over them with `mergeOverwrite`, the same pattern as
those addons. With no override the rendered HelmRelease is semantically
identical to the one on `main`; a new unit test sets an override and
fails on the previous template.

Note for reviewers: as with the other addons, lists and multi-line
strings are replaced rather than appended, so overriding
`vmagent.remoteWrite.urls` or `fluent-bit.config.outputs` means
restating the default tenant destination to keep it.

The `vmagent.remoteWrite.url` vs `.urls` mismatch from #5258 is already
fixed by #5024 and is on its way to the release lines in #5311 and
#5312; this PR covers the `valuesOverride` gap that #5258 also points
out.

Refs #5258

### Screenshots

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

### Downstream repositories

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

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

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

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

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

### Release note

<!--  Write a release note:
- Explain what has changed internally and for users.
- Start with the same `type(scope):` prefix as in the PR title
- Follow the guidelines at
https://github.com/kubernetes/community/blob/master/contributors/guide/release-notes.md.
-->

```release-note
fix(kubernetes): `addons.monitoringAgents.valuesOverride` is now applied to the monitoring agents of managed Kubernetes clusters; it was previously accepted but ignored.
```


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

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

## Summary by CodeRabbit

* **Bug Fixes**
* Monitoring agent overrides now retain default settings while applying
custom values. Configured remote-write URLs, cluster and tenant labels,
cluster-specific log filters, and log volumes remain intact when outputs
are overridden.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-23 11:51:37 +03:00
Aleksei Sviridkin 382169be52 fix(talos): bump Talos to v1.14.4 (CVE-2026-99999) (#5045)
## What this PR does

Bumps the Talos release Cozystack ships for host nodes from v1.14.2 to
v1.14.4. Talos v1.14.4 ships Linux 6.18.57, which carries the upstream
fix
[`6785011f8b16`](https://git.kernel.org/linus/6785011f8b16abf40b1e9d8b2e332232b3e68822)
("ipv4: validate checksum_start before completing checksum") for
CVE-2026-99999, known as PwnEscape. v1.14.2 runs Linux 6.18.54 and is
affected.

A guest controls the `csum_start` field of the `virtio_net_hdr` it hands
to the host through TAP or vhost-net. When the host fragments such a
packet, `skb_checksum_help()` writes two guest-chosen bytes inside the
IPv4 header, and `ip_frag_next()` then copies host memory past the
packet into every fragment. The leak has been chained into code
execution on the host. No nested virtualization is needed. KubeVirt VMs
on Cozystack use the bridge binding, a TAP device with vhost-net and
checksum offload on, so root in any guest (a `vm-instance` or a tenant
Kubernetes worker) reaches this path on the host node.

Changes:

- `packages/core/talos/images/talos/profiles/*`: regenerated with
`hack/gen-profiles.sh v1.14.4` (installer-base and every system
extension digest, amd64 and arm64).
- `packages/system/multus/images/multus-cni/Dockerfile`: the
`talos-cni-plugins-checked-against` marker moves to v1.14.4. Talos
v1.14.4 still pins containernetworking/plugins v1.9.1 in
siderolabs/pkgs, the same as `CNI_PLUGINS_VERSION`.
- `docs/operations/system-memory-limits.md`: the shipped version it
names moves to v1.14.4. No OOM handler file changed between v1.14.2 and
v1.14.4, so the quoted defaults still hold.

The v1.14.2 to v1.14.4 changes are patch fixes only (network route
teardown, DHCP, KubePrism recovery, mount cleanup, etcd 3.7.2), with
DRBD 9.3.4 and ZFS 2.4.4 unchanged. No machine-config change is needed
on top of the v1.14 requirements that v1.14.2 already brought in.

Not covered here: tenant Kubernetes workers default to Talos v1.13.6
(`packages/apps/kubernetes`, `packages/apps/kubernetes-nodes`). The bug
is on the host side, so the host bump is what closes the guest escape.
No v1.13 release with the fix exists yet (v1.13.11 is on 6.18.54).

Tested: `hack/cni-plugins-staging-contract.bats` and
`hack/talos-installer-index_test.bats` pass (12/12), run in the
`bats/bats:1.13.0` container. No image was built or booted locally.

### Screenshots

Not a UI change.

### Downstream repositories

The trigger map hits `cozystack/website`: this bumps the version in
`packages/core/talos/images/talos/profiles/installer.yaml`, and
`data/versions/next.yaml` there pinned `talos: "v1.14.2"`. The follow-up
moves it to v1.14.4 and should merge after this PR. No other repository
on the map is reached by this diff.

- [ ] No downstream repository is affected by this change
- [x] [cozystack/website](https://github.com/cozystack/website) -
follow-up: https://github.com/cozystack/website/pull/768
- [ ]
[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(talos): Bump Talos to v1.14.4 (Linux 6.18.57) to fix CVE-2026-99999 (PwnEscape), a guest-to-host escape through virtio_net_hdr checksum offload that any KubeVirt VM can reach on the host node. Upgrade and reboot host nodes; the fix applies only to the kernel that is running.
```



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

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

## Summary by CodeRabbit

* **Updates**
* Updated Talos-based installer, ISO, kernel, metal, and NoCloud
images—including ARM64 variants—from v1.14.2 to v1.14.4, with refreshed
system extensions and firmware.
* Updated the documented Talos version associated with host-node
memory-limit defaults to v1.14.4.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-23 08:12:47 +03:00
Aleksei Sviridkin 18a9530b87 fix(platform): honour a bool false in ingress-enabled and monitoring-enabled (#5354)
## What this PR does

`default "true"` treats a bool false as empty, so an unquoted
`_cluster.ingress-enabled: false` or `_cluster.monitoring-enabled:
false` still rendered `_namespace.ingress: tenant-root` and the
monitoring ExternalName redirects. Both gates now check for a missing
key first and otherwise require `"true"` or a bool true, so a missing
key keeps the old behaviour, every string value keeps its old meaning,
and a bool false turns the feature off. #5097 does the same for the
seaweedfs flag.

helm-unittest 1.1.2, cozystack-basics 83 of 83. Against the templates on
main the two new bool-false cases fail.

### Downstream repositories

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

### Release note

```release-note
fix(platform): an unquoted false in _cluster.ingress-enabled or _cluster.monitoring-enabled now turns off the tenant-root ingress key and the monitoring redirects.
```


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

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

## Summary by CodeRabbit

* **Bug Fixes**
* Ingress and monitoring redirects are no longer enabled when their
settings are explicitly `false` or empty. When settings are missing,
existing default behavior is preserved.

* **Tests**
* Added coverage for disabling ingress and monitoring redirects with
boolean `false`.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-23 06:55:44 +03:00
Aleksei Sviridkin 10bd82cc58 docs(release): make changelog check B find changed image build files (#4952)
## What this PR does

Check B of the changelog pre-publish verification in `docs/release.md`
lists changed image build files with `git diff --name-only $PREV..$NEW
-- 'images/*/Dockerfile'`. That pathspec never matches anything: there
is no `images/` directory at the repository root, since image build
files live under `packages/*/*/images/`. The check therefore printed
nothing on every release and passed without looking at anything. It also
skipped `Containerfile`, which first-party images such as
`otelcol-tracing` and the dashboard `console` use.

This PR changes the pathspec to `'*Dockerfile' '*Containerfile'`, which
matches both file names at any depth. I checked it in a scratch
repository: the old pathspec returned no files for a changed Dockerfile
and Containerfile, and the new one returned both. Every Dockerfile and
Containerfile currently in the repository lives under
`packages/*/*/images/`, so the broader pathspec does not pick up files
from vendored charts.

Closes #4892 

### Screenshots

N/A: documentation-only change, no UI impact.

### 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
docs(release): make changelog verification check B find changed image build files by matching Dockerfile and Containerfile at any depth
```

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

## Summary by CodeRabbit

* **Chores**
* Pre-publish verification now checks for changes to Dockerfiles and
Containerfiles throughout the release range, including files outside
image-specific directories. This expands the container build-file
changes covered by release checks; previously, verification was limited
to Dockerfiles in image directories.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-23 04:41:57 +03:00
Aleksei Sviridkin ff461cc41f fix(kubernetes): remove cilium dependency from coredns HelmRelease (#5331)
## What this PR does

Closes #5315

Removes `spec.dependsOn` on Cilium from the tenant `coredns`
`HelmRelease`
(`packages/apps/kubernetes/templates/helmreleases/coredns.yaml`).

When Hubble Relay is enabled at tenant cluster creation, `hubble-relay`
waits on DNS resolution for `hubble-peer.cozy-cilium.svc.cluster.local`
before the Cilium `HelmRelease` becomes Ready. Because CoreDNS
previously declared `dependsOn` on Cilium, Flux blocked CoreDNS
installation until Cilium was ready, creating a circular deadlock.
Allowing both `HelmRelease` resources to reconcile concurrently lets
CoreDNS retry (`spec.install.remediation.retries: -1`) until Cilium
brings up cluster networking, unblocking CoreDNS and Hubble Relay.

### Downstream repositories

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

### Release note

```release-note
fix(kubernetes): remove cilium dependency from coredns HelmRelease to prevent a circular startup deadlock when Hubble Relay is enabled
```

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

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

## Summary by CodeRabbit

* **Updates**
* CoreDNS no longer waits for the release-specific Cilium HelmRelease
dependency before being managed. Its configured values remain unchanged,
and installation and upgrade remediation behavior is covered by
automated checks.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-23 04:41:48 +03:00
Aleksei Sviridkin 0c44188eb5 Merge branch 'main' into mattia/pwnescape-kvm-cozystack-talos-dec626
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-23 04:14:37 +03:00
Aleksei Sviridkin f5479e7093 fix(qdrant): scrape TLS metrics over HTTPS (#5340)
## What this PR does

Qdrant with TLS enabled serves metrics over HTTPS, but its
ServiceMonitor still uses HTTP. Patch the rendered endpoint to use HTTPS
with the issued CA and a certificate SAN. The API key and explicit TLS
opt-out are preserved.

Validation: 3 regression tests and 110 Helm tests pass; both TLS cases
fail without the patch. The full Bats run has 183 failures on this macOS
host, all reproduced on unchanged main. The POSIX lane has 4 baseline
failures as well.

### 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(qdrant): restore metrics scraping for TLS-enabled instances by using HTTPS and verifying the server certificate against the issued CA.
```

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

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

## Summary by CodeRabbit

* **New Features**
* Qdrant monitoring now uses HTTPS when TLS is enabled, with certificate
verification and the configured server name.
* Monitoring connections use the release’s TLS certificate authority,
while non-TLS setups continue to use HTTP.
  * External Qdrant monitoring uses HTTPS by default.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-23 04:13:36 +03:00
Andrey Kolkov 5d96897d73 build(kafka-operator): vendor Strimzi 1.3.1 (#5372)
## What this PR does

Moves the Kafka operator from Strimzi 1.2.0 to 1.3.1, the only Strimzi
release rebuilt on an OpenJDK that fixes CVE-2026-114938 ("Java4Shell").

The CVE is an out-of-bounds write in the AVX-512 VBMI Base64 decoder of
OpenJDK 17.0.6 and later. A broker decodes Base64 in SASL/SCRAM before
the client is authenticated, so on an x86-64 node with AVX-512 VBMI a
tenant's cluster can be attacked by anyone who reaches its listeners.
Strimzi [rebuilt 1.3.1 and does not plan to rebuild
1.2.0](https://github.com/strimzi/strimzi-kafka-operator/issues/13394).

| Image | Bundled OpenJDK |
|---|---|
| `quay.io/strimzi/kafka:1.2.0-kafka-4.3.1`,
`quay.io/strimzi/operator:1.2.0` (today) | 21.0.12, affected |
| `quay.io/strimzi/kafka:1.3.1-1-kafka-4.3.1`,
`quay.io/strimzi/operator:1.3.1-1` (this PR) | 21.0.13.1, fixed |

What changes:

- The vendored chart is 1.3.1 as published, with no local patches. It
keeps Kafka 4.2.1 and 4.3.1, the two versions the `kafka` application
offers, so no tenant has to change `version`.
- The images are pinned to the suffixed rebuild tags (`1.3.1-1`, bridge
`1.2.1-1`). Strimzi moved the plain `1.3.1` tags onto the rebuild, so a
node that pulled the first build would keep the affected JDK under an
unchanged tag. All ten images the chart references exist under the
suffixed tags.
- The chart drops Kaniko (Buildah is the only Connect builder) and
grants the operator `serviceaccounts/token` and cert-manager
`certificates`, for two features that are off by default.
- The example backup scripts fall back to the same Kafka image and
follow it.
- A first commit makes the Kafka backup strategies (the platform's
topic-metadata strategy and the topic-data demo strategy) SigV4-sign
their S3 requests themselves with `openssl` and `sha256sum` instead of
`curl --aws-sigv4`. The Strimzi 1.3.1-1 images ship curl
`7.76.1-43.el9`, whose RHEL backport of the S3 payload handling signs
`x-amz-content-sha256` without sending it, so SeaweedFS answered every
backup upload and download with 403; that is what failed
`kafka-2-backup-roundtrip` and `kafka-3-metadata-roundtrip` on the first
run of this PR. The commit comes first because it works with the Strimzi
1.2 curl as well, so each commit is green on its own.

Not verified here: nothing was run on a live cluster. The check that
matters is the Kafka E2E on this PR, an upgrade of running clusters from
1.2.0 included. The signing was run against SeaweedFS 4.45 on a
non-default port inside both `quay.io/strimzi/kafka:1.2.0-kafka-4.3.1`
and `1.3.1-1-kafka-4.3.1` (metadata backup, restore and cleanup; demo
upload and download of a binary tarball), and the bats suites hold the
signature to the one botocore computes for the same request.

Notes for the reviewer:

- Strimzi 1.3 requires Kubernetes 1.32 or newer on the cluster the
operator runs on.
- Upgrading rolls every Kafka cluster once.
- This changes CRDs, so it does not reach the release lines, which are
on Strimzi 0.45.1 anyway. Those are covered by the JVM flag in #5371.
- #5371 stays useful after this merges only for the release lines; on
`main` the two do not conflict.

### Screenshots

N/A — no UI changes.

### Downstream repositories

Walked the trigger map against the diff: the vendored chart under
`packages/system/kafka-operator`, its wrapper values, the Kafka strategy
script in `packages/system/backupstrategy-controller/files`, the Kafka
backup examples and their bats suites. No package added or renamed, no
`values.schema.json` or README of an app, no version enum
(`packages/apps/kafka/files/versions.yaml` is unchanged), no platform
values, no `hack/` tooling or make target.

- [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
build(kafka-operator): update Strimzi to 1.3.1, whose images carry an OpenJDK with the fix for CVE-2026-114938 (Java4Shell). Every Kafka cluster rolls once on upgrade. Strimzi 1.3 requires Kubernetes 1.32 or newer. Kafka backups now sign their S3 requests in the strategy script, so they keep working with the curl the new Kafka images ship.
```


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

## Summary by CodeRabbit

* **New Features**
* Added support for projected service-account-token volumes, additional
volume ownership settings, and bind-mount options across Kafka
components.
* Added cert-manager support for cluster and client certificate
authorities.
* Expanded Kafka version options and added broker health panels to the
monitoring dashboard.
* **Updates**
* Updated Strimzi operator, Kafka, and Kafka Bridge images. Kubernetes
1.32 or newer is now required.
* S3 backup and restore requests now support signed requests to
custom-port endpoints.
* **Removals**
  * Removed Kaniko executor configuration and documentation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-23 08:01:53 +07:00
Andrey Kolkov d7573c009c fix(ingress-nginx): pick up the nginx rebuild with the HTTP/2 CVE fixes (#5377)
## What this PR does

Moves the ingress-nginx controller to `v1.11.6-cozystack.1`, the same
v1.11.6 controller with its nginx 1.25.5 rebuilt with two HTTP/2 fixes
from the nginx 1.30 stable branch:

| nginx commit | Fixes |
| --- | --- |
|
[`0c87dd1d`](https://github.com/nginx/nginx/commit/0c87dd1db413e440a4e3ef7ee8acc518509e8809)
| CVE-2026-123633, HTTP/2 use-after-free when `worker_connections` run
out |
|
[`b89c4100`](https://github.com/nginx/nginx/commit/b89c4100bf6762a45e4a6463eaf4b70368277c94)
| CVE-2026-123007, HTTP/2 flow control window overflow |

kubernetes/ingress-nginx is archived and will not publish another
1.11.x. The rebuild lives in the fork:
cozystack/ingress-nginx-with-protobuf-exporter#13. It compiles nginx
from upstream's own sources, patches and configure line, applies the two
commits last, and checks the result against the shipped binary.

Checked on the published image (`sha256:1d3f0e01…`, amd64 and arm64):

- `nginx -v` reports 1.25.5 with upstream's configure arguments, and
`nginx -t` passes on the controller's config;
- the nginx binary differs from the one in
`registry.k8s.io/ingress-nginx/controller:v1.11.6`;
- run as `www-data`, nginx binds port 80 and answers 200 over HTTP/2, so
`cap_net_bind_service` survived the rebuild.

`helm unittest` passes for the chart. Not run on a live cluster.

`nginx -v` still says 1.25.5, so scanners that match on the version will
keep flagging it.

### Screenshots

N/A, no UI changes.

### Downstream repositories

Walked the trigger map against the diff: an image tag and digest in
`packages/system/ingress-nginx/values.yaml`. No package, values key,
schema or app README changes.

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

### Release note

```release-note
fix(ingress-nginx): the ingress-nginx controller now runs nginx 1.25.5 rebuilt with the HTTP/2 fixes for CVE-2026-123633 and CVE-2026-123007. nginx still reports version 1.25.5.
```
2026-11-23 08:01:50 +07:00
Aleksei Sviridkin 0b53d53c01 Merge branch 'main' into fix/qdrant-monitoring-tls
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-23 02:58:03 +03:00
Aleksei Sviridkin 91fd8791c1 Merge branch 'main' into fix/cluster-flags-bool-false
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-23 02:53:08 +03:00
Timofei Larkin 65cb73e380 fix(lineage-webhook): keep an explicit tenantresource false (#4920)
## What this PR does

Lets a chart narrow the lineage webhook's
`internal.cozystack.io/tenantresource` verdict without being able to
widen it. The webhook computes the verdict from the
ApplicationDefinition's `secrets` selectors on first admission and
copied it over whatever label the chart rendered, so a Secret the
definition still selected was projected through
`core.cozystack.io/tenantsecrets` whatever the chart said. A `"false"`
rendered on a Secret the webhook admits for the first time (CREATE) is
now kept; a rendered `"true"` is still replaced by the computed verdict.
A re-admission (UPDATE with `managed-by-cozystack` dropped, which the
cacert controller does on a selector change) still gets the definition's
verdict, because the `"false"` it carries is the one this webhook wrote
earlier.

This is rollout step 2 of the accepted [user secrets API
proposal](https://github.com/cozystack/community/blob/main/design-proposals/user-secrets-api/README.md):
during a kind's conversion the converted chart renders the platform-only
`<release>-credentials` Secret with `tenantresource: "false"` while the
old definition may still select the name, and the label is what keeps
that Secret off the projection in the window. It ships on its own
because nothing else depends on it and the conversions do.

Behaviour otherwise unchanged: an object with no rendered label gets the
definition's verdict as before, and the re-admission short-circuit on
`managed-by-cozystack` is untouched.

Covered by a handler test: on CREATE, a rendered `false` kept where the
selector matches, a rendered `true` overwritten where it does not, and
no rendered label taking the verdict; on a re-admission UPDATE, a grant
where the selector now matches and a revoke where it no longer does.

### Screenshots

No UI change.

### Downstream repositories

Walked the trigger map against the diff: two files under
`internal/lineagecontrollerwebhook`, no CRD, no package, no chart, no
values, no `hack/` change. The ApplicationDefinition's selector
semantics gain one exception, but the website's ApplicationDefinition
page does not describe the projection verdict at that depth, so there is
nothing there to update.

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

### Release note

```release-note
fix(lineage-webhook): a Secret created with `internal.cozystack.io/tenantresource: "false"` keeps that label even where its ApplicationDefinition selects the name, so a chart can take a Secret off the tenantsecrets projection; a rendered `"true"` is still overwritten by the definition's verdict.
```


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

## Summary by CodeRabbit

* **Bug Fixes**
* On resource creation, an existing `false` tenant-resource label is
preserved even when the configured selector matches. Otherwise, the
label reflects the selector’s verdict. On updates, the label is set
according to the selector.
* **Tests**
* Added coverage for tenant-resource label behavior on creation and
updates, including existing and missing labels.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-22 23:53:22 +04:00
Andrey Kolkov 6afe23e32b chore(keycloak): bump Keycloak server to 26.8.2 (#5374)
## What this PR does

Moves Keycloak from 26.6.3 to 26.8.2, the only upstream image rebuilt on
an OpenJDK that fixes CVE-2026-114938 ("Java4Shell").

The CVE is an out-of-bounds write in the AVX-512 VBMI Base64 decoder of
OpenJDK 17.0.6 and later. Keycloak decodes Base64 on requests that
arrive before authentication, so on an x86-64 node with AVX-512 VBMI an
affected instance can be attacked without credentials. Upstream [rebuilt
26.8.2](https://www.keycloak.org/2026/11/java4shell-vulnerability-cve-2026-114938)
and left 26.6 and 26.7 as they were.

| Image | Bundled OpenJDK |
|---|---|
| `quay.io/keycloak/keycloak:26.6.3` (today) | 21.0.11, affected |
| `quay.io/keycloak/keycloak:26.8.2-3` (this PR) | 21.0.13.1, fixed |

What changes:

- `packages/system/keycloak` pins `26.8.2-3`. The suffix matters:
`26.8.2` moves when upstream rebuilds it, and `26.8.2-1` and `26.8.2-2`
still carry the affected JDK.
- `packages/system/keycloak-configure` runs `kcadm.sh` from the same
image and was still on 26.5.2; it moves along so the admin client
matches the server.

### How it was tested

Upgraded a two-replica 26.6.3 instance in place on a dev stand whose
nodes have AVX-512 VBMI, through the same values the release carries:

- The rolling update finished with the HelmRelease ready. The first new
pod ran the Liquibase update and migrated the `master` realm and the
platform realm through 26.7.0, 26.8.0 and 26.8.2.
- While it ran, the old node (Infinispan 16.0.8) and the new one
(16.0.15) shared one cluster view with no compatibility errors; the
final view has both nodes on 16.0.15.
- `java -version` in the pod reports 21.0.13.1.
- 26.8.2 enforces an audience check on the Admin REST API, which was the
main risk for the two admin clients this platform runs. Both pass: the
keycloak-operator, restarted to force a fresh login, reconciled every
resource and created a new realm group with no error and no 401 in its
log; and the `keycloak-configure` hook Job ran `kcadm.sh` from the new
image, with the same read and write calls repeated by hand afterwards.
- OIDC discovery and JWKS answer 200, and the login page of the platform
realm renders for the dashboard client. Submitting the login form was
not exercised.

`helm unittest` passes for both charts.

Notes for the reviewer:

- The database migration is one-way: after the upgrade, rolling the
image back to 26.6.3 is not supported.
- The upgrading guide says one 26.8.2 change (client registration
policies) does not support a rolling upgrade and asks to stop all nodes
first. This chart rolls the two replicas as before; the mixed phase
lasted under a minute in the test and showed no errors, but a deployment
that relies on dynamic client registration during the upgrade window may
see the difference.
- 26.8 also turns on client secret rotation and the SCIM API by default
and stops granting admin roles through identity-provider mappers unless
`allowAdminRoleMapping` is set. None of it is used by the platform's own
realm configuration.
- Custom login themes that override `social-providers.ftl` may need an
update for the redesigned identity-provider buttons.
- For the release lines, where a two-minor jump is not patch-release
material, #5370 adds the JVM flag instead.

### Screenshots

N/A — no UI changes in this repository. The Keycloak login page itself
changes with the upstream release.

### Downstream repositories

Walked the trigger map against the diff: an image tag in
`packages/system/keycloak/values.yaml` and in
`packages/system/keycloak-configure` (values and the template default).
No package added or renamed, no app `values.schema.json` or README, no
platform values key, no variant.

- [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
chore(keycloak): update Keycloak to 26.8.2, whose image carries an OpenJDK with the fix for CVE-2026-114938 (Java4Shell). The upgrade migrates the Keycloak database and cannot be rolled back to 26.6. Custom login themes that override social-providers.ftl should be checked against the redesigned identity-provider buttons.
```


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

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

## Summary by CodeRabbit

* **Updates**
* Updated the default Keycloak version to 26.8.2-3 across the main
service and its administrative job. The email-update configuration also
uses this version by default. Existing image overrides remain available,
so deployments that specify a custom image can continue using that
setting.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-21 18:41:36 +07:00
Andrei Kvapil 64cc6d2ff1 fix(ingress-nginx): pick up the nginx rebuild with the HTTP/2 CVE fixes
The controller image v1.11.6 ships nginx 1.25.5, and the upstream
project is archived, so no 1.11.x with a fixed nginx will come. The
cozystack fork now rebuilds that same nginx with the two HTTP/2 commits
from the 1.30 stable branch (CVE-2026-123633, CVE-2026-123007), and
this moves the controller to that build.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2026-11-20 21:09:57 +01:00
Andrey Kolkov bd79f08819 build(kafka-operator): vendor Strimzi 1.3.1
The Strimzi 1.2.0 images bundle OpenJDK 21.0.12, which is affected by
CVE-2026-114938, an out-of-bounds write in the AVX-512 VBMI Base64
decoder that a broker reaches in SASL/SCRAM before the client is
authenticated. Strimzi rebuilt only its 1.3.1 images on OpenJDK
21.0.13.1 and does not plan to rebuild 1.2.0.

Vendor the 1.3.1 chart as published. It keeps Kafka 4.2.1 and 4.3.1,
the versions the kafka application offers, adds 4.2.2 and 4.3.2, drops
Kaniko, and grants the operator serviceaccounts/token and cert-manager
Certificates for two features that are off by default.

Pin the images to the suffixed rebuild tags. Strimzi moved the 1.3.1
tags onto the rebuild, so a node that pulled the first build keeps
running the affected JDK under an unchanged tag; 1.3.1-1 does not move.

The example scripts fall back to the same Kafka image and follow it.

Strimzi 1.3 requires Kubernetes 1.32 or newer.

Assisted-by: LLM
Signed-off-by: Andrey Kolkov <androndo@gmail.com>
2026-11-20 20:18:32 +07:00
Andrey Kolkov 35634080f4 fix(backups): sign Kafka S3 requests without curl --aws-sigv4
The Kafka topic-metadata strategy and the topic-data demo strategy move
their artifacts to and from S3 with the curl of the Strimzi image they
run in, signed by curl --aws-sigv4. The Strimzi 1.3.1-1 images carry
curl 7.76.1-43.el9, whose RHEL backport of the S3 payload handling
(0044-curl-7.76.1-aws-sigv4-s3-unsigned-payload.patch) adds
x-amz-content-sha256 to the canonical headers and to SignedHeaders but
never sends the header. SeaweedFS rejects every signed request, so both
backup Jobs fail with

    curl: (22) The requested URL returned error: 403

The 7.76.1-40.el9 curl of the Strimzi 1.2 images has a different
defect, a signed Host without the non-default port it sends, which the
--connect-to workaround covered.

Sign the request in the script with openssl and sha256sum, both in the
Strimzi image, and leave curl only the transport. Sending the missing
header from the script would not do: for an upload the -43 build signs
UNSIGNED-PAYLOAD and the -40 build the empty-body hash, so no single
value satisfies both, and a curl that is fixed to send the header would
then send it twice. With the Host signed as curl sends it, the
--connect-to workaround goes too.

The bats suites hold the signature to the one botocore 1.35.99
S3SigV4Auth computes for the same request at a fixed time. Against
SeaweedFS 4.45 on a non-default port, the metadata script's backup,
restore and cleanup and the demo strategy's upload and download pass
in both quay.io/strimzi/kafka:1.2.0-kafka-4.3.1 and
1.3.1-1-kafka-4.3.1, a key with a space and non-ASCII bytes included,
and a wrong secret still gets 403.

Assisted-by: LLM
Signed-off-by: Andrey Kolkov <androndo@gmail.com>
2026-11-20 20:18:32 +07:00
Mattia Eleuteri dc74e04f7b fix(kubernetes): apply addons.monitoringAgents.valuesOverride
The monitoringAgents addon has exposed a valuesOverride field since it
was added, and the schema and README document it, but the HelmRelease
template never read it. An override was accepted and stored, the
application stayed Ready, and nothing reached the agents: for example a
second vmagent remote-write URL or an extra Fluent Bit output never
showed up in the tenant cluster. Every other addon with valuesOverride
(coredns, cert-manager, ingress-nginx, VPA, cilium) already merges it.

The defaults move into a cozystack.defaultMonitoringAgentsValues helper
and valuesOverride is merged over them with mergeOverwrite, the pattern
those addons use. Lists and multi-line strings are replaced, not
appended: an override of vmagent.remoteWrite.urls or
fluent-bit.config.outputs has to restate the default destination to
keep it. The helper ends with "{{ end }}" rather than "{{- end }}" so
that the filters block keeps its trailing newline.

With no override, the rendered HelmRelease is semantically identical
to the one before (same values, only toYaml key order). A unit test
sets an override and checks that it replaces urls and outputs while the
defaults it does not touch remain; it fails on the previous template.

Refs: #5258
Fixes: 3c27a1e9bf ("add metrics agents (#461)")
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
2026-11-20 14:09:13 +01:00
Andrey Kolkov 026b015635 fix(opensearch): disable the Base64 intrinsics hit by CVE-2026-114938 (#5373)
## What this PR does

CVE-2026-114938 ("Java4Shell") is an out-of-bounds write in the AVX-512
VBMI Base64 decoder of OpenJDK 17.0.6 and later. OpenSearch decodes the
Basic credentials of a request before it authenticates it, so on an
x86-64 node with AVX-512 VBMI a tenant's cluster can be attacked by
anyone who reaches its HTTP port.

Two of the three versions the `opensearch` application offers bundle an
affected JDK, and OpenSearch has not released a build on a patched one
yet:

| Image | Bundled JDK | Affected |
|---|---|---|
| `opensearchproject/opensearch:3.0.0` | 21.0.7 | yes |
| `opensearchproject/opensearch:2.11.1` | 17.0.8 | yes |
| `opensearchproject/opensearch:1.3.20` | 11.0.25 | no |

This PR starts the nodes with `-XX:-UseBASE64Intrinsics`, the mitigation
[RHSB-2026-018](https://access.redhat.com/security/vulnerabilities/RHSB-2026-018)
recommends: it removes the vulnerable code path and keeps the other
AVX-512 optimizations.

The flag is delivered as a `jvm.options.d` file mounted from a ConfigMap
through `general.additionalVolumes`, because neither obvious route
works:

- `bin/opensearch-env` unsets `JAVA_TOOL_OPTIONS`, so an env var never
reaches the JVM;
- setting `nodePools[].jvm` makes the operator stop sizing the heap from
the memory request and use the string as is.

The operator mounts `general.additionalVolumes` into the node pools and
the bootstrap pod alike, and `restartPods` restarts them when the file
changes.

Verified by starting 3.0.0, 2.11.1 and 1.3.20 with the file mounted:
each server JVM runs with `-XX:-UseBASE64Intrinsics`, and the heap
passed in `OPENSEARCH_JAVA_OPTS` still applies after it. `helm unittest`
passes (156 tests), including a new suite. Not tested through the
operator on a live cluster.

Notes for the reviewer:

- This is a mitigation, not a fix. A version bump has to wait for an
OpenSearch release on a patched JDK.
- Upgrading restarts every OpenSearch cluster once.
- The securityadmin update Job is left alone: it is a client and accepts
no inbound connections. OpenSearch Dashboards is Node.js.
- The commit picks onto `release-1.7` cleanly and conflicts in
`templates/opensearch.yaml` on `release-1.6` (checked with a merge-tree
dry run).

### Screenshots

N/A — no UI changes.

### Downstream repositories

Walked the trigger map against the diff: one template, one new template
and one unit test under `packages/apps/opensearch`; no values key,
`values.schema.json`, README, version enum or default 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(opensearch): mitigate CVE-2026-114938 (Java4Shell) by starting OpenSearch nodes with -XX:-UseBASE64Intrinsics, which disables the vulnerable OpenJDK Base64 decoder. Every OpenSearch cluster restarts once on upgrade.
```
2026-11-20 17:29:42 +07:00
Andrey Kolkov f4330867ea feat(dashboard): let a login link pick the Keycloak identity provider (#5286)
## What this PR does

A login link into the dashboard can now name the Keycloak identity
provider, so a user who comes from a portal brokered into Keycloak skips
the realm login page:

```
https://dashboard.<host>/oauth2/start?kc_idp_hint=<idp-alias>&rd=/admin/tenants
```

The motivating case is a billing portal registered in the realm as an
OIDC identity provider. Its "Open dashboard" button today lands every
client on "Sign in to <realm>", where they must pick the portal's
provider by hand on every new browser or session. Keycloak skips that
page when the auth request carries `kc_idp_hint`. The gatekeeper,
however, builds the request from a fixed `--login-url`, and
oauth2-proxy's flags forward only `acr_values`, `prompt` and
`approval_prompt` from `/oauth2/start`. Putting the hint into
`--login-url` would force every dashboard login, administrators
included, through that one provider.

oauth2-proxy can forward an allowed parameter through
`providers[].loginURLParameters`, but only in its alpha configuration.
The OIDC gatekeeper therefore now runs from one:

- `templates/gatekeeper-config.yaml` (new, OIDC only) holds the
provider, upstream, listen address and injected headers. The values are
exactly what `oauth2-proxy --convert-config-to-alpha` (v7.12.0) produces
for the previous flags, both the in-cluster Keycloak branch and the
external-discovery branch. On top of those, `kc_idp_hint` is allowed
when it matches `^[A-Za-z0-9._-]+$`. That rule and `clientSecretFile` in
place of the inline `clientSecret` are the only hand-written lines;
everything else, `scope`, `approval_prompt`, `insecureSkipNonce`,
`flushInterval` and `timeout` included, is the converter output
unchanged.
- `templates/gatekeeper.yaml` keeps the flags the alpha configuration
does not own (redirect URL, whitelist domain, email domain, API routes,
cookie options, `--skip-provider-button`, `--ssl-insecure-skip-verify`).
It mounts the config and the `dashboard-client` secret as files
(`clientSecretFile`). A checksum annotation restarts the pod when the
config changes.
- The token-proxy branch (OIDC disabled) is unchanged.

A login without the parameter behaves as before. oauth2-proxy logs a
warning on start that the alpha configuration format may change between
releases.

Tests:
- **Chart suite.** The gatekeeper suite loads the config template as
well, because the deployment checksums it. The "no branding volume" test
now asserts the branding volume is absent, not that the pod has no
volumes. The five tests that read Keycloak URLs from the container args
are removed: those values now sit in the alpha configuration. `helm
unittest .` passes, 23 tests.
- **E2E.** After the gatekeeper rolls out with OIDC enabled, the in-tree
install suite requests `/oauth2/start` through a port-forward and checks
the redirect: `kc_idp_hint=e2e-idp` reaches the `cozy` realm's auth URL,
and a value outside the allow pattern (`e2e%26prompt%3Dnone`) is
dropped. This covers the realm path and the allow rule that the removed
chart tests no longer pin.
- **Gatekeeper login (`hack/dashboard-gatekeeper-login.bats`).** Renders
the chart for a realm other than `cozy`, starts the auth-proxy image
with the rendered args and alpha config, and checks the `/oauth2/start`
redirect: on the in-cluster Keycloak branch the hint reaches that
realm's auth URL, a value outside the allow pattern is dropped, and a
login without it carries none; on the external-discovery branch the
gatekeeper discovers that realm from a local Keycloak stub and passes
the hint. The image is read from the render, so an oauth2-proxy bump
re-checks the alpha configuration. Needs docker, like
`hack/etcd-grpc-alerts.bats`.
- **Real oauth2-proxy v7.12.0 on the rendered config.** Ran with the
rendered args and checked:
  - `/ping` answers OK;
- `/oauth2/start?kc_idp_hint=whmcs` puts `kc_idp_hint=whmcs` into the
Keycloak auth URL;
- `/oauth2/start` without the parameter, or with a value outside the
pattern, does not;
  - a protected path redirects without it;
  - `/apis/*` stays 401;
  - `--ssl-insecure-skip-verify` starts fine alongside `--alpha-config`.
- **Live cluster.** Swapped in the rendered gatekeeper with the
HelmRelease suspended, then reverted:
- a brokered user who was already signed in at the portal went from the
hinted link straight to the dashboard;
  - a plain visit still showed the realm login page;
- a hinted visit without a portal session went straight to the portal's
own login;
- API calls from the console worked, so the `Authorization` header
injection is intact.

### Screenshots

N/A — no console UI changes. The change removes the Keycloak login page
from the hinted flow.

### Downstream repositories

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

The diff touches only the dashboard gatekeeper templates and their
tests. It adds no value, schema, package or platform component. I walked
the trigger map against it, and no entry matches.

### Release note

```release-note
feat(dashboard): a dashboard login link can name the Keycloak identity provider with `/oauth2/start?kc_idp_hint=<alias>`, so users coming from a brokered portal skip the realm login page. The OIDC gatekeeper now runs oauth2-proxy from an alpha configuration kept in a ConfigMap; logins without the parameter are unchanged.
```


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

## Summary by CodeRabbit

* **New Features**
* OIDC-enabled clusters now use updated dashboard sign-in settings,
forwarding identity and token information to the dashboard.
* Authentication requests use Keycloak’s internal URL when configured;
otherwise, logout uses the public Keycloak URL.
  * Sign-in requests include the OpenID, email, and profile scopes.
* Supported identity-provider hints are preserved in sign-in redirects,
while invalid hints are excluded.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-20 17:05:43 +07:00
Andrei Kvapil e11ca91d81 fix(backups): stop leaking MariaDB dumps of stuck runs and torn-down namespaces (#5344)
## What this PR does

Closes #5291. Two paths left a MariaDB dump and its
`k8s.mariadb.com/Backup` behind after the dump cleanup from #5233.

**A run that never completes.** When the operator Backup stays short of
`Complete` past `mariadbDefaultBackupDeadline`, the BackupJob now
deletes it (background propagation, so its Job goes too) before it marks
itself `Failed`, and says so in the failure message. No Cozystack
`Backup` is ever made of such a run, so nothing else deleted it, and
while it stood its window had no end: `contestedMariaDBDump` counted it
as a possible writer of every later dump of the application, and every
later `Backup` was released with `ArtifactNotDeleted`. Deleting the Job
also stops a run that is still going from uploading a dump nobody
tracks. An operator Backup that is `Complete=True` on a reason the
driver does not know has a bounded window and is kept, as before.

The decision is made on the operator Backup read from the API server,
not the cache. A run the operator has just marked complete or failed
goes down the normal path and is not deleted. The delete carries the UID
and resourceVersion that were read, so a run that completes between the
read and the delete is not deleted either. Past the deadline no new run
is created, so a pass that deleted the run and then failed to persist
`Failed` does not start another one on retry. A delete the API server
keeps refusing shows as `Ready=False/OperatorBackupDeleteFailed` on the
BackupJob. The delete also removes the run's pod, so before it the
controller copies what held the pod up into the failure message: an
unschedulable pod, or a container that is waiting or has failed.

The MariaDB driver's other failure exits take the same path: the MariaDB
application was deleted, the MariaDB CR never came back, the strategy
disappeared past its deadline, the strategy no longer renders, the
applicationRef is rejected, or the run could not be created. Past the
deadline, the run is taken from the API server listing and
`ensureMariaDBBackup` is not called, so a cache that has not seen the
run cannot cause a second one to be created. mariadb-operator leaves the
run of a MariaDB that went away at `Complete=False` for good, so if the
application was later recreated under the same name, that run used to
contest every later dump.

The deadline is still 30 minutes from `StartedAt`, but a dump that is
still running at that point is now stopped instead of being left to
finish outside Cozystack.

**Namespace teardown.** mariadb-operator puts no finalizer on its
`Backup`, so during teardown it is usually gone before the Cozystack
`Backup` finalizer runs. When the operator Backup is not found, the
cleanup now:

- takes bucket, prefix and Secret references from the snapshot in
`status.underlyingResources`;
- goes on only for a recorded dump (`k8s.mariadb.com/dump-file`) on the
platform bucket written with the projected platform Secret, reached with
the platform credentials, which do not depend on the namespace;
- keeps the dump, with a `Warning ArtifactNotDeleted`, when another
operator Backup, finished or not, could have written it (the same
`contestedMariaDBDump` check as before);
- retries a failed delete through `retryMariaDBCleanup`, which releases
the `Backup` once the namespace is terminating.

The snapshot and the storage URI now record the storage the run was
created with, whatever its kind, rather than the strategy as rendered
when the run completed. A strategy edited during a run therefore cannot
send the cleanup to the wrong place. The BackupJob looks for its run on
the API server rather than in the cache, so a retry after a failed
status write never starts a second run. A `Running` BackupJob never
starts a run at all, and if its run is gone the job is failed.

A `Backup` with no recorded dump, no snapshot, a dump on another bucket
or written with the tenant's own Secret, or unreadable platform
credentials is released with a `Warning`, as before. A missing operator
CRD keeps the old release path.

The platform-bucket check that `mariadbCleanupConnection` used is now
`mariadbPlatformConnection`, shared by both paths. Its behaviour is
unchanged.

Not covered:
- Operator Backups left behind by BackupJobs that failed before this
change are still there, because terminal BackupJobs are not reconciled
again. Deleting them by hand releases the dumps they hold.
- Deleting a BackupJob that is still running leaves its operator Backup,
which has no ownerRef and no finalizer. This was already the case and is
not addressed here.
- The driver-independent terminal exits in `backupjob_controller.go`
(BackupClass resolution, credentials projection) still fail a BackupJob
without looking at a MariaDB run.
- A run that is stopped at the deadline after it has uploaded its dump
leaves that dump untracked. No `Backup` is ever made of such a run. The
other fail-safe cases listed in the issue (a `Restore` that never
completes, the single `Backup` worker, non-204 DELETE responses,
endpoint moves) are not addressed here.

Tests: `go test ./internal/backupcontroller/...`. The deadline outcome
table now also checks whether the operator Backup was deleted. New
cleanup tests cover a missing operator Backup: the dump deleted with the
platform credentials, already absent, contested by an unfinished run, a
failed delete held for retry, and each case it cannot reach (volume
storage, a recorded name that is not a dump, a snapshot of another
kind). Deadline tests cover a retry after a failed status write, a cache
that trails a completed run or misses a new one, a delete conditional on
the run that was read, a refused delete, and the application or MariaDB
going away mid-run.

### Screenshots

N/A, no UI changes.

### Downstream repositories

I checked the trigger map in `docs/agents/contributing.md` against the
diff. The diff touches `internal/backupcontroller/mariadbstrategy_*.go`
and their tests. It also adds a message helper in
`internal/backupcontroller/backupjob_controller.go` and changes comments
in `internal/backupcontroller/backup_controller.go` and
`packages/system/backupstrategy-controller/templates/rbac.yaml`. No
values, schemas, CRDs, RBAC rules, annotations or telemetry change.

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

### Release note

```release-note
fix(backups): MariaDB dumps are no longer left in the bucket when a backup run never completes or when a tenant namespace is deleted. A BackupJob that times out now deletes the operator Backup it gave up on, so that run no longer blocks the deletion of later dumps. A Backup whose operator Backup is already gone now deletes its recorded dump from the platform bucket using the platform credentials. A MariaDB backup run that has not completed 30 minutes after its BackupJob started is now stopped.
```


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

## Summary by CodeRabbit

* **Bug Fixes**
* MariaDB backup cleanup now removes a recorded dump from the platform
bucket when its operator Backup is already gone, while leaving contested
or insufficiently verified dumps untouched.
* Failed dump deletions are retried, and cleanup reports when a dump is
already absent.
* Backup jobs are less likely to start duplicate runs during retries,
and completed backups retain the storage configuration used by their
run.
* Failure handling preserves completed runs and includes operator-run
completion details when available.
* Backup jobs now recheck the operator Backup before failing on a
deadline, helping account for runs that completed or failed in the
meantime.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-20 04:59:41 -05:00
Marian Koreniuk cfb5119c0b feat(build): attach a provenance attestation beside the SBOM (#5043)
## What this PR does

Follow-up to #4997 (merged as d32092ac9), rebased onto `main` at that
merge: one commit `57db352ed`. The second half of what was agreed there:
beside the SBOM, each release image gets a SLSA provenance statement
from BuildKit, in the same attestation manifest.

Refs #4759, #3278

`SBOM=1` in `hack/common-envs.mk` now passes `--attest
type=provenance,mode=min` with the SBOM attest, in place of
`--provenance=false`; a build without `SBOM=1` keeps
`--provenance=false` as before. BuildKit writes both predicates into the
one attestation manifest per platform, so the index shape
`hack/stitch-multiarch.sh` and `hack/verify-multiarch.sh` read after
#4997 is unchanged, and a signature over the index covers the provenance
as it covers the SBOM. `mode=min` records the build times, the build
platform, the frontend and the BuildKit version and leaves out the build
arguments and the secrets, which `mode=max` would write in, so it can
ride every release image. `docker buildx imagetools inspect
<image>@<digest> --format '{{ json .Provenance }}'` prints it;
`docs/release.md` says so.

### How it was checked

- `hack/common-envs_test.bats`: the `SBOM=1` test now also holds that
`--attest type=provenance,mode=min` is passed, that `--provenance=false`
is not, that neither `mode=max` nor `--provenance=true` appears, and
that the default build still passes `--provenance=false` and no
`--attest`. `make -n` of `packages/system/cozystack-controller` shows
exactly that in both modes. `hack/stitch-multiarch_test.bats` is green:
the attestation manifest count per platform does not change.
- A real build, by @myasnikovdaniil on a local registry: amd64 and arm64
built with the flags from `common-envs.mk`, stitched,
`verify-multiarch.sh` passes, the index has four manifests (two images,
two attestation manifests with SBOM and provenance each), `.Provenance`
reads for both platforms, and a `--build-arg` value is in `mode=max` and
not in `mode=min`.
- Rebased on `main` at d32092ac9: `hack/common-envs_test.bats` and
`hack/stitch-multiarch_test.bats` 34/34.
- Not checked: the provenance predicate on a release runner. The first
alpha after the merge shows it.

### Decisions for the release owners

- `mode=min` rather than `mode=max`: the Dockerfiles take `--build-arg`
values a reader of a public attestation should not see by default. If a
package's arguments are all public, `max` is one word away.
- `docs/security/self-assessment.md` still says build provenance is
disabled (`--provenance=false`). It stays until the first alpha shows
provenance on a release image, as #4997 holds its SBOM row.
- PR, main and nightly builds stay without provenance, as they stay
without an SBOM: nothing reads it there, and the default docker driver
cannot attach it.

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

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

I walked the trigger map against the diff. `hack/common-envs.mk` changes
the flags one variable expands to and no target, variable name or file
that ccp's skills anchor on; nothing else is touched.

### Release note

```release-note
feat(build): every release image built with `SBOM=1` also carries a SLSA provenance statement (BuildKit `mode=min`: build times, platform, frontend and BuildKit version, no build arguments or secrets) in the same attestation manifest as its SBOM, readable with `docker buildx imagetools inspect <image>@<digest> --format '{{ json .Provenance }}'`.
```



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

## Summary by CodeRabbit

* **New Features**
* Container builds with SBOM generation enabled now include both an SPDX
software bill of materials and a minimal SLSA provenance attestation.
  * Provenance attestations remain disabled when SBOM generation is off.

* **Documentation**
* Updated the container image security guide with details on provenance
contents and how to inspect the attestation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-20 10:32:33 +01:00
Andrey Kolkov 65f0943710 fix(opensearch): disable the Base64 intrinsics hit by CVE-2026-114938
CVE-2026-114938 is an out-of-bounds write in the AVX-512 VBMI Base64
decoder of OpenJDK 17.0.6 and later, reachable on x86-64 hosts with
attacker-supplied Base64. OpenSearch decodes the Basic credentials of a
request before it authenticates it, so a tenant's cluster is exposed to
anyone who can reach its HTTP port.

Two of the three versions this chart offers bundle an affected JDK:
opensearchproject/opensearch:3.0.0 carries 21.0.7 and 2.11.1 carries
17.0.8. 1.3.20 carries 11.0.25, which is not affected. OpenSearch has
not released a build on a patched JDK yet.

Start the nodes with -XX:-UseBASE64Intrinsics, which removes the
vulnerable code path and leaves the other AVX-512 optimizations in
place. It is delivered as a jvm.options.d file mounted from a
ConfigMap, because neither obvious route works: bin/opensearch-env
unsets JAVA_TOOL_OPTIONS, and setting nodePools[].jvm makes the
operator stop sizing the heap from the memory request. The operator
mounts general.additionalVolumes into the node pools and the bootstrap
pod alike.

Rolling this out restarts every OpenSearch cluster once.

Tested with helm unittest, and by starting 3.0.0, 2.11.1 and 1.3.20
with the file mounted: each server JVM runs with the flag, and the heap
passed in OPENSEARCH_JAVA_OPTS still applies.

Assisted-by: LLM
Signed-off-by: Andrey Kolkov <androndo@gmail.com>
2026-11-20 16:28:21 +07:00
Andrey Kolkov 0ec0add620 chore(keycloak): bump Keycloak server to 26.8.2
quay.io/keycloak/keycloak:26.6.3 bundles OpenJDK 21.0.11, which is
affected by CVE-2026-114938, an out-of-bounds write in the AVX-512 VBMI
Base64 decoder that Keycloak reaches before authentication. Upstream
fixed it by rebuilding the 26.8.2 image on OpenJDK 21.0.13.1 and did
not rebuild 26.6 or 26.7.

Pin the 26.8.2-3 tag: 26.8.2 moves when upstream rebuilds it, and
26.8.2-1 and 26.8.2-2 still carry the affected JDK.

keycloak-configure runs kcadm.sh from the same image and was still on
26.5.2; move it along so the admin client matches the server.

Tested by upgrading a two-replica 26.6.3 instance in place: the rolling
update migrated the database and both realms to 26.8.2, the old and the
new node shared one cluster while it ran, the keycloak-operator
reconciled every resource against the new Admin API, and the kcadm.sh
hook passed.

Assisted-by: LLM
Signed-off-by: Andrey Kolkov <androndo@gmail.com>
2026-11-20 16:23:21 +07:00
Andrey Kolkov 7f31011b99 fix(backups): delete the Velero backup of a failed BackupJob (#5364)
<!-- Thank you for making a contribution! Here are some tips for you:
- Use Conventional Commits for the PR title: `type(scope): description`
- Types: feat, fix, security (a fix that comes through a security
advisory), docs, style, refactor, perf, test, build, ci, chore
- Scopes are not an exhaustive list — pick the most specific scope for
the change and extend the list when a genuinely new area appears.
Examples:
- System components: dashboard, platform, operator, cilium, kube-ovn,
linstor, fluxcd, cluster-api
- Managed apps: postgres, mariadb, redis, kafka, clickhouse,
virtual-machine, kubernetes
- Development and maintenance: api, hack, tests, ci, docs, maintenance
- Breaking changes: append `!` after type/scope (`feat(api)!: ...`) or
add a `BREAKING CHANGE:` footer
- If it's a work in progress, consider creating this PR as a draft.
- Don't hesistate to ask for opinion and review in the community chats,
even if it's still a draft.
- Fixes merged to `main` reach the release lines the backport batch runs
for automatically, so do not open backport PRs by hand:
https://github.com/cozystack/cozystack/blob/main/docs/release/backports.md
-->

## What this PR does

<!-- Link the issues this PR addresses. For a complete fix targeting the
default branch, use Closes #N (Closes owner/repository#N for another
repository). Otherwise use a non-closing reference; release-branch PRs
need manual issue linking and closure when appropriate. -->

Closes #5355

A BackupJob whose Velero backup ends `Failed` or `PartiallyFailed`
leaves that `backup.velero.io` object and its data in the backup bucket
(partial resources, logs) until Velero's TTL expires it, 720h by
default. No `Backup` is created for a failed run, and the `Backup`
finalizer was the only code that asked Velero to delete backup data;
deleting the BackupJob does not remove it either, because the Velero
backup is only labelled for the job, not owned by it.

The first commit requests deletion of the failed Velero backup through a
`DeleteBackupRequest`, and turns the reconcile of a `Failed` BackupJob,
which returned at once, into a sweep over the Velero backups still
labelled for the job. That sweep also cleans up backups leaked by
earlier versions after an upgrade. The request creation is shared with
the `Backup` finalizer and named after the Velero backup, so repeated
reconciles converge on one request. The failure message is unchanged.

The second commit narrows that sweep and makes it converge:

- Only `Failed`, `PartiallyFailed` and `FailedValidation` Velero backups
are deleted. A `Completed` one is never touched from a job-level
failure: a job can fail after Velero completed (creating or recording
the `Backup` failed), and that Velero backup may be the only copy of
good data.
- Deletion is requested only after `Failed` is persisted. The strategy
no longer sends the request inline, so a failed status write cannot
leave a retried run without the backup it reports the failure from. The
BackupJob watch has no predicate, so the `Failed` status update itself
triggers the sweep.
- While a failed backup still exists, the job is requeued every 5
minutes. Nothing watches `DeleteBackupRequest`, so this is how a request
Velero processed with errors is noticed and replaced. A backup that is
still running is rechecked every minute.
- Backups that reference the Velero backup are read through the uncached
API reader before anything is deleted.
- The ClusterRole of `backupstrategy-controller` gains `delete` on
`deletebackuprequests`, needed to replace a processed-with-errors
request. The `Backup` finalizer shares the helper, and without the verb
that path would fail with 403.

The third commit makes a deletion that Velero could not finish converge,
and makes it visible:

- A Velero backup in `Deleting` goes through the same request path.
Velero sets that phase before it removes the data and leaves it there
when removal fails, so skipping it left the data in place until the TTL.
- Our own request that Velero processed while the backup still exists is
replaced, whether it carries errors or not. The second case is a backup
that the BSL sync brought back.
- Each replacement emits a `VeleroBackupDeletionFailed` Warning event on
the BackupJob with Velero's `status.errors`, and doubles the wait before
the next replacement, 5 minutes up to 1 hour (enforced from the recorded
attempt time since the fourth commit). The count is kept in the
`backups.cozystack.io/velero-deletion-retries` annotation on the
BackupJob. A missing, read-only or unavailable BSL therefore shows up in
`kubectl describe` instead of being retried silently every 5 minutes.

The fourth commit makes the backoff binding rather than advisory:

- Each request the sweep creates records its time in the
`backups.cozystack.io/velero-deletion-attempted-at` annotation, next to
the retry counter. A request Velero has processed is replaced only once
the backoff for the current retry count has passed since that time.
Writing the annotations triggers a reconcile at once, because the
BackupJob watch has no predicate; that reconcile now only computes the
remaining wait. Before, with a BSL that fails instantly, it could
replace the request again right away.
- A request Velero has not processed yet, and a Velero backup still in
`New` or with no phase, are checked again after as long as they have
already waited: between 5 minutes (1 minute for a running backup) and 1
hour. Waiting emits no event.
- If the job was deleted before the annotations are written, the sweep
stops quietly. Any other error writing them is logged, and the computed
requeue is kept, because the request already exists.

Points for the reviewer:

- The sweep matches on the BackupJob labels, not on the strategy kind,
because a `Failed` job's BackupClass may be gone. The Kubernetes
strategy labels its Velero backup the same way and has the same leak on
failure, so a failed Kubernetes strategy run is cleaned up by the sweep
as well.
- The Velero strategy still treats a `FailedValidation` Velero backup as
in progress and requeues the BackupJob indefinitely. That is unchanged
here; the sweep already treats `FailedValidation` as deletable.
- After the upgrade, the Velero backups of BackupJobs that already
failed are deleted. An operator who wants one of them for a manual
`velero restore` must copy it first.

### Screenshots

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

N/A — no UI changes.

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

The diff touches Go code in `internal/backupcontroller/` and one chart
file, `packages/system/backupstrategy-controller/templates/rbac.yaml`,
which adds the `delete` verb on `deletebackuprequests` to the
controller's ClusterRole. Walked against the trigger map:

- website: no package, platform value, variant, component, release
asset, ApplicationDefinition, Talos or tooling change. The ClusterRole
is not documented there.
- terraform-provider-cozystack: no app, schema field, enum, default,
`kind`/`plural`, prefix, or `Package`/`Plan`/`RestoreJob` CRD change.
- ansible-cozystack, talm, examples: no installer value, namespace,
variant, platform value, node prerequisite, or object the role waits on.
- ccp, external-apps-example: nothing under `hack/`, no package layout,
`-rd` path, variant, `tags.yaml`, `ApplicationDefinition` CRD or
commit-convention change.
- cozyhr, cozy-proxy, cozystack-telemetry-server, community: none of
their annotations, labels, metrics, `hack/package.mk` targets, PR
template or commit convention change.

No entry applies.

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

### Release note

<!--  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(backups): a BackupJob whose Velero backup ends Failed, PartiallyFailed or FailedValidation now asks Velero to delete that backup and its data in the bucket, instead of leaving them until Velero's TTL expires. A Velero backup that completed is never deleted this way. If Velero cannot carry out the deletion (for example, the backup storage location is missing, read-only or unavailable), the BackupJob gets a `VeleroBackupDeletionFailed` Warning event with Velero's errors, and the deletion is retried at a growing interval of up to one hour. After upgrading, the Velero backups of BackupJobs that already failed are deleted as well; to keep one for a manual `velero restore`, copy it before the upgrade. The backupstrategy-controller ClusterRole gains `delete` on `deletebackuprequests`.
```
2026-11-20 01:07:55 +07:00
Aleksei Sviridkin c98a345aa1 docs(api): clarify health check parsing and evaluation (#4495)
## What this PR does

Clarifies the lifecycle of HelmRelease CEL health checks.

helm-controller parses and validates these expressions and creates a
status reader factory before choosing how to wait. The factory
constructs the concrete status reader when the selected wait path
creates its resource manager. Invalid configuration can therefore stall
the HelmRelease with reason InvalidCELExpression even when the
release.cozystack.io/helm-install-disable-wait annotation is set or the
legacy wait strategy is selected. Once setup succeeds, only
helm-controller's poller evaluates expressions: while a Helm action
waits under the poller strategy, and for Helm hooks, which are still
waited on when the annotation disables wait. Without the annotation, the
legacy strategy never evaluates them. With it, hooks are evaluated
whatever the strategy, because disabling wait takes precedence.

The monitoring template comment now also distinguishes an existing
status object without `updateStatus` from a completely absent top-level
`status` key. The former evaluates the predicates to false, while the
latter can produce an evaluation error and an Unknown result. The poller
continues waiting in both cases.

The CEL expressions and runtime behavior are unchanged. The generated
ApplicationDefinition CRD description was regenerated from the Go field
documentation.

Fixes #4388

### Screenshots

N/A — no UI changes.

### Downstream repositories

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

### Release note

```release-note
NONE
```

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

* **Documentation**
* Clarified when health-check expressions are validated and evaluated
across wait strategies and Helm hooks, including how invalid expressions
can affect Helm releases.
* Explained how missing status fields affect health-check results and
that polling continues until the resource is operational or times out.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-19 19:45:54 +03:00
Andrey Kolkov dbc088f862 fix(backups): enforce the Velero deletion backoff of failed BackupJobs
The retry backoff of the failed-job sweep only set RequeueAfter. Writing the
retry counter onto the BackupJob triggers a reconcile at once, since the
BackupJob watch has no predicate. When Velero processes a request instantly,
as it does when the backup storage location is missing or read-only, that
reconcile replaced the request again, emitted another event and raised the
counter without any wait. The sweep now records when it last created a
request, in the backups.cozystack.io/velero-deletion-attempted-at annotation,
and replaces a processed request only after the backoff for the current
count has passed since then. Before that, it requeues for the remaining
time.

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

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

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

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

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

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

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

Refs: #5355
Assisted-by: LLM
Signed-off-by: Andrey Kolkov <androndo@gmail.com>
2026-11-19 20:56:45 +07:00
Adham Kiwan 5c690f96bd docs(gateway): stop saying the route-hostname policy admits hostname-less routes
Since 1.7 cozystack-route-hostname-policy requires spec.hostnames to be
present and non-empty on HTTPRoute, TLSRoute and GRPCRoute in tenant-*
namespaces, so the edge-termination section no longer matches the
platform. The website builds its Gateway reference page from this
README, so the stale sentence would be published as is.

Refs: #4938
Assisted-by: LLM
Signed-off-by: Adham Kiwan <adhamkiwan@outlook.com>
2026-11-19 15:47:11 +02:00
Andrey Kolkov 421dc2a0a7 test(dashboard): require the exact hint in the e2e redirect check
The case pattern *kc_idp_hint=e2e-idp* also accepted e2e-idp-other
and xkc_idp_hint=e2e-idp. Match the parameter as a whole: preceded by
&, followed by & or the end of the URL.

Assisted-By: LLM
Signed-off-by: Andrey Kolkov <androndo@gmail.com>
2026-11-19 20:44:54 +07:00
Andrey Kolkov 887453c008 fix(backups): keep completed Velero backups of failed BackupJobs
The failed-job sweep treated a Completed Velero backup as deletable. A
BackupJob can fail after Velero completed, when creating or recording its
Backup fails transiently, and that Velero backup may be the only copy of a
good backup. The sweep now deletes only Failed, PartiallyFailed and
FailedValidation backups, also when several Velero backups reference one
job, and it reads the Backups that may reference them through the uncached
API reader, so a Backup the cache has not seen yet still protects its data.

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

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

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

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

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

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

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

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

Closes: #5355
Assisted-by: LLM
Signed-off-by: Andrey Kolkov <androndo@gmail.com>
2026-11-19 20:31:34 +07:00
Adham Kiwan 589c895d59 test(migrations): build each migration test image once per file
Every test in the migration 54, 55, 57, 58, 59 and 61 bats files called
prep(), and prep() ran `docker build -t` for one fixed tag. Tests in a
file run concurrently under bats -j, so on a cold cache several builds
of that tag ran at once. With the containerd image store a retag to a
different image deletes the old one before creating the new one, and a
sibling's `docker run` that resolved the tag in between found nothing
locally and fell back to a pull of an image that does not exist.

Build the image in setup_file, before any test of the file starts.
prep() keeps a fallback build for a run without setup_file, taken only
when the tag is missing.

Closes: #5299
Assisted-by: LLM
Signed-off-by: Adham Kiwan <adhamkiwan@outlook.com>
2026-11-19 15:16:30 +02:00
Adham Kiwan ffb3b6faf3 test(hack): check hook scripts under files/ for --request-timeout
The guard against a non-zero --request-timeout on in-cluster kubectl
calls only read chart templates. A chart that loads its hook script with
.Files.Get runs it with the same in-cluster credentials, so a flag in
packages/*/*/files/ went through unchecked; a review, not the guard,
caught it in #4915. It also matched only the --request-timeout=<value>
form, while kubectl accepts --request-timeout <value> as well.

Scan shell scripts under files/ too, recognised by a .sh suffix or a
sh/bash shebang, through env or env -S included, and match the
space-separated form and quoted values when a non-zero number follows,
so prose about the flag in comments stays quiet. The new cases run the
scan on a throwaway tree.

Closes: #5304
Assisted-by: LLM
Signed-off-by: Adham Kiwan <adhamkiwan@outlook.com>
2026-11-19 15:12:48 +02:00
Yan Bondarenko a314dacb86 fix(platform): honour a bool false in ingress-enabled and monitoring-enabled
Helm's default treats a bool false as empty, so an unquoted false in
either _cluster flag still rendered _namespace.ingress and the monitoring
redirects. Check for a missing key first and require "true" or a bool
true otherwise.

Assisted-by: LLM
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
2026-11-19 12:41:02 +01:00
Aleksei Sviridkin d88322197f chore(deps): roll up Renovate updates and raise dependencies to latest stable (#4869)
## What this PR does

One PR instead of separate Renovate PRs. Go modules, Dockerfile base
images and GitHub Actions move to newer versions that build and pass the
tests. Where a newer version is known to break something, it stays
behind, and `.github/renovate.json` holds it with the reason in the rule
description.

The tests come first, in their own commits:

- `make go-unit-tests` runs the Go tests under `pkg/` and `cmd/`, except
the backport-batch suite, which keeps its own target. The apiserver
serializer and fuzz tests, the generated OpenAPI and applyconfiguration
suites, the apis packages and the controller, operator and
observability-proxy commands did not run in CI before.
- The apps API surface that apiserver libraries shape is pinned:
server-side apply, content negotiation, Table output on watch, the
served OpenAPI v2 and v3 documents, and building the server without
etcd. Two answers look wrong and are pinned as they are today: applies
from different field managers never conflict (#4857), and protobuf is
refused with 406 even when the client offers JSON as a fallback (#5297).
- New tests cover the kubeovn webhook patch, the token proxy session
cookie and the mount-utils behaviour the kubevirt CSI node service
relies on.
- `hack/image-smoke.bats` checks the tools the CSI, LINSTOR, multus,
Harbor and redis-backup images take from their base images or build
stages, and that the kubevirt CSI node plugin and its sidecars need no
more than x86-64-v2. Each PR build job runs it against the images it
pushed; forks and the unit lane run no container.

The tests found two bugs:

- The kubeovn webhook dereferenced a nil pointer on an admission review
without a request, so the caller got a dropped connection instead of a
400.
- The token proxy cookie refresh never fired: securecookie decodes the
session times as int64 and the refresh looked for float64, so the
`--cookie-refresh=1h` the chart sets did nothing. A refreshed cookie
keeps the token's expiry. A session too large to encode now shows an
error at sign-in and leaves the current cookie alone on refresh.

What moved:

- GitHub Actions to their Node 24 majors. The flux action stays on the
tag of the Flux CLI it installs. The release job's checkout no longer
persists credentials, so its staging branch push uses the App token.
- Go 1.27.2 for the toolchain and builders. Builds that reproduce an
upstream release keep the Go upstream uses: Harbor, cilium-operator,
SeaweedFS and the chainsaw stage of the e2e sandbox.
- controller-runtime v0.25.2, gateway-api v1.6.3 on the minor of the
installed v1.6.1 CRDs, cel-go v0.30.0, grpc v1.84.0, etcd v3.7.2,
cert-manager v1.21.2, kubevirt csi-driver f10ae94 on Kubernetes v0.37.1.
- Node 24 for the dashboard console.

Held back, each with its reason in the Renovate rule:

- cel-go stays below v0.31: the old repository has no tags past v0.30.0,
and v0.32 moves to cel.dev/cel-go, which k8s.io/apiserver does not
import.
- kube-openapi stays on the commit its dependencies require, and
structured-merge-diff stays on v6, because k8s.io/apimachinery v0.37
does not compile against v7.
- The Flux API modules stay on the Flux v2.8 line the platform installs.
- gomodules.xyz/jsonpatch stays on v2, which controller-runtime's
admission.Patched takes.
- jwx stays on v3: v4 removes jwk.Cache, which the token proxy's JWKS
refresh is built on.
- kubevirt.io/api and the CDI API stay where upstream csi-driver builds.
- The kubevirt CSI driver image stays on AlmaLinux 9, because AlmaLinux
10 builds its amd64 userland for x86-64-v3.
- shadowbox stays on node 18, which outline-server declares in its
engines.
- The e2e sandbox stays on Ubuntu 24.04. 26.04 ships uutils coreutils,
whose `date` costs about 4x per call, and the test harness forks it per
traced line, which adds about ten minutes to the install phase.
- clastix/kubectl stays on v1.32 for the cleanup hooks, within kubectl's
one-minor skew.

The cert-manager Go module (v1.21.2) is one minor ahead of the installed
chart (v1.20.2). The Certificate objects the gateway controller writes
serialize the same either way.

`api/apps/v1alpha1` now requires Go 1.27.2, which applies to every
module that imports the published types.

The Linux run with Go 1.27.2 was done before the rebase onto current
main, and the rebased head has not been through it yet. There the five
modules built, vetted, tested and tidied cleanly, and the repository
unit, controller and envtest lane passed. `go test -race` passed in four
modules. In the root module it failed only on a pre-existing data race
in the workload monitor tests (#5296), which main has too. The image
smoke checks run in this PR's CI.

### Screenshots

No UI change.

### Downstream repositories

`api/apps/v1alpha1` moves to `go 1.27.2`, and
cozystack/terraform-provider-cozystack imports it, so that repository is
affected but needs no action. Its box stays empty for that reason, and
so does the "not affected" one.

- [ ] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up:
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up: none needed, because its Renovate raises the go directive
together with the pin bump and its CI takes Go from `go.mod`; the only
effect is that the provider's minimum Go becomes 1.27.2.
- [ ]
[cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack)
- follow-up:
- [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up:
- [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up:
- [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) -
follow-up:
- [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) -
follow-up:
- [ ]
[cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server)
- follow-up:
- [ ]
[cozystack/external-apps-example](https://github.com/cozystack/external-apps-example)
- follow-up:
- [ ] [cozystack/examples](https://github.com/cozystack/examples) -
follow-up:
- [ ] [cozystack/community](https://github.com/cozystack/community) -
follow-up:

### Release note

```release-note
chore(deps): move the toolchain and builder images to Go 1.27.2 and raise Go modules, base images and GitHub Actions to newer working releases; the dashboard token proxy now refreshes its session cookie, and the kube-ovn webhook rejects an admission review without a request instead of dropping the connection.
```
2026-11-18 14:42:34 +03:00
Aleksei Sviridkin 693ff070e5 chore(goldpinger): bump vendored chart to 1.2.0 (#4877)
## What this PR does

Update the vendored Goldpinger chart to include upstream Gateway API
support for the work tracked in #4788. HTTPRoute and UDP probing remain
disabled by default.

With the package's current values, the rendered resources differ only in
the image tag and version labels. The DaemonSet selector is unchanged.
The umbrella chart also declares the vendored dependency so Helm can
lint it.

### Screenshots

Not applicable. This PR updates the chart and package metadata; it does
not change the UI source.

### 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
chore(goldpinger): bump vendored chart to 1.2.0 (goldpinger 3.11.5); new HTTPRoute and UDP probe options are disabled by default
```
2026-11-18 14:42:27 +03:00
Aleksei Sviridkin 9813d13dcd fix(kamaji): drop kubelet config fields older tenants do not know (#4896)
## What this PR does

Older tenant Kubernetes versions receive kubelet config fields they do
not know. The pinned Kamaji 26.9.4-edge build uses the Kubernetes 1.37
libraries to render `kube-system/kubelet-config`:

| Field | Known since | Rendered for tenants |
| --- | --- | --- |
| `memoryReservationPolicy` | 1.36 | v1.31 to v1.35 |
| `mergeDefaultEvictionSettings` | 1.33 | v1.31 to v1.32 |
| `crashLoopBackOff` | 1.32 | v1.31, as `crashLoopBackOff: {}` |

On a v1.35 tenant, `kubeadm join` logs:

```text
configset.go:176 error unmarshaling configuration schema.GroupVersionKind{Group:"kubelet.config.k8s.io", Version:"v1beta1", Kind:"KubeletConfiguration"}: strict decoding error: unknown field "memoryReservationPolicy"
```

Nodes still join, because kubeadm only logs this and decodes leniently,
dropping the field. Anything that decodes this ConfigMap strictly fails.

The compatibility patch drops these fields when the tenant version
predates them, including fields added by a user JSON patch. Supported
fields are kept. The version checks conservatively treat a pre-release
as older than its minor; early alpha releases can lack that minor's
fields. A running tenant gets the cleaned ConfigMap the next time Kamaji
uploads it.

JSON removals cannot fully replace this on the current build: Kamaji
decodes patched JSON back into a Go struct, restoring a removed
`crashLoopBackOff` as `{}`. The kubernetes chart also does not render
`kubelet.configurationJSONPatches`.

Upstream fixed JSON patch removal in 26.10.4-edge (clastix/kamaji#1347).
With that bump, the chart can render version-dependent removals and
replace this compatibility patch. This PR keeps the fix for 26.9.4-edge.

The regression tests cover field presence for tenants v1.31 to v1.37,
selected pre-releases, user patches, invalid versions, defaults and
`UploadKubeletConfig` with a fake client. The image build runs the tests
of packages touched by its patches.

Tested on Linux:

- Against upstream Kamaji commit
`1c3d84ae94473e94945ad01b2540ec319478bce4`, the new tests fail with the
current main patch in the three compatibility tests. With this patch,
the Go tests in every package touched by the patches pass, and the
Kamaji build succeeds.
- The repository unit lane passes.

I did not run a strict-decoding matrix against each Kubernetes minor for
this version.

### 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(kamaji): stop writing kubelet config fields that older tenant Kubernetes versions do not know, such as memoryReservationPolicy on tenants before v1.36, so strict decoders of the kubelet-config ConfigMap no longer fail.
```
2026-11-18 14:42:20 +03:00
Aleksei Sviridkin 1d64d077e3 Merge branch 'main' into issue-4388
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-18 13:38:20 +03:00
Aleksei Sviridkin fd426c7e4b build(monitoring): respin the Alerta image on a patched base (#5334)
Supersedes #5244 and #5333: the same change from an in-tree branch, so
CI can build the new image. Includes main merged in and the test fixture
fix from #5333.

## What this PR does

Alerta 9.1.0 is the latest upstream release, and
`alerta/alerta-web:9.1.0` still ships the Debian packages of its build
day, the compiler toolchain and `-dev` headers it built wheels with, and
Python packages whose fixes landed after the release. The monitoring
chart ran that image by tag, without a digest.

This builds the Alerta image in-tree from the upstream one:

- `images/alerta/Containerfile` starts from `alerta/alerta-web:9.1.0`
pinned by its index digest, upgrades the OS packages, purges the
build-only packages and lifts the affected Python packages within the
ranges the installed packages declare (`pip check` gates the build).
`cryptography` stays below 47 because `pyOpenSSL` requires it; `lxml`
stays on 5.x.
- The result is copied into an empty image so the purged files are
really gone, and the upstream image config (env, user, ports,
entrypoint, command) is restated exactly; `docker-entrypoint.sh` renders
the nginx, uWSGI and Alerta configs from those variables. The image is
752 MB against 1.32 GB upstream; a purge layer on top would have made it
1.78 GB.
- `make image` builds it as `alerta:v9.1.0-cozystack.0` and writes the
digest into `alerta.image`, like the traces collector. Until then the
default is the digest-pinned upstream image.
- The Deployment takes the image from `alerta.image` through
`cozy-lib.image`, so mirrored-registry installs work for Alerta as they
do for Grafana.

Trade-off: `apt-get upgrade` takes whatever Debian has at build time, so
two builds of one revision can differ. That is what a respin is for;
bump `ALERTA_COZYSTACK_REV` to publish a fresh one.

Testing (podman, amd64):

- With `postgres:17-alpine` and the chart's env, Alertmanager v4
webhooks to `/api/webhooks/prometheus`: firing critical → 201 and the
alert open; `event=Heartbeat` → 202 and the heartbeat recorded; resolved
→ 201 and the alert closed. Admin login 200, UI 200, no ERROR in the
logs, and `alerta_telegram`, `alerta_slack`, `alerta_prometheus` import.
Upstream 9.1.0 gives the same results with the same script.
- `trivy rootfs`, CRITICAL and HIGH: 29/940 → 3/76. The three critical
left (sqlite CVE-2025-7458, libxml2 CVE-2026-6653, zlib CVE-2023-45853)
and every remaining Debian HIGH have no Debian 12 fix; the remaining
Python HIGH are cryptography and lxml, held back as above.
- `helm unittest .` (306 tests, including the new
`tests/alerta_image_test.yaml`) and `helm template`.
- arm64 was not built locally; aarch64 cp313 wheels exist for every
upgraded Python package, so the purged toolchain is not needed there.

### Screenshots

No UI changes.

### Downstream repositories

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

(Trigger map walked against the diff: only packages/system/monitoring —
an image build, a values key with no schema, a template line and a test.
No apps/extra package, schema, platform value, hack tooling or CRD
changes.)

### Release note

```release-note
build(monitoring): Alerta now runs a cozystack respin of 9.1.0 on an upgraded Debian base, without the build toolchain and with patched Python dependencies; its image is pinned by digest and follows the cluster images registry.
```


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

## Summary by CodeRabbit

* **Updates**
  * Alerta now runs from a pinned, refreshed container image.
* The Alerta image can be configured, and deployments respect the
configured image registry.
* The default image is replaced with the Cozystack-built image when
using the image build workflow.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-18 13:28:26 +03:00
Aleksei Sviridkin a3e60ec372 feat(kafka)!: run on Strimzi 1.2.0 and Kafka 4.x (#4900)
<!-- Thank you for making a contribution! Here are some tips for you:
- Use Conventional Commits for the PR title: `type(scope): description`
- Types: feat, fix, security (a fix that comes through a security
advisory), docs, style, refactor, perf, test, build, ci, chore
- Scopes are not an exhaustive list — pick the most specific scope for
the change and extend the list when a genuinely new area appears.
Examples:
- System components: dashboard, platform, operator, cilium, kube-ovn,
linstor, fluxcd, cluster-api
- Managed apps: postgres, mariadb, redis, kafka, clickhouse,
virtual-machine, kubernetes
- Development and maintenance: api, hack, tests, ci, docs, maintenance
- Breaking changes: append `!` after type/scope (`feat(api)!: ...`) or
add a `BREAKING CHANGE:` footer
- If it's a work in progress, consider creating this PR as a draft.
- Don't hesistate to ask for opinion and review in the community chats,
even if it's still a draft.
- Fixes merged to `main` reach the release lines the backport batch runs
for automatically, so do not open backport PRs by hand:
https://github.com/cozystack/cozystack/blob/main/docs/release/backports.md
-->

## What this PR does

This upgrades the Kafka operator to Strimzi 1.2.0. Kafka 4.3 is the
application default, with 4.2 also available. Upgrades must pass through
Cozystack v1.7 and finish the ZooKeeper-to-KRaft migration first.

The upgrade now stops while any Kafka lacks KRaft evidence. Every Kafka
must report a nonempty `kafkaMetadataVersion` and the `KRaft` metadata
state. The API conversion deletes that state, so without it a Kafka
needs `Ready=True` or the `cozystack.io/kraft-verified` annotation,
which migration 61 writes on every Kafka it accepts before it stops the
operators. Any other explicit state blocks, and the error gives the
reason for each Kafka. On every variant, the platform chart refuses to
switch package sources while Strimzi still serves `v1beta2` and a Kafka
fails that check. On variants without the migration hook, it also
refuses while any Strimzi CRD still stores `v1beta2`, so
`/migrations/61` has to run first. Migration 61 checks the same evidence
again, including on repeat runs, and blocks unfinished broker-pool
drains. A manual change that bypasses the managed package source is
outside this check.

Existing Kafka 3.x applications move to v4.3. Kafka 4 no longer accepts
clients older than Kafka 2.1. Kafka 4 also rejects the topic settings
`message.format.version`, `message.downconversion.enable` and
`message.timestamp.difference.max.ms`, and a `segment.bytes` below 1 MiB
(1048576), which Kafka 3.x accepted down to 14 bytes. A Kafka 4 broker
whose log holds such a topic does not start. The chart now refuses to
render a topic that sets any of these. The platform upgrade refuses to
start while a Kafka application sets one, and migration 61 also checks
KafkaTopic resources, so topics created outside the chart are caught
too. A topic created through the Kafka admin API without a KafkaTopic is
not visible to these checks. Restoring a topic-metadata backup taken on
Kafka 3.x skips the three removed settings and raises a smaller
`segment.bytes` to 1 MiB, with a warning for each. In-place downgrades
are unsupported. The default 10-minute Helm timeout can leave a long
broker roll Failed until its retry succeeds.

The migration does not run automatically on every platform variant. Only
the `isp-*` variants run it automatically. On other variants, run
`/migrations/61` from the matching migrations image before upgrading, as
the Kafka README describes. This includes clusters that run no Kafka but
have the kafka-operator package, from the `paas` bundle or
`bundles.enabledPackages`. Their Strimzi CRDs still store `v1beta2` even
with no objects. The migration converts Strimzi resources and stored
Helm references to `v1`. It stamps platform version 62. Running it
manually also skips earlier migrations on a later move to an `isp-*`
variant. Before it stops the operators, migration 61 refuses objects
that the Strimzi 0.51 conversion tool would reject and names each one,
for example a Kafka with `.spec.kafka.resources` or with OAuth, Keycloak
or OPA settings. A failed conversion can leave the old operators stopped
until the migration succeeds and the operator release upgrades. The
failed conversion Job stays for diagnosis, but its ClusterRole, binding
and ServiceAccount are removed. A Job that is still running when the
wait times out keeps them, because the retry waits for it.

Known limitations. Migration 61 converts with the old operator stopped,
while Strimzi's conversion guide expects a running operator of 0.49 or
later. I stop it because 0.45 keeps writing the Kafka status through
`v1beta2`, but I have not checked this on a live cluster. Objects
Strimzi created keep `ownerReferences` to `v1beta2` until Strimzi 1.2
reconciles them. Deleting a Kafka before that can leave dependents
behind, and the chart's pre-delete hook covers only StrimziPodSets. The
conversion image is pulled from quay.io by digest with no values
override, so an air-gapped cluster has to mirror it under the same name.

The full offline unit run passed on Linux on
`1171d63adfafb45be34214fb9a0f565723e255fd`: 2,576 cases, no failures,
errors or skipped tests. Later changes were checked on `69c704499fa4`
with the Bats tests for migration 61, the migration runner, the Kafka
hooks and the Kafka backup scripts (102), the platform Helm suite (310
tests) and the Kafka Helm suite (91 tests). After the rebase onto `main`
at `5a5d5cd3d85f`, `a48a2f259947` passes the same Bats tests (115) and
the platform and Kafka Helm suites (326 and 103 tests). It also passes
the new check against added `documentIndex` selectors. I have not
validated this revision on a live cluster.

Closes #4365

### Screenshots

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

Not a UI change.

### Downstream repositories

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

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

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

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

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

The Terraform provider does not model the Kafka `version` field. The
website issue covers the upgrade notes the `default` variant needs.

### Release note

<!--  Write a release note:
- Explain what has changed internally and for users.
- Start with the same `type(scope):` prefix as in the PR title
- Follow the guidelines at
https://github.com/kubernetes/community/blob/master/contributors/guide/release-notes.md.
-->

```release-note
feat(kafka)!: upgrade to Strimzi 1.2.0 and Kafka 4.3 by default, with Kafka 4.2 also available. Platform migration 61 converts Strimzi resources to v1 and moves Kafka 3.x applications to v4.3. Every Kafka must have confirmed KRaft state before the upgrade, including on repeat runs. Upgrade through Cozystack v1.7 first. Kafka 4 drops clients older than Kafka 2.1 and the message.format.version, message.downconversion.enable and message.timestamp.difference.max.ms topic settings, and requires segment.bytes of at least 1 MiB; the chart and the upgrade refuse a topic that breaks either rule, and a topic-metadata backup taken on Kafka 3.x restores without the removed settings and with segment.bytes raised to 1 MiB. In-place downgrades are unsupported.
```
2026-11-18 13:26:31 +03:00
Aleksei Sviridkin dbd6acba95 Merge branch 'main' into docs/release-check-b-image-pathspec
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-18 12:05:05 +03:00
Aleksei Sviridkin 8a0c406e15 Merge branch 'main' into fix/kubernetes-coredns-cilium-deadlock
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-18 11:57:13 +03:00
Aleksei Sviridkin 5a92f1fc4e Merge branch 'main' into feat/build-provenance-attestation
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-18 11:55:28 +03:00
Andrey Kolkov 7145a67568 fix(backups): stop leaking MariaDB dumps of stuck runs and torn-down namespaces
A k8s.mariadb.com/Backup the BackupJob gave up on stayed for good: no
Backup is made of such a run, so nothing deleted it, and while it stood
short of Complete the dump cleanup counted its open window as a possible
writer of every later dump of the application and kept each of them.

Every failure exit of a started BackupJob in the MariaDB driver now goes
through failMariaDBBackupJob: the deadline, the application, MariaDB CR
or strategy going away, a run the operator failed at Complete=False, and
a run that could not be created. It lists the job's runs on the API
server, where the cache can trail a run created or completed a moment
ago, and deletes each one short of Complete under the UID and
resourceVersion it read, so a run that completes in between is handed
to the success path instead. Deleting the run takes its Job and pod, so
what held the pod up is first copied into the failure message. A
Running or expired job takes its run from that listing and never starts
another, so a retry after a failed status write cannot start a second.

During namespace teardown the operator Backup, which carries no
finalizer, is usually gone before the Backup finalizer runs, and the
cleanup, which read the storage from it, left the dump behind. A Backup
that recorded its dump on the platform bucket now has it deleted with
the platform credentials, which do not go with the namespace, reading
the storage from the snapshot in status.underlyingResources; the dump is
still kept when another run could have written it. The snapshot and the
storage URI now record the storage the run was created with rather than
the strategy as rendered at completion, which a strategy edited during
the run would otherwise send the cleanup away from.

Closes: #5291
Assisted-by: LLM
Signed-off-by: Andrey Kolkov <androndo@gmail.com>
2026-11-18 14:08:00 +07:00
Aleksei Sviridkin 15e87fdbea fix(seaweedfs): remove identities left behind by deleted BucketAccesses (#4915)
## What this PR does

Removes SeaweedFS identities left behind by deleted BucketAccesses. The
COSI driver up to v0.3.1 revokes only from the legacy `identity.json`,
while SeaweedFS since 4.08 keeps each identity in its own file, so those
files stayed (seaweedfs/seaweedfs-cosi-driver#11). The upstream driver
v0.4.0 from #5284 deletes the file on revoke, so no new files are left.
Files that v0.3.1 already left behind still hold working keys and stay
until something removes them.

A post-install/post-upgrade hook in `seaweedfs-system` removes them. It
lists the identity files before the BucketAccesses, so a file whose
BucketAccess still exists is never taken for a left-over one. The rest
of the rules are in the commit message and at the top of the script.
When it is unsure, it removes nothing, and the errors it handles do not
fail the release.

A filer that other clusters use through Client topology holds identities
whose BucketAccesses this cluster cannot see. The new
`cosi.orphanIdentities` value of the SeaweedFS application decides what
happens there. The default `auto` only reports when `filer.grpcHost` is
set and removes otherwise, and an operator can force `report` or
`delete`.

This builds on #4893, which is now merged.

Tested with bats against a fake `weed shell` and with helm-unittest. A
mutation that swaps the two listings back makes the ordering test fail.
An earlier revision of the script, which also skipped recently changed
files, was tried on a live cluster with SeaweedFS 4.45 and driver
v0.3.1. It only reported in report mode and removed left-over files in
delete mode while live identities kept working. With BucketAccess
listing forbidden, it removed nothing. The current revision has not been
run on a live cluster. No run has checked that the keys of a removed
identity are then rejected.

On 045f1a9bbc the bats, chart tests, Helm lint of the system chart and
shellcheck pass offline. The Linux unit lane and E2E are pending.

### Screenshots

Not a UI change.

### Downstream repositories

The new value belongs to the SeaweedFS application, which the Terraform
provider does not model (it only sets `seaweedfs` on a Tenant). The
website reference page is regenerated from the README on release.

- [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(seaweedfs): remove S3 identities left behind by deleted BucketAccesses on install and upgrade. The new cosi.orphanIdentities value (auto, report, delete) controls it; auto only reports on a filer published to Client-topology clusters.
```








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

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

## Summary by CodeRabbit

* **New Features**
* SeaweedFS COSI installations can configure how identities left by
deleted BucketAccess resources are handled: report them, delete them, or
use automatic behavior. Automatic mode reports them when the filer is
published and deletes them otherwise; Client topology ignores this
setting.
* Post-install and post-upgrade checks can add missing Object Lock
actions to eligible identities and report unresolved changes through
Kubernetes Warning Events.
* Orphan identity handling reports findings and, in delete mode, removes
eligible identities. Checks avoid removal when listings fail or no live
BucketAccess resources are found.
* **Documentation**
* Added configuration guidance and clarified the SeaweedFS volume size
limit setting.

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