taints

package
v0.44.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: Apache-2.0, BSD-3-Clause Imports: 7 Imported by: 6

Documentation

Overview

Package taints implements utilites for working with taints

Index

Constants

View Source
const (
	// MODIFIED refer's to the object was modified
	MODIFIED = "modified"
	// TAINTED refer's if it was tainted
	TAINTED = "tainted"
	// UNTAINTED refer's if it was untainted
	UNTAINTED = "untainted"
)

Variables

This section is empty.

Functions

func AddOrUpdateTaint

func AddOrUpdateTaint(node *v1.Node, taint *v1.Taint) (*v1.Node, bool, error)

AddOrUpdateTaint tries to add a taint to annotations list. Returns a new copy of updated Node and true if something was updated false otherwise.

func CheckIfTaintsAlreadyExists

func CheckIfTaintsAlreadyExists(oldTaints []v1.Taint, taints []v1.Taint) string

CheckIfTaintsAlreadyExists checks if the node already has taints that we want to add and returns a string with taint keys.

func DeleteTaint

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

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

func DeleteTaintsByKey

func DeleteTaintsByKey(taints []v1.Taint, taintKey string) ([]v1.Taint, bool)

DeleteTaintsByKey removes all the taints that have the same key to given taintKey

func ParseTaints

func ParseTaints(spec []string) ([]v1.Taint, []v1.Taint, error)

ParseTaints takes a spec which is an array and creates slices for new taints to be added, taints to be deleted.

func RemoveTaint

func RemoveTaint(node *v1.Node, taint *v1.Taint) (*v1.Node, bool, error)

RemoveTaint tries to remove a taint from annotations list. Returns a new copy of updated Node and true if something was updated false otherwise.

func ReorganizeTaints

func ReorganizeTaints(node *v1.Node, overwrite bool, taintsToAdd []v1.Taint, taintsToRemove []v1.Taint) (string, []v1.Taint, error)

ReorganizeTaints returns the updated set of taints, taking into account old taints that were not updated, old taints that were updated, old taints that were deleted, and new taints.

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 TaintSetDiff

func TaintSetDiff(t1, t2 []v1.Taint) (taintsToAdd []*v1.Taint, taintsToRemove []*v1.Taint)

TaintSetDiff set difference between the taints

func TaintSetFilter

func TaintSetFilter(taints []v1.Taint, fn func(*v1.Taint) bool) []v1.Taint

TaintSetFilter filter from the set of taints

Types

type Var

type Var struct {
	// contains filtered or unexported fields
}

Var are varibles used to tarck taints

func NewVar

func NewVar(ptr *[]v1.Taint) Var

NewVar wraps []api.Taint in a struct that implements flag.Value to allow taints to be bound to command line flags.

func (Var) Set

func (t Var) Set(s string) error

Set sets the type for Var

func (Var) String

func (t Var) String() string

String gets the String for Var

func (Var) Type

func (t Var) Type() string

Type gets the type for Var

Jump to

Keyboard shortcuts

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