Skip to content

[Backport release-1.6] fix(tenant): skip Cilium policies on isp-hosted without Cilium - #5080

Merged
myasnikovdaniil merged 1 commit into
release-1.6from
backport/4710-release-1.6
Oct 23, 2026
Merged

myasnikovdaniil merged 1 commit into
release-1.6from
backport/4710-release-1.6

Conversation

@myasnikovdaniil

Copy link
Copy Markdown
Contributor

What this PR does

Backport of #4710 to release-1.6.

  • The traces-central templates do not exist on release-1.6, so their hunks and the matching unit-test assertions are dropped, a test case that relied on a main-only cozy-lib change uses _cluster: {} instead.

Screenshots

Not a UI change.

Downstream repositories

Release note

fix(tenant): the tenant chart no longer fails to install on the isp-hosted variants when the host has no Cilium. There, the Cilium network policies are created only if the host serves the Cilium policy API; otherwise tenants get no network isolation from Cozystack. Other variants are unchanged.

The isp-hosted variants install no CNI of their own, so on a host
without Cilium the cilium.io/v2 kinds do not exist and the tenant
install fails, taking the root tenant and everything that depends on
cozystack-basics down with it.

The policies now render on isp-hosted only when the host serves both
Cilium policy kinds. On every other variant Cozystack installs Cilium
itself, so they keep rendering unconditionally: a CRD that is missing
at render time there fails the install loudly instead of leaving the
tenant without network isolation, because helm-controller does not
re-render a release when only API discovery changes.

On isp-hosted without Cilium the tenant gets no network isolation from
Cozystack; isolating tenants is then up to the host's CNI.

release-1.6 has no shared-central tracing templates, so their hunks,
the tenant.tracingCentralEgress helper beside the new one and the
tracing cases of the test suite are left out. cozy-lib on this branch
fails on an absent _cluster, as the rest of the chart already does,
so the no-_cluster case runs with an empty _cluster instead.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <[email protected]>
(cherry picked from commit 3b5af9d)
Signed-off-by: Myasnikov Daniil <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added area/release Issues or PRs related to release tooling (changelog, backport, release pipeline) area/tenant Issues or PRs related to the tenant chart and multi-tenancy kind/bug Categorizes issue or PR as related to a bug size/M This PR changes 30-99 lines, ignoring generated files labels Oct 22, 2026
@myasnikovdaniil
myasnikovdaniil marked this pull request as ready for review October 23, 2026 15:00
@myasnikovdaniil
myasnikovdaniil merged commit 2f820f7 into release-1.6 Oct 23, 2026
14 checks passed
@myasnikovdaniil
myasnikovdaniil deleted the backport/4710-release-1.6 branch October 23, 2026 15:00
myasnikovdaniil added a commit that referenced this pull request Oct 30, 2026
…vive uninjected values (#5141)

## What this PR does

Backport of #3647 to release-1.6.

Since #5080 (backport of #4710) `tenant.ciliumPolicies` calls
`cozy-lib.bundle-name`, and on release-1.6 that helper still does `index
.Values._cluster "bundle-name"`, which fails with `index of untyped nil`
when `_cluster` is not set. Tenant export-proxy suite
(`tests/networkpolicy_vm_exportproxy_test.yaml`) sets no `_cluster`, so
all four cases fail and unit tests are red on every PR against
release-1.6, including batch #5089. #5080 set `_cluster: {}` only in its
own suite, that's why it passed there.

#3647 guards the map in every cozyconfig helper and adds cozy-lib-tests
suite for injected and uninjected state. It applies cleanly, diff is
identical to main.

Checked locally (helm-unittest is not installed here, CI runs it):

- export-proxy suite renders fail on current branch and pass with this
change;
- new cozyconfig suite passes, its uninjected case fails against old
helpers;
- all 34 charts using cozy-lib render the same before and after with
realistic `_cluster` / `_namespace` (apart from generated passwords),
only tenant chart with nothing injected changes, it doesn't fail in
`networkpolicy.yaml` anymore.

Plain `helm template` of tenant chart without `_cluster` still fails in
`keycloakgroups.yaml`, main fixed it separately in #3636. Unit tests are
not affected, suite renders only templates it names.

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

### Release note

```release-note
fix(cozy-lib): the cozyconfig helpers now return their documented empty defaults when the platform has not injected `_cluster` / `_namespace`, instead of aborting the render, so a chart using them can be rendered and unit-tested on its own
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/release Issues or PRs related to release tooling (changelog, backport, release pipeline) area/tenant Issues or PRs related to the tenant chart and multi-tenancy kind/bug Categorizes issue or PR as related to a bug size/M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants