util

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: Apache-2.0 Imports: 12 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check added in v0.4.4

func Check(ctx context.Context, c client.Client, obj client.Object, f CheckFn) bool

func ContainsString

func ContainsString(slice []string, s string) bool

func Create added in v0.4.4

func Create(ctx context.Context, c client.Client, obj client.Object, f CreateFn) error

func DiffMaps added in v0.6.0

func DiffMaps(old, new map[string]string) (add, del map[string]string)

func DutyOfCNI added in v0.4.4

func DutyOfCNI(metaOld metav1.Object, metaNew metav1.Object) bool

func EnvDaemonsetName added in v0.6.0

func EnvDaemonsetName() string

func EnvNamespace added in v0.5.0

func EnvNamespace() string

func GetNodeIP added in v0.4.4

func GetNodeIP(node corev1.Node) net.IP

Find node first NodeInternalIP, should check result

func GetNodeName added in v0.4.4

func GetNodeName() string

func GetSecret added in v0.6.0

func GetSecret() string

func IsDeletionCandidate added in v0.4.4

func IsDeletionCandidate(obj metav1.Object, finalizer string) bool

IsDeletionCandidate checks if object is candidate to be deleted

func NeedToAddFinalizer added in v0.4.4

func NeedToAddFinalizer(obj metav1.Object, finalizer string) bool

NeedToAddFinalizer checks if need to add finalizer to object

func NodeReady added in v0.6.0

func NodeReady(obj runtime.Object) bool

func RemoveString

func RemoveString(slice []string, s string) (result []string)

func TerminalSize added in v0.6.0

func TerminalSize(w io.Writer) (int, int, error)

TerminalSize returns the current width and height of the user's terminal. If it isn't a terminal, nil is returned. On error, zero values are returned for width and height. Usually w must be the stdout of the process. Stderr won't work.

Types

type CheckFn added in v0.4.4

type CheckFn func() bool

type CreateFn added in v0.4.4

type CreateFn func() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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