polymorphichelpers

package
v1.13.3 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2019 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFirstPod

func GetFirstPod(client coreclient.PodsGetter, namespace string, selector string, timeout time.Duration, sortBy func([]*corev1.Pod) sort.Interface) (*corev1.Pod, int, error)

GetFirstPod returns a pod matching the namespace and label selector and the number of all pods that match the label selector.

func SelectorsForObject

func SelectorsForObject(object runtime.Object) (namespace string, selector labels.Selector, err error)

SelectorsForObject returns the pod label selector for a given object

Types

type AttachableLogsForObjectFunc

type AttachableLogsForObjectFunc func(restClientGetter genericclioptions.RESTClientGetter, object runtime.Object, timeout time.Duration) (*v1.Pod, error)

AttachableLogsForObjectFunc is a function type that can tell you how to get the pod for which to attach a given object

var AttachablePodForObjectFn AttachableLogsForObjectFunc = attachablePodForObject

AttachablePodForObjectFn gives a way to easily override the function for unit testing if needed.

type CanBeAutoscaledFunc

type CanBeAutoscaledFunc func(kind schema.GroupKind) error

CanBeAutoscaledFunc checks whether the kind of resources could be autoscaled

var CanBeAutoscaledFn CanBeAutoscaledFunc = canBeAutoscaled

CanBeAutoscaledFn gives a way to easily override the function for unit testing if needed

type CanBeExposedFunc

type CanBeExposedFunc func(kind schema.GroupKind) error

CanBeExposedFunc is a function type that can tell you whether a given GroupKind is capable of being exposed

var CanBeExposedFn CanBeExposedFunc = canBeExposed

CanBeExposedFn gives a way to easily override the function for unit testing if needed

type HistoryViewerFunc

type HistoryViewerFunc func(restClientGetter genericclioptions.RESTClientGetter, mapping *meta.RESTMapping) (kubectl.HistoryViewer, error)

HistoryViewerFunc is a function type that can tell you how to view change history

var HistoryViewerFn HistoryViewerFunc = historyViewer

HistoryViewerFn gives a way to easily override the function for unit testing if needed

type LogsForObjectFunc

type LogsForObjectFunc func(restClientGetter genericclioptions.RESTClientGetter, object, options runtime.Object, timeout time.Duration, allContainers bool) ([]*rest.Request, error)

LogsForObjectFunc is a function type that can tell you how to get logs for a runtime.object

var LogsForObjectFn LogsForObjectFunc = logsForObject

LogsForObjectFn gives a way to easily override the function for unit testing if needed.

type MapBasedSelectorForObjectFunc

type MapBasedSelectorForObjectFunc func(object runtime.Object) (string, error)

MapBasedSelectorForObjectFunc will call the provided function on mapping the baesd selector for object, return "" if object is not supported, or return an error.

var MapBasedSelectorForObjectFn MapBasedSelectorForObjectFunc = mapBasedSelectorForObject

MapBasedSelectorForObjectFn gives a way to easily override the function for unit testing if needed

type ObjectPauserFunc

type ObjectPauserFunc func(runtime.Object) ([]byte, error)

ObjectPauserFunc is a function type that marks the object in a given info as paused.

var ObjectPauserFn ObjectPauserFunc = defaultObjectPauser

ObjectPauserFn gives a way to easily override the function for unit testing if needed. Returns the patched object in bytes and any error that occurred during the encoding or in case the object is already paused.

type ObjectResumerFunc

type ObjectResumerFunc func(runtime.Object) ([]byte, error)

ObjectResumerFunc is a function type that marks the object in a given info as resumed.

var ObjectResumerFn ObjectResumerFunc = defaultObjectResumer

ObjectResumerFn gives a way to easily override the function for unit testing if needed. Returns the patched object in bytes and any error that occurred during the encoding or in case the object is already resumed.

type PortsForObjectFunc

type PortsForObjectFunc func(object runtime.Object) ([]string, error)

PortsForObjectFunc returns the ports associated with the provided object

var PortsForObjectFn PortsForObjectFunc = portsForObject

PortsForObjectFn gives a way to easily override the function for unit testing if needed

type ProtocolsForObjectFunc

type ProtocolsForObjectFunc func(object runtime.Object) (map[string]string, error)

ProtocolsForObjectFunc will call the provided function on the protocols for the object, return nil-map if no protocols for the object, or return an error.

var ProtocolsForObjectFn ProtocolsForObjectFunc = protocolsForObject

ProtocolsForObjectFn gives a way to easily override the function for unit testing if needed

type RollbackerFunc

type RollbackerFunc func(restClientGetter genericclioptions.RESTClientGetter, mapping *meta.RESTMapping) (kubectl.Rollbacker, error)

RollbackerFunc gives a way to change the rollback version of the specified RESTMapping type

var RollbackerFn RollbackerFunc = rollbacker

RollbackerFn gives a way to easily override the function for unit testing if needed

type StatusViewerFunc

type StatusViewerFunc func(mapping *meta.RESTMapping) (kubectl.StatusViewer, error)

StatusViewerFunc is a function type that can tell you how to print rollout status

var StatusViewerFn StatusViewerFunc = statusViewer

StatusViewerFn gives a way to easily override the function for unit testing if needed

type UpdatePodSpecForObjectFunc

type UpdatePodSpecForObjectFunc func(obj runtime.Object, fn func(*v1.PodSpec) error) (bool, error)

UpdatePodSpecForObjectFunc will call the provided function on the pod spec this object supports, return false if no pod spec is supported, or return an error.

var UpdatePodSpecForObjectFn UpdatePodSpecForObjectFunc = updatePodSpecForObject

UpdatePodSpecForObjectFn gives a way to easily override the function for unit testing if needed

Jump to

Keyboard shortcuts

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