make server the default node for portmaps

This commit is contained in:
iwilltry42 2019-05-14 20:48:48 +02:00
parent 2640fc13ce
commit 8512ac0c8a
2 changed files with 8 additions and 1 deletions

View File

@ -39,6 +39,10 @@ func mapNodesToPortSpecs(specs []string, createdNodes []string) (map[string][]st
for _, spec := range specs {
nodes, portSpec := extractNodes(spec)
if len(nodes) == 0 {
nodes = append(nodes, defaultNodes)
}
for _, node := range nodes {
// check if node-specifier is valid (either a role or a name) and append to list if matches
nodeFound := false

View File

@ -49,7 +49,10 @@ func CheckClusterName(name string) error {
if len(name) > clusterNameMaxSize {
return fmt.Errorf("[ERROR] Cluster name is too long (%d > %d)", len(name), clusterNameMaxSize)
}
return fmt.Errorf("[ERROR] Invalid cluster name\n%+v", ValidateHostname(name))
if err := ValidateHostname(name); err != nil {
return fmt.Errorf("[ERROR] Invalid cluster name\n%+v", ValidateHostname(name))
}
return nil
}
// ValidateHostname ensures that a cluster name is also a valid host name according to RFC 1123.