helper

package
v1.107.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Semantic = conversion.EqualitiesOrDie(
	func(a, b resource.Quantity) bool {

		return a.Cmp(b) == 0
	},
	func(a, b metav1.MicroTime) bool {
		return a.UTC() == b.UTC()
	},
	func(a, b metav1.Time) bool {
		return a.UTC() == b.UTC()
	},
	func(a, b labels.Selector) bool {
		return a.String() == b.String()
	},
	func(a, b fields.Selector) bool {
		return a.String() == b.String()
	},
)

Semantic can do semantic deep equality checks for core objects. Example: apiequality.Semantic.DeepEqual(aPod, aPodWithNonNilButEmptyMaps) == true Copied from https://github.com/kubernetes/kubernetes/blob/v1.31.0/pkg/apis/core/helper/helpers.go#L92-L114

Functions

func AddOrUpdateDaemonPodTolerations

func AddOrUpdateDaemonPodTolerations(spec *corev1.PodSpec)

AddOrUpdateDaemonPodTolerations apply necessary tolerations to DaemonSet Pods, e.g. node.kubernetes.io/not-ready:NoExecute. Copied from https://github.com/kubernetes/kubernetes/blob/v1.31.0/pkg/controller/daemon/util/daemonset_util.go#L47-L102

func AddOrUpdateTolerationInPodSpec

func AddOrUpdateTolerationInPodSpec(spec *corev1.PodSpec, toleration *corev1.Toleration) bool

AddOrUpdateTolerationInPodSpec tries to add a toleration to the toleration list in PodSpec. Returns true if something was updated, false otherwise. Copied from https://github.com/kubernetes/kubernetes/blob/v1.31.0/pkg/apis/core/v1/helper/helpers.go#L261-L287

func NodeShouldRunDaemonPod

func NodeShouldRunDaemonPod(node *corev1.Node, ds *appsv1.DaemonSet) (bool, bool)

NodeShouldRunDaemonPod checks a set of preconditions against a (node,daemonset) and returns a summary. Returned booleans are:

  • shouldRun: Returns true when a daemonset should run on the node if a daemonset pod is not already running on that node.
  • shouldContinueRunning: Returns true when a daemonset should continue running on a node if a daemonset pod is already running on that node.

Copied from https://github.com/kubernetes/kubernetes/blob/v1.31.0/pkg/controller/daemon/daemon_controller.go#L1275-L1330

Types

This section is empty.

Jump to

Keyboard shortcuts

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