@@ -369,12 +369,33 @@ deploy_llm_d_infrastructure() {
369369 # separately using the local chart (supports dev/test of chart changes).
370370 # The helmfile's WVA release uses the published OCI chart which may not
371371 # have the latest fixes and uses KIND-specific defaults (e.g. monitoringNamespace).
372- local helmfile_selector= " "
372+ local -a helmfile_selector_exprs=()
373373 if [ " $DEPLOY_WVA " == " true" ]; then
374- helmfile_selector= " --selector kind!=autoscaling"
374+ helmfile_selector_exprs+=( " kind!=autoscaling" )
375375 log_info " Skipping WVA in helmfile (will be deployed separately from local chart)"
376376 fi
377- helmfile apply -e $GATEWAY_PROVIDER -n ${LLMD_NS} $helmfile_selector
377+ if [ " $E2E_TESTS_ENABLED " = " true" ] && [ " $INFRA_ONLY " = " true" ]; then
378+ # E2E infra-only tests create scenario-specific modelservice workloads
379+ # themselves. Skip the default llm-d-modelservice release so baseline
380+ # infrastructure is clean and we avoid create-then-delete churn.
381+ helmfile_selector_exprs+=(" chart!=llm-d-modelservice" )
382+ log_info " E2E infra-only mode: skipping llm-d-modelservice release in helmfile"
383+ fi
384+ local selector_csv=" "
385+ if [ " ${# helmfile_selector_exprs[@]} " -gt 0 ]; then
386+ selector_csv=$( IFS=,; echo " ${helmfile_selector_exprs[*]} " )
387+ log_info " helmfile selector: $selector_csv "
388+ helmfile apply -e " $GATEWAY_PROVIDER " -n " ${LLMD_NS} " --selector " $selector_csv "
389+ else
390+ log_info " helmfile selector: (none)"
391+ helmfile apply -e " $GATEWAY_PROVIDER " -n " ${LLMD_NS} "
392+ fi
393+
394+ if [ " $E2E_TESTS_ENABLED " = " true" ] && [ " $INFRA_ONLY " = " true" ]; then
395+ if helm list -n " $LLMD_NS " --short 2> /dev/null | grep -q ' ^ms-' ; then
396+ log_warning " Modelservice release still present in $LLMD_NS despite e2e selector; tests may need extra cleanup"
397+ fi
398+ fi
378399
379400 # Post-deploy: align the WVA vllm-service selector and ServiceMonitor to match
380401 # the actual pod labels. The llm-d-modelservice chart sets pod labels from
0 commit comments