Fix error checking for pod name & NS
Previously it would just check if POD_NAME *or* POD_NAMESPACE was set, which could lead to very bizarre failure modes.
This commit is contained in:
parent
d416d029ec
commit
ad583c3acb
2 changed files with 21 additions and 5 deletions
|
|
@ -117,7 +117,7 @@ func GetPodDetails(kubeClient clientset.Interface) (*PodInfo, error) {
|
|||
podName := os.Getenv("POD_NAME")
|
||||
podNs := os.Getenv("POD_NAMESPACE")
|
||||
|
||||
if podName == "" && podNs == "" {
|
||||
if podName == "" || podNs == "" {
|
||||
return nil, fmt.Errorf("unable to get POD information (missing POD_NAME or POD_NAMESPACE environment variable")
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue