util

package
v0.0.0-...-2350287 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckTCPPortOpened

func CheckTCPPortOpened(host string, port int) error

func DumpJSON

func DumpJSON(o interface{}) string

DumpJSON returns the JSON encoding

func GetContainerEnvVar

func GetContainerEnvVar(container *v1.Container, key string) *v1.EnvVar

func GetMD5Hash

func GetMD5Hash(text string) string

func GetPodCondition

func GetPodCondition(status *v1.PodStatus, conditionType v1.PodConditionType) (int, *v1.PodCondition)

GetPodCondition extracts the provided condition from the given status and returns that. Returns nil and -1 if the condition is not present, and the index of the located condition.

func GetPodConditionFromList

func GetPodConditionFromList(conditions []v1.PodCondition, conditionType v1.PodConditionType) (int, *v1.PodCondition)

GetPodConditionFromList extracts the provided condition from the given list of condition and returns the index of the condition and the condition. Returns -1 and nil if the condition is not present.

func GetPodReadyCondition

func GetPodReadyCondition(status v1.PodStatus) *v1.PodCondition

GetPodReadyCondition extracts the pod ready condition from the given status and returns that. Returns nil if the condition is not present.

func IsHashChangedError

func IsHashChangedError(err error) bool

func IsPodActive

func IsPodActive(p *v1.Pod) bool

func IsPodReady

func IsPodReady(pod *v1.Pod) bool

IsPodReady returns true if a pod is ready; false otherwise.

func IsPodReadyConditionTrue

func IsPodReadyConditionTrue(status v1.PodStatus) bool

IsPodReadyConditionTrue returns true if a pod is ready; false otherwise.

func LastReplace

func LastReplace(s, old, new string) string

func MergeLabelSelector

func MergeLabelSelector(selA, selB *metav1.LabelSelector) *metav1.LabelSelector

func NegateLabelSelector

func NegateLabelSelector(sel *metav1.LabelSelector) *metav1.LabelSelector

func NewClientFromManager

func NewClientFromManager(mgr manager.Manager, name string) client.Client

func ValidatedLabelSelectorAsSelector

func ValidatedLabelSelectorAsSelector(ps *metav1.LabelSelector) (labels.Selector, error)

Types

type HashChangedError

type HashChangedError struct {
	// contains filtered or unexported fields
}

func (HashChangedError) Error

func (e HashChangedError) Error() string

func (HashChangedError) String

func (e HashChangedError) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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