Skip to content

Commit d7f3f0d

Browse files
authored
fix(hack): keep root monitoring redirects off in the E2E install (#4811)
## What this PR does This fixes the E2E install on pull requests that select only a few suites. Today those runs fail before any suite starts: `cozystack-basics` fails with `namespaces "cozy-monitoring" not found`, and every package waiting on basics never installs. The reduced install from #4022 disables every package the selected suites don't need. For narrow selections like `vminstance` or the Kubernetes suites, that list includes metrics-server, monitoring-agents and monitoring, which are the only packages that create `cozy-monitoring`. Basics still renders three ExternalName redirects into that namespace, because `monitoring.rootEnabled` stays at its default of true. Wide selections keep at least one of those packages, so they pass. The E2E install already sets `Tenant/root spec.monitoring` to false, and `rootEnabled` is meant to match it. The harness now sets `rootEnabled: false`, so basics no longer writes into a namespace the install may not create. No suite uses these redirects. With root monitoring off they pointed at nothing even on full runs. The same failure can happen in a real cluster when a user disables those three packages. That needs a product change and is tracked in #4810. ### Screenshots ### Downstream repositories - [x] No downstream repository is affected by this change - [ ] [cozystack/website](https://github.com/cozystack/website) - follow-up: - [ ] [cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack) - follow-up: - [ ] [cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack) - follow-up: - [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up: - [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up: - [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) - follow-up: - [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) - follow-up: - [ ] [cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server) - follow-up: - [ ] [cozystack/external-apps-example](https://github.com/cozystack/external-apps-example) - follow-up: - [ ] [cozystack/examples](https://github.com/cozystack/examples) - follow-up: - [ ] [cozystack/community](https://github.com/cozystack/community) - follow-up: ### Release note ```release-note fix(hack): the E2E install keeps root monitoring redirects off, so runs that select only a few suites no longer fail on a missing cozy-monitoring namespace. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Root monitoring stays disabled in generated platform package settings when `cozy-monitoring` is omitted, preventing monitoring Services from being rendered in narrowly selected test suites. * **Documentation** * Clarified how the root monitoring setting relates to the installation’s `Tenant/root` configuration and which setting to change to enable it. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2 parents cbc9d0c + 84daaf0 commit d7f3f0d

3 files changed

Lines changed: 19 additions & 1 deletion

File tree

‎hack/e2e-install-cozystack.bats‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,8 @@
275275
# competes with the rest of the install for node capacity, so a slow start
276276
# could fail a pull request that never touched monitoring. The monitoring
277277
# package itself stays installed, because tenant-application declares
278-
# dependsOn cozystack.monitoring-application.
278+
# dependsOn cozystack.monitoring-application. Turning it on also means
279+
# flipping monitoring.rootEnabled in hack/e2e-platform-packages.sh.
279280
kubectl patch tenants/root -n tenant-root --type merge -p '{"spec":{"host":"example.org","ingress":true,"monitoring":false,"etcd":true,"isolated":true, "seaweedfs": true}}'
280281

281282
timeout 60 sh -ec 'until kubectl get hr -n tenant-root etcd ingress seaweedfs tenant-root >/dev/null 2>&1; do sleep 1; done'

‎hack/e2e-platform-packages.sh‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ spec:
6868
publishing:
6969
host: "example.org"
7070
apiServerEndpoint: "$api_server_endpoint"
71+
# Must match Tenant/root spec.monitoring, which the install sets to
72+
# false. Left true, cozystack-basics renders Services into
73+
# cozy-monitoring, which a narrow suite selection never creates.
74+
monitoring:
75+
rootEnabled: false
7176
bundles:
7277
enabledPackages:
7378
- cozystack.external-dns-application

‎hack/platform-packages_test.bats‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,18 @@ load test_helper
147147
fi
148148
}
149149

150+
@test "root monitoring redirects stay off, including for a narrow suite selection" {
151+
for disabled in "" "$(hack/select-install.sh --disabled vminstance)"; do
152+
manifest=$(COZY_DISABLED_PACKAGES="$disabled" hack/e2e-platform-packages.sh)
153+
root=$(printf '%s\n' "$manifest" | yq 'select(.metadata.name == "cozystack.cozystack-platform") | .spec.components.platform.values.monitoring.rootEnabled')
154+
155+
if [ "$root" != "false" ]; then
156+
echo "monitoring.rootEnabled is '$root' with disabledPackages '$disabled', but Tenant/root monitoring is off" >&2
157+
return 1
158+
fi
159+
done
160+
}
161+
150162
@test "a malformed package name fails before emitting YAML" {
151163
for bad in "goldpinger" "cozystack." "cozystack.Gold" "cozystack.a;b"; do
152164
if manifest=$(COZY_DISABLED_PACKAGES="cozystack.keda $bad" hack/e2e-platform-packages.sh 2>/dev/null); then

0 commit comments

Comments
 (0)