helper

package
v1.88.2 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more 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.26.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.26.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.26.0/pkg/apis/core/v1/helper/helpers.go#L290-L316

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.26.0/pkg/controller/daemon/daemon_controller.go#L1238-L1293

Types

This section is empty.

Jump to

Keyboard shortcuts

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