Conversation
| except FileNotFoundError: | ||
| raise RuntimeError("Namespace file not found. Are you running in a Kubernetes cluster?") | ||
| try: | ||
| contexts, active_context = cluster_config.list_kube_config_contexts() |
There was a problem hiding this comment.
what do you think about loading from env var, with fall back to default?
There was a problem hiding this comment.
if im getting you right. that might cause problems, if a mistake was entered in the env var and is different then the "/var/run/secrets/kubernetes.io/serviceaccount/namespace". i think default should be the 'incluster' namespace file, then fallback to other methods
There was a problem hiding this comment.
using kubeconfig context namespace used only for development purposes..
if the pod in cluster, the namespace file will exists and all will be just fine.
the only reason to provide namespace will be for development reasons..
I would even delete the fallback to default, and will try to use env var, it not exists, exit the program..
using kubeconfig namespace just too implicit
| except FileNotFoundError: | ||
| raise RuntimeError("Namespace file not found. Are you running in a Kubernetes cluster?") | ||
| try: | ||
| contexts, active_context = cluster_config.list_kube_config_contexts() |
There was a problem hiding this comment.
using kubeconfig context namespace used only for development purposes..
if the pod in cluster, the namespace file will exists and all will be just fine.
the only reason to provide namespace will be for development reasons..
I would even delete the fallback to default, and will try to use env var, it not exists, exit the program..
using kubeconfig namespace just too implicit
No description provided.