fix(platform): make mongodb-application depend on its operator

The mongodb chart renders kind: PerconaServerMongoDB from
psmdb.percona.com/v1, but cozystack.mongodb-application depended only on
networking and cozystack-engine. So mongodb-rd registers the
ApplicationDefinition as soon as the engine is up, and a tenant can
create a MongoDB before the operator exists; its HelmRelease then fails
with no matches for kind "PerconaServerMongoDB".

This is the same defect #3817 fixed for etcd.
Every other operator-backed app here already carries the edge.

It also closes a test-selection gap: without it cozystack.mongodb-operator
reaches no runnable suite, so every change to the operator escalates to
a run of all suites instead of selecting mongodb.

select-install.sh --validate reports the graph still has no cycle.

Assisted-by: LLM
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
This commit is contained in:
Myasnikov Daniil authored and Aleksei Sviridkin committed 2026-09-30 02:18:28 +03:00
1 parent d6b38f0a79
commit b8bc0dfd5f
2 files changed
+40

No files matched your search

@@ -15,6 +15,15 @@ spec:
- cozystack.networking
# cozystack-engine ships the ApplicationDefinition CRD rendered by the *-rd component below.
- cozystack.cozystack-engine
# The mongodb chart renders kind: PerconaServerMongoDB from
# psmdb.percona.com/v1, so the operator that serves that CRD is a
# prerequisite of offering the app at all. Without this edge the
# mongodb-rd HelmRelease registers the ApplicationDefinition as soon as
# the engine is up, a tenant can create a MongoDB before the operator
# exists, and its HelmRelease fails with `no matches for kind
# "PerconaServerMongoDB"`. Same shape as every other operator-backed app
# here (postgres, mariadb, kafka, redis, etcd).
- cozystack.mongodb-operator
libraries:
- name: cozy-lib
path: library/cozy-lib
@@ -0,0 +1,31 @@
suite: mongodb-application waits for the operator that serves its CRD
# The mongodb chart (apps/mongodb) renders kind: PerconaServerMongoDB from
# psmdb.percona.com/v1, so cozystack.mongodb-operator is a genuine prerequisite
# of offering the app rather than a test-selection hint. Without this edge the
# mongodb-rd HelmRelease registers the ApplicationDefinition as soon as
# cozystack-engine is up, a tenant can create a MongoDB before the operator
# exists, and its HelmRelease fails with `no matches for kind
# "PerconaServerMongoDB"`.
# The edge is also what makes the mongodb Chainsaw suite reachable from the
# operator's own package, so a change to the operator selects that suite instead
# of the whole run — see hack/select-e2e.sh's src_to_suites().
templates:
- templates/sources.yaml
release:
name: cozystack
namespace: cozy-system
tests:
- it: mongodb-application dependsOn mongodb-operator alongside its baseline edges
documentSelector:
path: metadata.name
value: cozystack.mongodb-application
asserts:
- contains:
path: spec.variants[0].dependsOn
content: cozystack.mongodb-operator
- contains:
path: spec.variants[0].dependsOn
content: cozystack.networking
- contains:
path: spec.variants[0].dependsOn
content: cozystack.cozystack-engine