Skip to content

Commit

Permalink
Merge pull request #74400 from rojkov/kubeadm-refactor-etcdClient
Browse files Browse the repository at this point in the history
kubeadm: simplify creating etcdClient
  • Loading branch information
k8s-ci-robot committed Feb 23, 2019
2 parents b77e4e2 + 926d901 commit 65cdd7e
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions cmd/kubeadm/app/cmd/upgrade/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,22 +98,17 @@ func runPlan(flags *planFlags, userVersion string) error {
// external etcd vs static pod etcd
isExternalEtcd := cfg.Etcd.External != nil
if isExternalEtcd {
client, err := etcdutil.New(
etcdClient, err = etcdutil.New(
cfg.Etcd.External.Endpoints,
cfg.Etcd.External.CAFile,
cfg.Etcd.External.CertFile,
cfg.Etcd.External.KeyFile)
if err != nil {
return err
}
etcdClient = client
} else {
// Connects to local/stacked etcd existing in the cluster
client, err := etcdutil.NewFromCluster(client, cfg.CertificatesDir)
if err != nil {
return err
}
etcdClient = client
etcdClient, err = etcdutil.NewFromCluster(client, cfg.CertificatesDir)
}
if err != nil {
return err
}

// Compute which upgrade possibilities there are
Expand Down

0 comments on commit 65cdd7e

Please sign in to comment.