Skip to content

Commit

Permalink
clientutil: add func to find control plane nodes
Browse files Browse the repository at this point in the history
add utilities to getch all the controlplane nodes,
similarly to worker node which we support since forever.

Signed-off-by: Francesco Romani <[email protected]>
  • Loading branch information
ffromani committed Jul 31, 2024
1 parent da17968 commit c5094bb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/clientutil/nodes/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,19 @@ import (
)

const (
// RoleWorker contains the worker role
RoleWorker = "worker"
RoleControlPlane = "control-plane"
RoleWorker = "worker"
)

const (
// LabelRole contains the key for the role label
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)
}
Expand Down

0 comments on commit c5094bb

Please sign in to comment.