utils

package
v0.5.0-rc.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// WorkerRoleLabel is the role label of worker nodes
	WorkerRoleLabel = "node-role.kubernetes.io/worker"
	// MasterRoleLabel is the old role label of control plane nodes
	MasterRoleLabel = "node-role.kubernetes.io/master"
	// ControlPlaneRoleLabel is the new role label of control plane nodes
	ControlPlaneRoleLabel = "node-role.kubernetes.io/control-plane"
)

Variables

This section is empty.

Functions

func GetDeploymentNamespace

func GetDeploymentNamespace() (string, error)

GetDeploymentNamespace returns the Namespace this operator is deployed on.

func GetLogWithNHC added in v0.3.0

func GetLogWithNHC(log logr.Logger, nhc *v1alpha1.NodeHealthCheck) logr.Logger

GetLogWithNHC return a logger with NHC namespace and name

func IsConditionTrue added in v0.3.0

func IsConditionTrue(conditions []v1.Condition, conditionType string, reason string) bool

IsConditionTrue return true when the conditions contain a condition of given type and reason with status true

func IsControlPlane added in v0.4.0

func IsControlPlane(node *v1.Node) bool

func IsOnOpenshift

func IsOnOpenshift(config *rest.Config) (bool, error)

IsOnOpenshift returns true if the cluster has the openshift config group

func NHCByNodeMapperFunc added in v0.3.0

func NHCByNodeMapperFunc(c client.Client, logger logr.Logger) handler.MapFunc

NHCByNodeMapperFunc return the Node-to-NHC mapper function

func NHCByRemediationCRMapperFunc added in v0.5.0

func NHCByRemediationCRMapperFunc(logger logr.Logger) handler.MapFunc

NHCByRemediationCRMapperFunc return the RemediationCR-to-NHC mapper function

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL