Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions manifests/machineconfigcontroller/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ spec:
- "start"
- "--resourcelock-namespace={{.TargetNamespace}}"
- "--v=2"
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
resources:
requests:
cpu: 20m
Expand Down
16 changes: 0 additions & 16 deletions pkg/controller/drain/drain_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"encoding/json"
"fmt"
"os"
"strings"
"time"

Expand Down Expand Up @@ -68,7 +67,6 @@ type Controller struct {

queue workqueue.RateLimitingInterface
ongoingDrains map[string]time.Time
podName string
}

// New returns a new node controller.
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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(),
Expand Down