Преглед на файлове

Check empty attribute value and assign default cluster name

Bianca Burtoiu преди 4 години
родител
ревизия
9b991f2b3d
променени са 1 файла, в които са добавени 5 реда и са изтрити 0 реда
  1. 5 0
      pkg/cloud/gcpprovider.go

+ 5 - 0
pkg/cloud/gcpprovider.go

@@ -319,6 +319,11 @@ func (gcp *GCP) ClusterInfo() (map[string]string, error) {
 		attribute = c.ClusterName
 		attribute = c.ClusterName
 	}
 	}
 
 
+	// Use a default name if none has been set until this point
+	if attribute == "" {
+		attribute = "GKE Cluster #1"
+	}
+
 	m := make(map[string]string)
 	m := make(map[string]string)
 	m["name"] = attribute
 	m["name"] = attribute
 	m["provider"] = "GCP"
 	m["provider"] = "GCP"