From c5094bba1ee3f8ee1f4c70d902b68bf1d7f5a02a Mon Sep 17 00:00:00 2001 From: Francesco Romani Date: Wed, 31 Jul 2024 10:49:51 +0200 Subject: [PATCH] clientutil: add func to find control plane nodes add utilities to getch all the controlplane nodes, similarly to worker node which we support since forever. Signed-off-by: Francesco Romani --- pkg/clientutil/nodes/nodes.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/clientutil/nodes/nodes.go b/pkg/clientutil/nodes/nodes.go index ef4d2413..d25f3c1a 100644 --- a/pkg/clientutil/nodes/nodes.go +++ b/pkg/clientutil/nodes/nodes.go @@ -28,8 +28,8 @@ import ( ) const ( - // RoleWorker contains the worker role - RoleWorker = "worker" + RoleControlPlane = "control-plane" + RoleWorker = "worker" ) const ( @@ -37,6 +37,10 @@ const ( LabelRole = "node-role.kubernetes.io" ) +func GetControlPlane(env *deployer.Environment) ([]corev1.Node, error) { + return GetByRole(env, RoleControlPlane) +} + func GetWorkers(env *deployer.Environment) ([]corev1.Node, error) { return GetByRole(env, RoleWorker) }