From 5f9df8a0ff9b7e1ff68691ceebb23d6efca8ac75 Mon Sep 17 00:00:00 2001 From: Ben Vesel <10840174+bennerv@users.noreply.github.com> Date: Fri, 30 Jun 2023 15:11:06 -0400 Subject: [PATCH] AutoSized Nodes now reference both masters and workers (#2997) --- .../autosizednodes/autosizednodes_controller.go | 7 +++++-- .../autosizednodes/autosizednodes_controller_test.go | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/pkg/operator/controllers/autosizednodes/autosizednodes_controller.go b/pkg/operator/controllers/autosizednodes/autosizednodes_controller.go index 016a3babfd3..bec92d2d848 100644 --- a/pkg/operator/controllers/autosizednodes/autosizednodes_controller.go +++ b/pkg/operator/controllers/autosizednodes/autosizednodes_controller.go @@ -126,8 +126,11 @@ func makeConfig() mcv1.KubeletConfig { Spec: mcv1.KubeletConfigSpec{ AutoSizingReserved: util.BoolToPtr(true), MachineConfigPoolSelector: &metav1.LabelSelector{ - MatchLabels: map[string]string{ - "pools.operator.machineconfiguration.openshift.io/worker": "", + MatchExpressions: []metav1.LabelSelectorRequirement{ + { + Key: "machineconfiguration.openshift.io/mco-built-in", + Operator: metav1.LabelSelectorOpExists, + }, }, }, }, diff --git a/pkg/operator/controllers/autosizednodes/autosizednodes_controller_test.go b/pkg/operator/controllers/autosizednodes/autosizednodes_controller_test.go index 2055dd8de65..d16c8e259d2 100644 --- a/pkg/operator/controllers/autosizednodes/autosizednodes_controller_test.go +++ b/pkg/operator/controllers/autosizednodes/autosizednodes_controller_test.go @@ -84,8 +84,11 @@ func TestAutosizednodesReconciler(t *testing.T) { Spec: mcv1.KubeletConfigSpec{ AutoSizingReserved: util.BoolToPtr(false), MachineConfigPoolSelector: &metav1.LabelSelector{ - MatchLabels: map[string]string{ - "pools.operator.machineconfiguration.openshift.io/worker": "", + MatchExpressions: []metav1.LabelSelectorRequirement{ + { + Key: "machineconfiguration.openshift.io/mco-built-in", + Operator: metav1.LabelSelectorOpExists, + }, }, }, },