add node must set hostname

This commit is contained in:
barnett 2019-07-08 18:35:51 +08:00
parent daf150101a
commit 5d09c8a186

View File

@ -151,7 +151,7 @@ func getStatusShow(v *client.HostNode) (status string) {
nss.color = color.FgRed
}
result := nss.String()
result := nss.String()
if strings.Contains(result, "unknown") {
result = "unknown"
}
@ -650,6 +650,9 @@ func addNodeCommand(c *cli.Context) error {
if !c.IsSet("role") {
showError("role must not null")
}
if c.String("hostname") == "" {
showError("node hostname must be set")
}
if c.String("root-pass") != "" && c.String("private-key") != "" {
showError("Options private-key and root-pass are conflicting")
}