util

package
v0.2.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	NodeAnnotationPretendReadyUntil = "kube-service-exporter.github.com/pretend-ready-until"
)

Variables

This section is empty.

Functions

func GetNodeCondition added in v0.2.1

func GetNodeCondition(node *v1.Node, conditionType v1.NodeConditionType) (v1.NodeCondition, bool)

GetNodeCondition returns the Node condition of a particular type returns the NodeCondition and true if found, otherwise returns an empty NodeCondition and false

func IsDomainName added in v0.1.13

func IsDomainName(s string) bool

IsDomainName checks if a string is a presentation-format domain name Copied from the stdlib: https://github.com/golang/go/blob/91b8cc0dfaae12af1a89e2b7ad3da10728883ee1/src/net/dnsclient.go#LL75C6-L75C6

func ParseNodeSelectors added in v0.1.7

func ParseNodeSelectors(selectors string) ([]string, error)

ParseNodeSelectors parses the node selector string as a JSON array if possible, otherwise it treats it as a literal.

func ShouldInclude added in v0.2.3

func ShouldInclude(node *v1.Node) (bool, time.Duration)

ShouldInclude returns true if the node should be included in the list of available nodes based on whether the Node is ready OR the grace period is still in effect. the second return value is the amount of time of the grace period remaining (where the state would need to be checked a final time) if the amount of time is zero, then the grace period has passed, never existed or was unparseable.

func StringInSlice

func StringInSlice(str string, strs []string) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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