utils

package
v1.21.10 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthMethodFromPrivateKey

func AuthMethodFromPrivateKey(key string) ssh.AuthMethod

AuthMethodFromPrivateKey read public key

func AuthMethodFromPrivateKeyFile

func AuthMethodFromPrivateKeyFile(file string) ssh.AuthMethod

AuthMethodFromPrivateKeyFile read public key

func FileExists

func FileExists(name string) bool

FileExists Check if FileExists

func GetNodeProviderID

func GetNodeProviderID(serverIdentifier string, node *apiv1.Node) string

GetNodeProviderID func

func LocalStoragePodFilter added in v1.20.5

func LocalStoragePodFilter(p apiv1.Pod) (bool, error)

LocalStoragePodFilter returns true if the supplied pod does not have local storage, i.e. does not use any 'empty dir' volumes.

func MaxInt

func MaxInt(x, y int) int

MaxInt max(a,b)

func MaxInt64 added in v1.20.15

func MaxInt64(x, y int64) int64

MaxInt64 max(a,b)

func MinInt

func MinInt(x, y int) int

MinInt min(a,b)

func MinInt64 added in v1.20.15

func MinInt64(x, y int64) int64

MinInt64 min(a,b)

func MirrorPodFilter added in v1.20.5

func MirrorPodFilter(p apiv1.Pod) (bool, error)

MirrorPodFilter returns true if the supplied pod is not a mirror pod, i.e. a pod created by a manifest on the node rather than the API server.

func NewDaemonSetPodFilter added in v1.20.5

func NewDaemonSetPodFilter(ctx context.Context, client kubernetes.Interface) types.PodFilterFunc

NewDaemonSetPodFilter returns a FilterFunc that returns true if the supplied pod is not managed by an extant DaemonSet.

func NewPodFilters added in v1.20.5

func NewPodFilters(filters ...types.PodFilterFunc) types.PodFilterFunc

NewPodFilters returns a FilterFunc that returns true if all of the supplied FilterFuncs return true.

func NewRequestContext added in v1.20.15

func NewRequestContext(requestTimeout time.Duration) *context.Context

func NewStatefulSetPodFilter added in v1.20.5

func NewStatefulSetPodFilter(ctx context.Context, client kubernetes.Interface) types.PodFilterFunc

NewStatefulSetPodFilter returns a FilterFunc that returns true if the supplied pod is not managed by an extant StatefulSet.

func NodeFromJSON

func NodeFromJSON(s string) (*apiv1.Node, error)

NodeFromJSON deserialize a string to apiv1.Node

func NodeGroupIDFromProviderID

func NodeGroupIDFromProviderID(serverIdentifier string, providerID string) (string, error)

NodeGroupIDFromProviderID returns group node name from provider

func NodeNameFromProviderID

func NodeNameFromProviderID(serverIdentifier string, providerID string) (string, error)

NodeNameFromProviderID return node name from provider ID

func Scp

func Scp(connect *types.AutoScalerServerSSH, host, src, dst string) error

Scp copy file

func Shell

func Shell(args ...string) error

Shell execute local command ignore output

func Sudo

func Sudo(connect *types.AutoScalerServerSSH, host string, timeoutInSeconds time.Duration, command ...string) (string, error)

Sudo exec ssh command as sudo

func ToJSON

func ToJSON(v interface{}) string

ToJSON serialize interface to json

func UnprotectedPodFilter added in v1.20.5

func UnprotectedPodFilter(annotations ...string) types.PodFilterFunc

UnprotectedPodFilter returns a FilterFunc that returns true if the supplied pod does not have any of the user-specified annotations for protection from eviction

func UnreplicatedPodFilter added in v1.20.5

func UnreplicatedPodFilter(p apiv1.Pod) (bool, error)

UnreplicatedPodFilter returns true if the pod is replicated, i.e. is managed by a controller (deployment, daemonset, statefulset, etc) of some sort.

Types

This section is empty.

Jump to

Keyboard shortcuts

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