Skip to content

Commit 9ae47f4

Browse files
E2E: test podTemplate metadata propagation to launcher pods (#433) (#452)
The CRD fix (commit 8582db6) introduced EmbeddedPodTemplateSpec to accept metadata in LauncherConfig podTemplate, but E2E tests never exercised this path. Add template labels/annotations to both mkobjs scripts and assert they appear on created launcher pods and survive unbind. Signed-off-by: Mike Spreitzer <mspreitz@us.ibm.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3e14186 commit 9ae47f4

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

test/e2e/mkobjs-openshift.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,11 @@ metadata:
172172
spec:
173173
maxSleepingInstances: 3
174174
podTemplate:
175+
metadata:
176+
labels:
177+
e2e-test.fma.llm-d.ai/template-label: from-launcher-config
178+
annotations:
179+
e2e-test.fma.llm-d.ai/template-annotation: from-launcher-config
175180
spec:
176181
${runtime_class}
177182
serviceAccountName: launcher-$inst

test/e2e/mkobjs.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ metadata:
115115
spec:
116116
maxSleepingInstances: 1
117117
podTemplate:
118+
metadata:
119+
labels:
120+
e2e-test.fma.llm-d.ai/template-label: from-launcher-config
121+
annotations:
122+
e2e-test.fma.llm-d.ai/template-annotation: from-launcher-config
118123
spec:
119124
serviceAccount: testlauncher
120125
containers:

test/e2e/test-cases.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,10 @@ expect '[ "$(kubectl get pod -n '"$NS"' $req1 -o jsonpath={.metadata.labels.dual
217217
[ "$(kubectl get pod -n "$NS" $launcher1 -o jsonpath='{.metadata.labels.e2e-test\.fma\.llm-d\.ai/isc-label}')" == "test-value" ] || { echo "ERROR: ISC label not propagated to launcher pod $launcher1"; exit 1; }
218218
[ "$(kubectl get pod -n "$NS" $launcher1 -o jsonpath='{.metadata.annotations.e2e-test\.fma\.llm-d\.ai/isc-annotation}')" == "test-value" ] || { echo "ERROR: ISC annotation not propagated to launcher pod $launcher1"; exit 1; }
219219

220+
# Verify LauncherConfig podTemplate metadata labels/annotations were propagated to launcher pod (Issue #433)
221+
[ "$(kubectl get pod -n "$NS" $launcher1 -o jsonpath='{.metadata.labels.e2e-test\.fma\.llm-d\.ai/template-label}')" == "from-launcher-config" ] || { echo "ERROR: LauncherConfig podTemplate label is not correctly set on launcher pod $launcher1"; false; }
222+
[ "$(kubectl get pod -n "$NS" $launcher1 -o jsonpath='{.metadata.annotations.e2e-test\.fma\.llm-d\.ai/template-annotation}')" == "from-launcher-config" ] || { echo "ERROR: LauncherConfig podTemplate annotation is not correctly set on launcher pod $launcher1"; false; }
223+
220224
# Wait for both pods to be ready
221225
date
222226
kubectl wait --for condition=Ready pod/$req1 -n "$NS" --timeout=180s
@@ -362,6 +366,10 @@ expect '[ "$(kubectl get pod -n '"$NS"' $launcher1 -o jsonpath={.metadata.labels
362366
[ "$(kubectl get pod -n "$NS" $launcher1 -o jsonpath='{.metadata.labels.e2e-test\.fma\.llm-d\.ai/isc-label}')" == "" ] || { echo "ERROR: ISC label not removed from launcher pod $launcher1 after unbind"; exit 1; }
363367
[ "$(kubectl get pod -n "$NS" $launcher1 -o jsonpath='{.metadata.annotations.e2e-test\.fma\.llm-d\.ai/isc-annotation}')" == "" ] || { echo "ERROR: ISC annotation not removed from launcher pod $launcher1 after unbind"; exit 1; }
364368

369+
# Verify LauncherConfig podTemplate metadata survives unbind (these are intrinsic to the pod, not ISC-specific)
370+
[ "$(kubectl get pod -n "$NS" $launcher1 -o jsonpath='{.metadata.labels.e2e-test\.fma\.llm-d\.ai/template-label}')" == "from-launcher-config" ] || { echo "ERROR: LauncherConfig podTemplate label is not correctly set on launcher pod $launcher1 after unbind"; false; }
371+
[ "$(kubectl get pod -n "$NS" $launcher1 -o jsonpath='{.metadata.annotations.e2e-test\.fma\.llm-d\.ai/template-annotation}')" == "from-launcher-config" ] || { echo "ERROR: LauncherConfig podTemplate annotation is not correctly set on launcher pod $launcher1 after unbind"; false; }
372+
365373
# Scale back up (should reuse same launcher and wake sleeping instance)
366374
kubectl scale rs $rs -n "$NS" --replicas=1
367375

0 commit comments

Comments
 (0)