upup: kubecfg generate can default the master API name

It is api.<clustername> by default
This commit is contained in:
Justin Santa Barbara 2016-06-11 21:16:19 -04:00
parent 72afa859a3
commit 53e4875a5b
2 changed files with 6 additions and 5 deletions

View File

@ -46,7 +46,7 @@ The upup tool is a CLI for doing administrative tasks. You can use it to genera
```
export MYZONE=<kubernetes.myzone.com>
${GOPATH}/bin/upup kubecfg generate --state=state --master=api.${MYZONE} --name=${MYZONE} --cloud=aws
${GOPATH}/bin/upup kubecfg generate --state=state --name=${MYZONE} --cloud=aws
```
## Delete the cluster

View File

@ -3,6 +3,7 @@ package main
import (
"fmt"
"github.com/golang/glog"
"github.com/spf13/cobra"
"io"
"io/ioutil"
@ -49,13 +50,13 @@ func init() {
}
func (c *KubecfgGenerateCommand) Run() error {
if c.Master == "" {
return fmt.Errorf("master must be specified")
}
if c.ClusterName == "" {
return fmt.Errorf("name must be specified")
}
if c.Master == "" {
c.Master = "api." + c.ClusterName
glog.Infof("Connecting to master at %s", c.Master)
}
if c.CloudProvider == "" {
return fmt.Errorf("cloud must be specified")
}