Commit 83bc69b8 authored by pytimer's avatar pytimer

kubeadm: fixed etcd sync endpoints

parent 598a0198
...@@ -196,12 +196,13 @@ func NewFromCluster(client clientset.Interface, certificatesDir string) (*Client ...@@ -196,12 +196,13 @@ func NewFromCluster(client clientset.Interface, certificatesDir string) (*Client
if err != nil { if err != nil {
return nil, errors.Wrap(err, "error syncing endpoints with etc") return nil, errors.Wrap(err, "error syncing endpoints with etc")
} }
klog.V(1).Infof("update etcd endpoints: %s", strings.Join(etcdClient.Endpoints, ","))
return etcdClient, nil return etcdClient, nil
} }
// Sync synchronizes client's endpoints with the known endpoints from the etcd membership. // Sync synchronizes client's endpoints with the known endpoints from the etcd membership.
func (c Client) Sync() error { func (c *Client) Sync() error {
cli, err := clientv3.New(clientv3.Config{ cli, err := clientv3.New(clientv3.Config{
Endpoints: c.Endpoints, Endpoints: c.Endpoints,
DialTimeout: 20 * time.Second, DialTimeout: 20 * time.Second,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment