From 8846117fc628681323a55c61513efdcd2f49d941 Mon Sep 17 00:00:00 2001 From: prashanth26 Date: Mon, 14 Jan 2019 10:40:38 +0530 Subject: [PATCH] Removed use/dependency on node label on machine object --- pkg/controller/machine.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pkg/controller/machine.go b/pkg/controller/machine.go index d03e7d487..88669e588 100644 --- a/pkg/controller/machine.go +++ b/pkg/controller/machine.go @@ -25,7 +25,7 @@ import ( "github.com/golang/glog" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/selection" "k8s.io/apimachinery/pkg/util/sets" @@ -354,10 +354,6 @@ func (c *controller) machineCreate(machine *v1alpha1.Machine, driver driver.Driv clone := machine.DeepCopy() - if clone.Labels == nil { - clone.Labels = make(map[string]string) - } - clone.Labels["node"] = nodeName if clone.Annotations == nil { clone.Annotations = make(map[string]string) } @@ -456,7 +452,7 @@ func (c *controller) machineDelete(machine *v1alpha1.Machine, driver driver.Driv buf := bytes.NewBuffer([]byte{}) errBuf := bytes.NewBuffer([]byte{}) - nodeName := machine.Labels["node"] + nodeName := machine.Status.Node drainOptions := NewDrainOptions( c.targetCoreClient, timeOutDuration, // TODO: Will need to configure timeout