mirror of https://github.com/k3s-io/k3s
Merge pull request #74400 from rojkov/kubeadm-refactor-etcdClient
kubeadm: simplify creating etcdClientpull/564/head
commit
65cdd7e74a
|
@ -98,22 +98,17 @@ func runPlan(flags *planFlags, userVersion string) error {
|
||||||
// external etcd vs static pod etcd
|
// external etcd vs static pod etcd
|
||||||
isExternalEtcd := cfg.Etcd.External != nil
|
isExternalEtcd := cfg.Etcd.External != nil
|
||||||
if isExternalEtcd {
|
if isExternalEtcd {
|
||||||
client, err := etcdutil.New(
|
etcdClient, err = etcdutil.New(
|
||||||
cfg.Etcd.External.Endpoints,
|
cfg.Etcd.External.Endpoints,
|
||||||
cfg.Etcd.External.CAFile,
|
cfg.Etcd.External.CAFile,
|
||||||
cfg.Etcd.External.CertFile,
|
cfg.Etcd.External.CertFile,
|
||||||
cfg.Etcd.External.KeyFile)
|
cfg.Etcd.External.KeyFile)
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
etcdClient = client
|
|
||||||
} else {
|
} else {
|
||||||
// Connects to local/stacked etcd existing in the cluster
|
// Connects to local/stacked etcd existing in the cluster
|
||||||
client, err := etcdutil.NewFromCluster(client, cfg.CertificatesDir)
|
etcdClient, err = etcdutil.NewFromCluster(client, cfg.CertificatesDir)
|
||||||
if err != nil {
|
}
|
||||||
return err
|
if err != nil {
|
||||||
}
|
return err
|
||||||
etcdClient = client
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compute which upgrade possibilities there are
|
// Compute which upgrade possibilities there are
|
||||||
|
|
Loading…
Reference in New Issue