Skip to content

Commit 84daaf0

Browse files
committed
fix(hack): keep root monitoring redirects off in the E2E install
The E2E install sets Tenant/root spec.monitoring to false, but left the platform monitoring.rootEnabled at its default of true, so cozystack-basics rendered its vlinsert/vminsert ExternalName Services into cozy-monitoring regardless. That namespace is created only by metrics-server, monitoring-agents and monitoring. A narrow suite selection disables all three, so basics fails with `namespaces "cozy-monitoring" not found` and every package waiting on it never installs. Wide selections passed only because they keep at least one of those packages. Setting rootEnabled to match the root tenant removes the dependency and is what the value's contract asks for anyway. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <[email protected]>
1 parent cbc9d0c commit 84daaf0

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)