Merge pull request #6053 from xichengliudui/fix181107

Remove unnecessary code
This commit is contained in:
k8s-ci-robot 2018-11-09 13:56:57 -08:00 committed by GitHub
commit b1296990b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 12 deletions

View File

@ -498,9 +498,8 @@ func RunCreateCluster(f *util.Factory, out io.Writer, c *CreateClusterOptions) e
if cluster.Spec.CloudProvider == "" {
if allZones.Len() == 0 {
return fmt.Errorf("must specify --zones or --cloud")
} else {
return fmt.Errorf("unable to infer CloudProvider from Zones (is there a typo in --zones?)")
}
return fmt.Errorf("unable to infer CloudProvider from Zones (is there a typo in --zones?)")
}
}
@ -1372,11 +1371,9 @@ func loadSSHPublicKeys(sshPublicKey string) (map[string][]byte, error) {
authorized, err := ioutil.ReadFile(sshPublicKey)
if err != nil {
return nil, err
} else {
sshPublicKeys[fi.SecretNameSSHPrimary] = authorized
glog.Infof("Using SSH public key: %v\n", sshPublicKey)
}
sshPublicKeys[fi.SecretNameSSHPrimary] = authorized
glog.Infof("Using SSH public key: %v\n", sshPublicKey)
}
return sshPublicKeys, nil
}

View File

@ -36,9 +36,8 @@ func checkParse(t *testing.T, s string, expect map[string]string, shouldErr bool
if err != nil {
if shouldErr {
return
} else {
t.Errorf(err.Error())
}
t.Errorf(err.Error())
}
for k, v := range expect {

View File

@ -165,9 +165,8 @@ func RunReplace(f *util.Factory, cmd *cobra.Command, out io.Writer, c *replaceOp
if err != nil {
if errors.IsNotFound(err) {
return fmt.Errorf("cluster %q not found", clusterName)
} else {
return fmt.Errorf("error fetching cluster %q: %v", clusterName, err)
}
return fmt.Errorf("error fetching cluster %q: %v", clusterName, err)
}
// check if the instancegroup exists already
igName := v.ObjectMeta.Name

View File

@ -221,9 +221,8 @@ func (c *RootCmd) ProcessArgs(args []string) error {
if len(args) == 1 {
return fmt.Errorf("Cannot specify cluster via --name and positional argument")
} else {
return fmt.Errorf("expected a single <clustername> to be passed as an argument")
}
return fmt.Errorf("expected a single <clustername> to be passed as an argument")
}
func (c *RootCmd) ClusterName() string {