Files
cozystack/packages/system/ouroboros/tests/controller_test.yaml
Aleksei Sviridkin 6f83d9a794 feat(ouroboros): bump to v0.7.2 with debug logging on tenants
The v0.7.2 ouroboros release adds --log-level / OUROBOROS_CONTROLLER_LOG_LEVEL,
plants Debug logs at every informer event handler (AddFunc/UpdateFunc/
DeleteFunc with kind+namespace/name via describeObj) and at reconcile
entry/exit, wires SetWatchErrorHandler on Ingress / Gateway / HTTPRoute
informers, and surfaces cache-sync elapsed at Info. The diagnostic
surface targets the kamaji-tenant-via-konnectivity flake where bats
sees a fresh Ingress create succeed against the tenant apiserver but
the controller's coredns-custom rewrite lands roughly 7-10 minutes
later — without per-event visibility the failure mode is
indistinguishable between 'watch never fires', 'reconcile silently
errors', and 'API list returns empty until reflector reconnect'.

Bumps the chart-manifest digest, the controller-image digest, and the
cozystack-side image-pin assertion in lockstep. The bats deadline for
the coredns-custom rewrite check rises from 180s to 900s — even on
the broken-watch path the reflector eventually reconnects within
that budget, so the test stops failing on the symptom while we keep
the diagnostic on to learn what the symptom actually is.

cozystack tenants force controller.logLevel: debug via the
defaultOuroborosValues helper; operators that want quieter logs can
override through addons.ouroboros.valuesOverride. Two helm-unittest
fixtures pin both the default and the override path.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-05-11 02:20:34 +03:00

95 lines
4.6 KiB
YAML

suite: cozy-ouroboros controller defaults
templates:
- charts/ouroboros/templates/controller-deployment.yaml
- charts/ouroboros/templates/_helpers.tpl
release:
name: ouroboros
namespace: cozy-ouroboros
tests:
- it: defaults to coredns mode (host scenario; tenant overrides via apps/kubernetes)
template: charts/ouroboros/templates/controller-deployment.yaml
asserts:
- contains:
path: spec.template.spec.containers[0].args
content: --mode=coredns
- it: emits runtime-composition flags (no chart-baked --proxy-fqdn) — chart is platform-agnostic and lets controller compose the rewrite-target FQDN at startup from the auto-detected cluster-domain
template: charts/ouroboros/templates/controller-deployment.yaml
asserts:
- contains:
path: spec.template.spec.containers[0].args
content: --proxy-service-name=ouroboros-proxy
- contains:
path: spec.template.spec.containers[0].args
content: --proxy-service-namespace=cozy-ouroboros
- notContains:
path: spec.template.spec.containers[0].args
content: --proxy-fqdn=ouroboros-proxy.cozy-ouroboros.svc.cluster.local.
- it: leaves Gateway-API watching off at the parent default (consumer enables)
template: charts/ouroboros/templates/controller-deployment.yaml
asserts:
- notContains:
path: spec.template.spec.containers[0].args
content: --gateway-api
- it: emits chart-default --resync=30s — host scenario inherits the upstream chart default (changed from 10m in upstream v0.7.x). The reduction is the controller's only recovery path when an Ingress watch silently dies, and 30s caps worst-case event-to-reconcile latency under broken-watch conditions. Pinning here catches a future upstream bump back to the longer value before it lands as a CI surprise.
template: charts/ouroboros/templates/controller-deployment.yaml
asserts:
- contains:
path: spec.template.spec.containers[0].args
content: --resync=30s
- it: emits chart-default --log-level=info — host scenario stays at info verbosity by upstream chart default. Tenants override to debug via apps/kubernetes wrapper (see cozystack.defaultOuroborosValues). Pinning here keeps the host quiet by default and catches a regression where the host wrapper accidentally inherits the tenant debug value.
template: charts/ouroboros/templates/controller-deployment.yaml
asserts:
- contains:
path: spec.template.spec.containers[0].args
content: --log-level=info
- it: writes into the kube-system/coredns Corefile by default (host mode)
template: charts/ouroboros/templates/controller-deployment.yaml
asserts:
- contains:
path: spec.template.spec.containers[0].args
content: --coredns-namespace=kube-system
- contains:
path: spec.template.spec.containers[0].args
content: --coredns-configmap=coredns
- contains:
path: spec.template.spec.containers[0].args
content: --coredns-key=Corefile
- it: tenant valuesOverride flips into coredns-import mode (and runtime-composition flags carry over — tenants are the actual consumers of this mode, the host stays on coredns)
template: charts/ouroboros/templates/controller-deployment.yaml
set:
ouroboros:
controller:
mode: coredns-import
asserts:
- contains:
path: spec.template.spec.containers[0].args
content: --mode=coredns-import
- contains:
path: spec.template.spec.containers[0].args
content: --coredns-import-configmap=coredns-custom
- contains:
path: spec.template.spec.containers[0].args
content: --coredns-import-key=ouroboros.override
# Runtime-composition flags MUST be emitted in coredns-import mode
# too — this is the mode tenants actually run, so a future refactor
# in the upstream controller-deployment template that drops the
# composition block from this branch only would break tenants
# silently. The negative-assert pins that --proxy-fqdn does NOT
# bake the cluster-domain at render time when no clusterDomain is
# configured (the platform-agnostic default).
- contains:
path: spec.template.spec.containers[0].args
content: --proxy-service-name=ouroboros-proxy
- contains:
path: spec.template.spec.containers[0].args
content: --proxy-service-namespace=cozy-ouroboros
- notContains:
path: spec.template.spec.containers[0].args
content: --proxy-fqdn=ouroboros-proxy.cozy-ouroboros.svc.cluster.local.