Skip to content

Commit

Permalink
multinode cluster: fix waits and joins
Browse files Browse the repository at this point in the history
  • Loading branch information
prezha committed Mar 10, 2021
1 parent 13f07dd commit dc476fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions pkg/minikube/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ func Add(cc *config.ClusterConfig, n config.Node, delOnFail bool) error {
return err
}

// remove drains and deletes the given node in the given cluster.
func remove(cc config.ClusterConfig, name string) (*config.Node, error) {
// drainNode drains then deletes (removes) node from cluster.
func drainNode(cc config.ClusterConfig, name string) (*config.Node, error) {
n, index, err := Retrieve(cc, name)
if err != nil {
return n, errors.Wrap(err, "retrieve")
Expand Down Expand Up @@ -128,9 +128,9 @@ func remove(cc config.ClusterConfig, name string) (*config.Node, error) {
return n, config.SaveProfile(viper.GetString(config.ProfileName), &cc)
}

// Delete calls remove to remove node from cluster and deletes the host.
// Delete calls drainNode to remove node from cluster and deletes the host.
func Delete(cc config.ClusterConfig, name string) (*config.Node, error) {
n, err := remove(cc, name)
n, err := drainNode(cc, name)
if err != nil {
return n, err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/minikube/node/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ func joinCluster(starter Starter, cpBs bootstrapper.Bootstrapper, bs bootstrappe
// You must delete the existing Node or change the name of this new joining Node"
if starter.PreExists {
klog.Infof("removing existing worker node %q before attempting to rejoin cluster: %+v", starter.Node.Name, starter.Node)
if _, err := remove(*starter.Cfg, starter.Node.Name); err != nil {
if _, err := drainNode(*starter.Cfg, starter.Node.Name); err != nil {
klog.Errorf("error removing existing worker node before rejoining cluster, will continue anyway: %v", err)
}
klog.Infof("successfully removed existing worker node %q from cluster: %+v", starter.Node.Name, starter.Node)
Expand Down

0 comments on commit dc476fe

Please sign in to comment.