common

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WeekdayMap = map[string]time.Weekday{
	"monday":    time.Monday,
	"mon":       time.Monday,
	"tuesday":   time.Tuesday,
	"tue":       time.Tuesday,
	"wednesday": time.Wednesday,
	"wed":       time.Wednesday,
	"thursday":  time.Thursday,
	"thu":       time.Thursday,
	"friday":    time.Friday,
	"fri":       time.Friday,
	"saturday":  time.Saturday,
	"sat":       time.Saturday,
	"sunday":    time.Sunday,
	"sun":       time.Sunday,
}

Functions

func EnsureDrain

func EnsureDrain(ctx context.Context, node *v1.Node, log logr.Logger, params WaitParameters) error

Drains Pods from the given node, if required.

func EnsureSchedulable

func EnsureSchedulable(ctx context.Context, k8sClient client.Client, node *v1.Node, schedulable bool) error

Checks if the is Schedulable according to schedulable and patches the node if necessary.

func GetPodsForDrain

func GetPodsForDrain(ctx context.Context, k8sClient client.Client, nodeName string) ([]v1.Pod, error)

Gets a list of pods to be deleted for a node to be considered drained. Shortened https://github.com/kinvolk/flatcar-linux-update-operator/blob/master/pkg/k8sutil/drain.go .

func WaitForPodDeletions

func WaitForPodDeletions(ctx context.Context, pods []v1.Pod, params WaitParameters) error

Deletes the given pods and awaits there deletion.

func WeekdayFromString

func WeekdayFromString(s string) (time.Weekday, error)

Types

type WaitParameters

type WaitParameters struct {
	Client  client.Client
	Period  time.Duration
	Timeout time.Duration
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳