From f0f5461862287cc3242db5194c38d17e807c9124 Mon Sep 17 00:00:00 2001
From: haozi007 <liuhao27@huawei.com>
Date: Wed, 28 Jul 2021 08:20:14 +0100
Subject: [PATCH 6/9] remove unuseful code

Signed-off-by: haozi007 <liuhao27@huawei.com>
---
 pkg/api/types.go                       |  1 -
 pkg/clusterdeployment/binary/binary.go |  4 ----
 pkg/clusterdeployment/clusterdeploy.go | 14 --------------
 3 files changed, 19 deletions(-)

diff --git a/pkg/api/types.go b/pkg/api/types.go
index 403dde3..71f4f14 100644
--- a/pkg/api/types.go
+++ b/pkg/api/types.go
@@ -249,7 +249,6 @@ type ClusterManagerAPI interface {
 	ClusterStatus() (*ClusterStatus, error)
 	AddonsSetup() error
 	AddonsDestroy() error
-	TaintAndLabelNode(name string) error
 }
 
 type LoadBalancerAPI interface {
diff --git a/pkg/clusterdeployment/binary/binary.go b/pkg/clusterdeployment/binary/binary.go
index 96c0dd1..cc6a6a0 100644
--- a/pkg/clusterdeployment/binary/binary.go
+++ b/pkg/clusterdeployment/binary/binary.go
@@ -139,10 +139,6 @@ func taintAndLabelNode(clusterID string, name string) error {
 	return nil
 }
 
-func (bcp *BinaryClusterDeployment) TaintAndLabelNode(name string) error {
-	return taintAndLabelNode(bcp.config.Name, name)
-}
-
 func (bcp *BinaryClusterDeployment) taintAndLabelMasterNodes() error {
 	for _, node := range bcp.config.Nodes {
 		if (node.Type&api.Master != 0) && (node.Type&api.Worker != 0) {
diff --git a/pkg/clusterdeployment/clusterdeploy.go b/pkg/clusterdeployment/clusterdeploy.go
index e5f69f0..016da2b 100644
--- a/pkg/clusterdeployment/clusterdeploy.go
+++ b/pkg/clusterdeployment/clusterdeploy.go
@@ -175,20 +175,6 @@ func doJoinNode(handler api.ClusterDeploymentAPI, cc *api.ClusterConfig, hostcon
 		return err
 	}
 
-	roles := hostconfig.Type
-	for _, node := range cc.Nodes {
-		if node.Name == hostconfig.Name {
-			roles |= node.Type
-			break
-		}
-	}
-
-	if utils.IsType(roles, api.Master) && utils.IsType(roles, api.Worker) {
-		if err := handler.TaintAndLabelNode(hostconfig.Name); err != nil {
-			return err
-		}
-	}
-
 	return nil
 }
 
-- 
2.25.1

