node

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAddNodeHandler

func CreateAddNodeHandler(f func(node *v1.Node) error) func(obj interface{})

CreateAddNodeHandler creates an add node handler.

func CreateDeleteNodeHandler

func CreateDeleteNodeHandler(f func(node *v1.Node) error) func(obj interface{})

CreateDeleteNodeHandler creates a delete node handler. (Common to lifecycle and ipam)

func CreateUpdateNodeHandler

func CreateUpdateNodeHandler(f func(oldNode, newNode *v1.Node) error) func(oldObj, newObj interface{})

CreateUpdateNodeHandler creates a node update handler. (Common to lifecycle and ipam)

func GetNodeCondition

func GetNodeCondition(status *v1.NodeStatus, conditionType v1.NodeConditionType) (int, *v1.NodeCondition)

GetNodeCondition extracts the provided condition from the given status and returns that. Returns nil and -1 if the condition is not present, and the index of the located condition.

func PatchNodePodCIDRs

func PatchNodePodCIDRs(corev1client *corev1client.CoreV1Client, node *v1.Node, cidr []string) error

PatchNodePodCIDRs patches the node podCIDR to the specified value.

func PtrTo

func PtrTo[T any](v T) *T

PtrTo returns a pointer to a copy of any value.

func RecordNodeStatusChange

func RecordNodeStatusChange(recorder record.EventRecorder, node *v1.Node, newStatus string)

RecordNodeStatusChange records a event related to a node status change. (Common to lifecycle and ipam)

Types

type NodePatch

type NodePatch struct {
	Spec     *NodePatchSpec     `json:"spec,omitempty"`
	Metadata *NodePatchMetadata `json:"metadata,omitempty"`
}

NodePatch holds the fields to patch

type NodePatchMetadata

type NodePatchMetadata struct {
	Labels map[string]*string `json:"labels,omitempty"`
}

NodePatchMetadata holds the metadata for the node patch operation

type NodePatchSpec

type NodePatchSpec struct {
	PodCIDR  string   `json:"podCIDR,omitempty"`
	PodCIDRs []string `json:"podCIDRs,omitempty"`
}

NodePatchSpec holds the spec for the node patch operation

Jump to

Keyboard shortcuts

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