Skip to content

Commit 5c32bde

Browse files
scotwellsclaude
andcommitted
test(e2e): assert referenced-data companions by their un-prefixed name
referenced.CompanionName returns the source object's own name when it is a valid DNS subdomain within the length budget (the kind argument is ignored), so the companions materialize as app-config and app-secret, not configmap.app-config and secret.app-secret. The first CI run confirmed this: the referenced-data-delete-cascade suite (source names gc-test-config / gc-test-secret) found its un-prefixed companions, while referenced-data-mounts timed out looking for the prefixed names. Correct the assertions and the naming-convention note in the README. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 034c25d commit 5c32bde

2 files changed

Lines changed: 14 additions & 12 deletions

File tree

test/e2e/referenced-data-mounts/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The test covers Hops 1–5 of the federated delivery chain:
1010
| Hop | Cluster | What is asserted |
1111
|-----|---------|-----------------|
1212
| 1 | control-plane | Source ConfigMap + Secret created in the project namespace |
13-
| 2 | control-plane | Companion `configmap.app-config` + `secret.app-secret` appear in `ns-{project-uid}` with `compute.datumapis.com/referenced-data: "true"`; WD carries `expected-referenced-data` annotation; WD condition `ReferencedDataReady=True` |
13+
| 2 | control-plane | Companion `app-config` + `app-secret` appear in `ns-{project-uid}` with `compute.datumapis.com/referenced-data: "true"`; WD carries `expected-referenced-data` annotation; WD condition `ReferencedDataReady=True` |
1414
| 3 | downstream (Karmada hub) | Companion ConfigMap + Secret present in `ns-{project-uid}` on the hub; WD carries the annotation; `PropagationPolicy city-dfw` has ConfigMap and Secret resource selectors |
1515
| 4 | pop-dfw (cell) | WD + companions propagated to the cell in `ns-{project-uid}` |
1616
| 5 | pop-dfw (cell) | Instance `test-refdata-wd-0` exists; `ReferencedData` scheduling gate cleared; `ReferencedDataReady=True` condition set |
@@ -76,11 +76,13 @@ operators from the real overlays. Points worth knowing:
7676

7777
## Companion naming convention
7878

79-
The `ReferencedDataController` derives companion names deterministically:
79+
The `ReferencedDataController` derives companion names deterministically. When
80+
the source name is already a valid DNS subdomain within the length budget, the
81+
companion keeps that name unchanged (kind is not prefixed):
8082

8183
| Source | Companion name |
8284
|--------|---------------|
83-
| `ConfigMap/app-config` | `configmap.app-config` |
84-
| `Secret/app-secret` | `secret.app-secret` |
85+
| `ConfigMap/app-config` | `app-config` |
86+
| `Secret/app-secret` | `app-secret` |
8587

8688
These names are asserted directly in the test steps.

test/e2e/referenced-data-mounts/chainsaw-test.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ spec:
6666

6767
- name: assert-companion-configmap-on-hub
6868
description: |
69-
Assert the ReferencedDataController materialised companion configmap.app-config
69+
Assert the ReferencedDataController materialised companion app-config
7070
in ns-{project-uid} on the Karmada hub (downstream cluster).
7171
Companions are written to the hub namespace, NOT the control-plane namespace.
7272
cluster: downstream
@@ -86,13 +86,13 @@ spec:
8686
kind: ConfigMap
8787
metadata:
8888
namespace: ($companionNS)
89-
name: configmap.app-config
89+
name: app-config
9090
labels:
9191
compute.datumapis.com/referenced-data: "true"
9292

9393
- name: assert-companion-secret-on-hub
9494
description: |
95-
Assert the ReferencedDataController materialised companion secret.app-secret
95+
Assert the ReferencedDataController materialised companion app-secret
9696
in ns-{project-uid} on the Karmada hub (downstream cluster).
9797
Companions are written to the hub namespace, NOT the control-plane namespace.
9898
cluster: downstream
@@ -112,7 +112,7 @@ spec:
112112
kind: Secret
113113
metadata:
114114
namespace: ($companionNS)
115-
name: secret.app-secret
115+
name: app-secret
116116
labels:
117117
compute.datumapis.com/referenced-data: "true"
118118

@@ -180,7 +180,7 @@ spec:
180180
kind: ConfigMap
181181
metadata:
182182
namespace: ($downstreamNS)
183-
name: configmap.app-config
183+
name: app-config
184184
labels:
185185
compute.datumapis.com/referenced-data: "true"
186186
- assert:
@@ -191,7 +191,7 @@ spec:
191191
kind: Secret
192192
metadata:
193193
namespace: ($downstreamNS)
194-
name: secret.app-secret
194+
name: app-secret
195195
labels:
196196
compute.datumapis.com/referenced-data: "true"
197197

@@ -269,7 +269,7 @@ spec:
269269
kind: ConfigMap
270270
metadata:
271271
namespace: ($downstreamNS)
272-
name: configmap.app-config
272+
name: app-config
273273
labels:
274274
compute.datumapis.com/referenced-data: "true"
275275
- assert:
@@ -279,7 +279,7 @@ spec:
279279
kind: Secret
280280
metadata:
281281
namespace: ($downstreamNS)
282-
name: secret.app-secret
282+
name: app-secret
283283
labels:
284284
compute.datumapis.com/referenced-data: "true"
285285

0 commit comments

Comments
 (0)