Skip to content

Commit

Permalink
Ensure windows nodes are excluded by default
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
  • Loading branch information
pmengelbert committed Feb 7, 2023
1 parent b933a66 commit fce64ac
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 16 deletions.
1 change: 1 addition & 0 deletions config/manager/controller_manager_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ manager:
type: exclude # must be either exclude|include
selectors:
- eraser.sh/cleanup.filter
- kubernetes.io/os=windows
components:
collector:
enabled: true
Expand Down
10 changes: 0 additions & 10 deletions controllers/imagejob/imagejob_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,6 @@ var defaultTolerations = []corev1.Toleration{
}

func Add(mgr manager.Manager, cfg *config.Manager) error {
c, err := cfg.Read()
if err != nil {
return err
}

filterOpts := c.Manager.NodeFilter
if filterOpts.Type == "exclude" && !slices.Contains(filterOpts.Selectors, windowsFilterLabel) {
filterOpts.Selectors = append(filterOpts.Selectors, windowsFilterLabel)
}

return add(mgr, newReconciler(mgr, cfg))
}

Expand Down
7 changes: 4 additions & 3 deletions manifest_staging/charts/eraser/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ runtimeConfig:
pullSecrets: [] # image pull secrets for collector/scanner/eraser
priorityClassName: "" # priority class name for collector/scanner/eraser
nodeFilter: {}
# type: exclude # must be either exclude|include
# selectors:
# - eraser.sh/cleanup.filter
type: exclude # must be either exclude|include
selectors:
- eraser.sh/cleanup.filter
- kubernetes.io/os=windows
components:
collector:
enabled: true
Expand Down
1 change: 1 addition & 0 deletions manifest_staging/deploy/eraser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ data:
type: exclude # must be either exclude|include
selectors:
- eraser.sh/cleanup.filter
- kubernetes.io/os=windows
components:
collector:
enabled: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ runtimeConfig:
pullSecrets: [] # image pull secrets for collector/scanner/eraser
priorityClassName: "" # priority class name for collector/scanner/eraser
nodeFilter: {}
# type: exclude # must be either exclude|include
# selectors:
# - eraser.sh/cleanup.filter
type: exclude # must be either exclude|include
selectors:
- eraser.sh/cleanup.filter
- kubernetes.io/os=windows
components:
collector:
enabled: true
Expand Down

0 comments on commit fce64ac

Please sign in to comment.