nodeops

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2020 License: Apache-2.0, BSD-3-Clause Imports: 11 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(c clientset.Interface, nodeName string, condition v1.NodeCondition) error

AddOrUpdateConditionsOnNode adds a condition to the node's status

func AddOrUpdateTaintOnNode

func AddOrUpdateTaintOnNode(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(c clientset.Interface, nodeName string, conditionType v1.NodeConditionType) (*v1.NodeCondition, error)

GetNodeCondition get the nodes condition matching the specified type

func PatchNodeTaints

func PatchNodeTaints(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(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(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(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