helper

package
v1.32.4 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: Apache-2.0 Imports: 10 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

Functions

func IsExtendedResourceName

func IsExtendedResourceName(name core.ResourceName) bool

IsExtendedResourceName returns true if: 1. the resource name is not in the default namespace; 2. resource name does not have "requests." prefix, to avoid confusion with the convention in quota 3. it satisfies the rules in IsQualifiedName() after converted into quota resource name

func IsHugePageResourceName

func IsHugePageResourceName(name core.ResourceName) bool

IsHugePageResourceName returns true if the resource name has the huge page resource prefix.

func IsIntegerResourceName

func IsIntegerResourceName(str string) bool

IsIntegerResourceName returns true if the resource is measured in integer values

func IsNativeResource

func IsNativeResource(name core.ResourceName) bool

IsNativeResource returns true if the resource name is in the *kubernetes.io/ namespace. Partially-qualified (unprefixed) names are implicitly in the kubernetes.io/ namespace.

func IsQuotaHugePageResourceName

func IsQuotaHugePageResourceName(name core.ResourceName) bool

IsQuotaHugePageResourceName returns true if the resource name has the quota related huge page resource prefix.

func IsStandardContainerResourceName

func IsStandardContainerResourceName(str string) bool

IsStandardContainerResourceName returns true if the container can make a resource request for the specified resource

func IsStandardResourceName

func IsStandardResourceName(str string) bool

IsStandardResourceName returns true if the resource is known to the system

Types

This section is empty.

Jump to

Keyboard shortcuts

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