Explorar el Código

Fall back to the original default cluster name

Matthew L Daniel hace 7 años
padre
commit
2ed20560a4
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      cloud/awsprovider.go

+ 3 - 1
cloud/awsprovider.go

@@ -321,6 +321,7 @@ func (aws *AWS) NodePricing(key string) (*Node, error) {
 
 // ClusterName returns an object that represents the cluster. TODO: actually return the name of the cluster. Blocked on cluster federation.
 func (awsProvider *AWS) ClusterName() ([]byte, error) {
+	defaultClusterName := "AWS Cluster #1"
 	makeStructure := func(clusterName string) ([]byte, error) {
 		log.Printf("Returning \"%s\" as ClusterName", clusterName)
 		m := make(map[string]string)
@@ -388,7 +389,8 @@ func (awsProvider *AWS) ClusterName() ([]byte, error) {
 			}
 		}
 	}
-	return nil, fmt.Errorf("Unable to sniff out cluster ID, perhaps set $%s to force one", ClusterIdEnvVar)
+	log.Printf("Unable to sniff out cluster ID, perhaps set $%s to force one", ClusterIdEnvVar)
+	return makeStructure(defaultClusterName)
 }
 
 // AddServiceKey adds an AWS service key, useful for pulling down out-of-cluster costs. Optional-- the container this runs in can be directly authorized.