utils

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetParkedNodeExpiryTime

func GetParkedNodeExpiryTime(node v1.Node, expiresOnLabel string) (time.Time, error)

GetParkedNodeExpiryTime get the time a parked node TTL expires

func HandleOsSignals

func HandleOsSignals(cancel context.CancelFunc)

HandleOsSignals gracefully handles OS signals

func NodeHasLabel

func NodeHasLabel(node v1.Node, key string) bool

NodeHasLabel check if a node has a specific label set

func NodeHasTaint

func NodeHasTaint(node v1.Node, key string) bool

NodeHasTaint check if a node has a taint set

func PodEvictionAllowed

func PodEvictionAllowed(pod v1.Pod, skipEvictionLabel string) bool

PodEvictionAllowed check if a pod has the `skipEvictionLabel`=false label set

func PodHasLabel

func PodHasLabel(pod v1.Pod, key string) bool

PodHasLabel check if a pod has a specific label set

Types

type AppContext

type AppContext struct {
	Context   context.Context
	K8sClient kubernetes.Interface
	Config    config.Config
	// contains filtered or unexported fields
}

AppContext struct stores a context and a k8s client

func NewAppContext

func NewAppContext(cfg config.Config, dryRun bool) (*AppContext, error)

NewAppContext creates a new AppContext object

func (*AppContext) IsDryRun

func (ac *AppContext) IsDryRun() bool

IsDryRun returns true if the "--dry-run" flag was provided

Jump to

Keyboard shortcuts

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