[fix] Use -p/--namespace when kubeconfig context has no namespace set #514
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added logic to use a CLI-provided namespace if the namespace cannot be detected from kubeconfig.
User reported issue from the community slack
When a kubeconfig context has no namespace field set, the script fails with:
This occurs even when
-p/--namespaceis provided, because:LLMDBENCH_CONTROL_CLUSTER_NAMESPACEis read from the kubeconfig context (line 518)-pflag setsLLMDBENCH_VLLM_COMMON_NAMESPACEbut notLLMDBENCH_CONTROL_CLUSTER_NAMESPACErun.shfails becauseLLMDBENCH_CONTROL_CLUSTER_NAMESPACEis emptyIn this scenario the user is working in the default namespace (or any namespace) whose kubeconfig context doesn't specify a namespace and they should be able to use
-p/--namespaceto provide it.This solution adds a fallback after kubeconfig detection: if
LLMDBENCH_CONTROL_CLUSTER_NAMESPACEis empty andLLMDBENCH_VLLM_COMMON_NAMESPACEis set (via-p), use that value.This ensures:
-pflag works as expected when kubeconfig detection fails