Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary code #6053

Merged
merged 2 commits into from
Nov 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions cmd/kops/create_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,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?)")
}
}

Expand Down Expand Up @@ -1368,11 +1367,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
}
3 changes: 1 addition & 2 deletions cmd/kops/create_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 1 addition & 2 deletions cmd/kops/replace.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions cmd/kops/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down