Browse Source

Check empty attribute value and assign default cluster name

Bianca Burtoiu 4 năm trước cách đây
mục cha
commit
9b991f2b3d
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  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
 	}
 
+	// Use a default name if none has been set until this point
+	if attribute == "" {
+		attribute = "GKE Cluster #1"
+	}
+
 	m := make(map[string]string)
 	m["name"] = attribute
 	m["provider"] = "GCP"