diff --git a/manifests/machineconfigcontroller/deployment.yaml b/manifests/machineconfigcontroller/deployment.yaml index 3511c3d3fa..868ded5d75 100644 --- a/manifests/machineconfigcontroller/deployment.yaml +++ b/manifests/machineconfigcontroller/deployment.yaml @@ -22,11 +22,6 @@ spec: - "start" - "--resourcelock-namespace={{.TargetNamespace}}" - "--v=2" - env: - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name resources: requests: cpu: 20m diff --git a/pkg/controller/drain/drain_controller.go b/pkg/controller/drain/drain_controller.go index 01fa248b01..e06fea0348 100644 --- a/pkg/controller/drain/drain_controller.go +++ b/pkg/controller/drain/drain_controller.go @@ -4,7 +4,6 @@ import ( "context" "encoding/json" "fmt" - "os" "strings" "time" @@ -68,7 +67,6 @@ type Controller struct { queue workqueue.RateLimitingInterface ongoingDrains map[string]time.Time - podName string } // New returns a new node controller. @@ -122,12 +120,6 @@ func (ctrl *Controller) Run(workers int, stopCh <-chan struct{}) { return } - podName, ok := os.LookupEnv("POD_NAME") - if !ok || podName == "" { - glog.Fatalf("pod name is required for controller drainer") - } - ctrl.podName = podName - ongoingDrains := make(map[string]time.Time) ctrl.ongoingDrains = ongoingDrains @@ -269,14 +261,6 @@ func (ctrl *Controller) syncNode(key string) error { } ctrl.logNode(node, "%s pod %s/%s", verbStr, pod.Namespace, pod.Name) }, - AdditionalFilters: []drain.PodFilter{ - func(pod corev1.Pod) drain.PodDeleteStatus { - if pod.Name == ctrl.podName { - return drain.MakePodDeleteStatusSkip() - } - return drain.MakePodDeleteStatusOkay() - }, - }, Out: writer{glog.Info}, ErrOut: writer{glog.Error}, Ctx: context.TODO(),