Skip to content

Commit fcec3b0

Browse files
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, found while reviewing it. 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 the full 21-suite run instead of selecting mongodb. select-install.sh --validate reports the graph still has no cycle. Assisted-By: Claude <[email protected]> Signed-off-by: Myasnikov Daniil <[email protected]>
1 parent ff3294e commit fcec3b0

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

‎packages/core/platform/sources/mongodb-application.yaml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ spec:
1515
- cozystack.networking
1616
# cozystack-engine ships the ApplicationDefinition CRD rendered by the *-rd component below.
1717
- cozystack.cozystack-engine
18+
# The mongodb chart renders kind: PerconaServerMongoDB from
19+
# psmdb.percona.com/v1, so the operator that serves that CRD is a
20+
# prerequisite of offering the app at all. Without this edge the
21+
# mongodb-rd HelmRelease registers the ApplicationDefinition as soon as
22+
# the engine is up, a tenant can create a MongoDB before the operator
23+
# exists, and its HelmRelease fails with `no matches for kind
24+
# "PerconaServerMongoDB"`. Same shape as every other operator-backed app
25+
# here (postgres, mariadb, kafka, redis, etcd).
26+
- cozystack.mongodb-operator
1827
libraries:
1928
- name: cozy-lib
2029
path: library/cozy-lib
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
suite: mongodb-application waits for the operator that serves its CRD
2+
# The mongodb chart (apps/mongodb) renders kind: PerconaServerMongoDB from
3+
# psmdb.percona.com/v1, so cozystack.mongodb-operator is a genuine prerequisite
4+
# of offering the app rather than a test-selection hint. Without this edge the
5+
# mongodb-rd HelmRelease registers the ApplicationDefinition as soon as
6+
# cozystack-engine is up, a tenant can create a MongoDB before the operator
7+
# exists, and its HelmRelease fails with `no matches for kind
8+
# "PerconaServerMongoDB"`.
9+
# The edge is also what makes the mongodb Chainsaw suite reachable from the
10+
# operator's own package, so a change to the operator selects that suite instead
11+
# of the whole run — see hack/select-e2e.sh's src_to_suites().
12+
templates:
13+
- templates/sources.yaml
14+
release:
15+
name: cozystack
16+
namespace: cozy-system
17+
tests:
18+
- it: mongodb-application dependsOn mongodb-operator alongside its baseline edges
19+
documentSelector:
20+
path: metadata.name
21+
value: cozystack.mongodb-application
22+
asserts:
23+
- contains:
24+
path: spec.variants[0].dependsOn
25+
content: cozystack.mongodb-operator
26+
- contains:
27+
path: spec.variants[0].dependsOn
28+
content: cozystack.networking
29+
- contains:
30+
path: spec.variants[0].dependsOn
31+
content: cozystack.cozystack-engine

0 commit comments

Comments
 (0)