taints

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package taints implements utilities for working with taints.

Package taints implements utilities for working with taints.

Index

Constants

View Source
const (
	MODIFIED  = "modified"
	TAINTED   = "tainted"
	UNTAINTED = "untainted"
)

consts that are returned by ReorganizeTaints that tell the caller the summary of what's been done to the node's taints (added, removed, just updated).

Variables

This section is empty.

Functions

func DeleteTaint

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

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

func DeleteTaintsByKey

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

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

func ParseTaints

func ParseTaints(spec []string) (taintsToAdd, taintsToRemove []corev1.Taint, err error)

ParseTaints takes a spec which is an array and creates slices for new taints to be added, taints to be deleted. It also validates the spec. For example, the form `<key>` may be used to remove a taint, but not to add one.

func ReorganizeTaints

func ReorganizeTaints(node *corev1.Node, overwrite bool, taintsToAdd, taintsToRemove []corev1.Taint) (string, []corev1.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 []corev1.Taint, taintToFind *corev1.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 []corev1.Taint) (taintsToAdd, taintsToRemove []*corev1.Taint)

TaintSetDiff returns the diff of two lists of taints.

Types

This section is empty.

Jump to

Keyboard shortcuts

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