utils

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// IsRebootCapableAnnotation value is the key name for the node's annotation that will determine if node is reboot capable
	IsRebootCapableAnnotation     = "is-reboot-capable.self-node-remediation.medik8s.io"
	IsSoftwareRebootEnabledEnvVar = "IS_SOFTWARE_REBOOT_ENABLED"
)

Variables

View Source
var (

	//IsOutOfServiceTaintSupported will be set to true in case OutOfServiceTaint is supported (k8s 1.26 or higher)
	IsOutOfServiceTaintSupported bool
	//IsOutOfServiceTaintGA will be set to true in case OutOfServiceTaint is GA (k8s 1.28 or higher)
	IsOutOfServiceTaintGA bool
)

Functions

func DeleteTaint

func DeleteTaint(taints []v1.Taint, taintToDelete *v1.Taint) ([]v1.Taint, bool)

DeleteTaint removes all the taints that have the same key and effect to given taintToDelete.

func GetDeploymentNamespace

func GetDeploymentNamespace() (string, error)

GetDeploymentNamespace returns the Namespace this operator is deployed on.

func GetLinuxUptime

func GetLinuxUptime() (time.Duration, error)

GetLinuxUptime returns the uptime of a linux host

func GetSelfNodeRemediationAgentPod

func GetSelfNodeRemediationAgentPod(nodeName string, r client.Reader) (*v1.Pod, error)

func InitOutOfServiceTaintFlags added in v0.8.0

func InitOutOfServiceTaintFlags(config *rest.Config) error

func IsSoftwareRebootEnabled

func IsSoftwareRebootEnabled() (bool, error)

func TaintExists

func TaintExists(taints []v1.Taint, taintToFind *v1.Taint) bool

TaintExists checks if the given taint exists in list of taints. Returns true if exists false otherwise.

func UpdateNodeWithIsRebootCapableAnnotation

func UpdateNodeWithIsRebootCapableAnnotation(watchdogInitiated bool, nodeName string, mgr manager.Manager) error

UpdateNodeWithIsRebootCapableAnnotation updates the is-reboot-capable node annotation to be true if any kind of reboot is enabled and false if there isn't watchdog and software reboot is disabled

Types

This section is empty.

Jump to

Keyboard shortcuts

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