Unverified Commit 439e32b0 authored by Hussein Galal's avatar Hussein Galal Committed by GitHub

fix Node stuck at deletion (#3777)

parent f72e2cb3
...@@ -35,6 +35,10 @@ import ( ...@@ -35,6 +35,10 @@ import (
utilnet "k8s.io/apimachinery/pkg/util/net" utilnet "k8s.io/apimachinery/pkg/util/net"
) )
const (
memberRemovalTimeout = time.Minute * 1
)
type ETCD struct { type ETCD struct {
client *etcd.Client client *etcd.Client
config *config.Control config *config.Control
...@@ -535,6 +539,8 @@ func (e *ETCD) cluster(ctx context.Context, forceNew bool, options executor.Init ...@@ -535,6 +539,8 @@ func (e *ETCD) cluster(ctx context.Context, forceNew bool, options executor.Init
// removePeer removes a peer from the cluster. The peer ID and IP address must both match. // removePeer removes a peer from the cluster. The peer ID and IP address must both match.
func (e *ETCD) removePeer(ctx context.Context, id, address string, removeSelf bool) error { func (e *ETCD) removePeer(ctx context.Context, id, address string, removeSelf bool) error {
ctx, cancel := context.WithTimeout(ctx, memberRemovalTimeout)
defer cancel()
members, err := e.client.MemberList(ctx) members, err := e.client.MemberList(ctx)
if err != nil { if err != nil {
return err return err
......
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