nodeops

package
v0.55.1 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package nodeops is used to provide the node functionalities

Package nodeops is used to provide the node functionalities

Index

Constants

This section is empty.

Variables

View Source
var Backoff = wait.Backoff{
	Steps:    5,
	Duration: 100 * time.Millisecond,
	Jitter:   1.0,
}

Backoff is the backoff period used while updating nodes

Functions

func AddOrUpdateCondition

func AddOrUpdateCondition(node *v1.Node, condition v1.NodeCondition) *v1.Node

AddOrUpdateCondition adds a condition to the condition list. Returns a new copy of updated Node

func AddOrUpdateConditionsOnNode

func AddOrUpdateConditionsOnNode(ctx context.Context, c clientset.Interface, nodeName string, condition v1.NodeCondition) error

AddOrUpdateConditionsOnNode adds a condition to the node's status

func AddOrUpdateTaintOnNode

func AddOrUpdateTaintOnNode(ctx context.Context, c clientset.Interface, nodeName string, taints ...*v1.Taint) error

AddOrUpdateTaintOnNode add taints to the node. If taint was added into node, it'll issue API calls to update nodes; otherwise, no API calls. Return error if any.

func CloneAndAddCondition

func CloneAndAddCondition(conditions []v1.NodeCondition, condition v1.NodeCondition) []v1.NodeCondition

CloneAndAddCondition adds condition to the conditions slice if

func GetNodeCondition

func GetNodeCondition(ctx context.Context, c clientset.Interface, nodeName string, conditionType v1.NodeConditionType) (*v1.NodeCondition, error)

GetNodeCondition get the nodes condition matching the specified type

func PatchNodeTaints

func PatchNodeTaints(ctx context.Context, c clientset.Interface, nodeName string, oldNode *v1.Node, newNode *v1.Node) error

PatchNodeTaints is for updating the node taints from oldNode to the newNode It makes a TwoWayMergePatch by comparing the two objects It calls the Patch() method to do the final patch

func RemoveTaintOffNode

func RemoveTaintOffNode(ctx context.Context, c clientset.Interface, nodeName string, node *v1.Node, taints ...*v1.Taint) error

RemoveTaintOffNode is for cleaning up taints temporarily added to node, won't fail if target taint doesn't exist or has been removed. If passed a node it'll check if there's anything to be done, if taint is not present it won't issue any API calls.

func UpdateNodeConditions

func UpdateNodeConditions(ctx context.Context, c clientset.Interface, nodeName string, oldNode *v1.Node, newNode *v1.Node) error

UpdateNodeConditions is for updating the node conditions from oldNode to the newNode using the nodes Update() method

func UpdateNodeTaints

func UpdateNodeTaints(ctx context.Context, c clientset.Interface, nodeName string, oldNode *v1.Node, newNode *v1.Node) error

UpdateNodeTaints is for updating the node taints from oldNode to the newNode using the nodes Update() method

Types

This section is empty.

Jump to

Keyboard shortcuts

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