kubernetes: k8s.io/kubernetes/pkg/kubectl/polymorphichelpers Index | Files

package polymorphichelpers

import "k8s.io/kubernetes/pkg/kubectl/polymorphichelpers"

Index

Package Files

attachablepodforobject.go canbeexposed.go helpers.go historyviewer.go interface.go logsforobject.go mapbasedselectorforobject.go objectpauser.go objectrestarter.go objectresumer.go portsforobject.go protocolsforobject.go rollbacker.go statusviewer.go updatepodspec.go

func GetFirstPod Uses

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 Uses

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

SelectorsForObject returns the pod label selector for a given object

type AttachablePodForObjectFunc Uses

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

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

var AttachablePodForObjectFn AttachablePodForObjectFunc = attachablePodForObject

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

type CanBeExposedFunc Uses

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 Uses

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 Uses

type LogsForObjectFunc func(restClientGetter genericclioptions.RESTClientGetter, object, options runtime.Object, timeout time.Duration, allContainers bool) ([]rest.ResponseWrapper, 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 Uses

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 Uses

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 ObjectRestarterFunc Uses

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

ObjectRestarterFunc is a function type that updates an annotation in a deployment to restart it..

var ObjectRestarterFn ObjectRestarterFunc = defaultObjectRestarter

ObjectRestarterFn 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.

type ObjectResumerFunc Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

Package polymorphichelpers imports 30 packages (graph) and is imported by 113 packages. Updated 2019-07-22. Refresh now. Tools for package owners.