checking if context exists

This commit is contained in:
Ben Hirschberg
2022-01-19 16:37:32 +02:00
parent 62af441a1d
commit 1ae76b4377
+5 -1
View File
@@ -48,7 +48,11 @@ func getCloudProviderFromContext() string {
}
func getClusterFromContext() string {
cluster := k8sinterface.GetCurrentContext().Cluster
context := k8sinterface.GetCurrentContext()
if context == nil {
return ""
}
cluster := context.Cluster
if cluster != "" {
return cluster
}