Documentation ¶
Index ¶
- type Builder
- func (b *Builder) Build() (*corev1.Pod, error)
- func (b *Builder) WithContainer(container corev1.Container) *Builder
- func (b *Builder) WithContainerBuilder(containerBuilder *container.Builder) *Builder
- func (b *Builder) WithContainers(containers []corev1.Container) *Builder
- func (b *Builder) WithName(name string) *Builder
- func (b *Builder) WithNamespace(namespace string) *Builder
- func (b *Builder) WithNodeName(nodeName string) *Builder
- func (b *Builder) WithNodeSelectorHostnameNew(hostname string) *Builder
- func (b *Builder) WithRestartPolicy(restartPolicy corev1.RestartPolicy) *Builder
- func (b *Builder) WithServiceAccountName(serviceAccountName string) *Builder
- func (b *Builder) WithTolerationsForTaints(taints ...corev1.Taint) *Builder
- func (b *Builder) WithVolume(volume corev1.Volume) *Builder
- func (b *Builder) WithVolumeBuilder(volumeBuilder *volume.Builder) *Builder
- func (b *Builder) WithVolumes(volumes []corev1.Volume) *Builder
- type ExecOutput
- type KubeClient
- func (k *KubeClient) Create(pod *corev1.Pod) (*corev1.Pod, error)
- func (k *KubeClient) Delete(name string, opts *metav1.DeleteOptions) error
- func (k *KubeClient) DeleteCollection(listOpts metav1.ListOptions, deleteOpts *metav1.DeleteOptions) error
- func (k *KubeClient) Exec(name string, opts *corev1.PodExecOptions) (*ExecOutput, error)
- func (k *KubeClient) ExecRaw(name string, opts *corev1.PodExecOptions) ([]byte, error)
- func (k *KubeClient) Get(name string, opts metav1.GetOptions) (*corev1.Pod, error)
- func (k *KubeClient) GetRaw(name string, opts metav1.GetOptions) ([]byte, error)
- func (k *KubeClient) List(opts metav1.ListOptions) (*corev1.PodList, error)
- func (k *KubeClient) WithKubeConfig(config *rest.Config) *KubeClient
- func (k *KubeClient) WithNamespace(namespace string) *KubeClient
- type KubeClientBuildOption
- type ListBuilder
- type Pod
- type PodList
- type Predicate
- type PredicateList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder is the builder object for Pod
func (*Builder) WithContainer ¶
WithContainer sets the Containers field in Pod with provided arguments
func (*Builder) WithContainerBuilder ¶
WithContainerBuilder adds a container to this pod object.
NOTE:
container details are present in the provided container
builder object
func (*Builder) WithContainers ¶
WithContainers sets the Containers field in Pod with provided arguments
func (*Builder) WithNamespace ¶
WithNamespace sets the Namespace field of Pod with provided value.
func (*Builder) WithNodeName ¶
WithNodeName sets the NodeName field of Pod with provided value.
func (*Builder) WithNodeSelectorHostnameNew ¶
WithNodeSelectorHostnameNew sets the Pod NodeSelector to the provided hostname value This function replaces (resets) the NodeSelector to use only hostname selector
func (*Builder) WithRestartPolicy ¶
func (b *Builder) WithRestartPolicy( restartPolicy corev1.RestartPolicy, ) *Builder
WithRestartPolicy sets the RestartPolicy field in Pod with provided arguments
func (*Builder) WithServiceAccountName ¶
WithServiceAccountName sets the ServiceAccountName of Pod spec with the provided value
func (*Builder) WithTolerationsForTaints ¶
WithTolerationsForTaints sets the Spec.Tolerations with provided taints.
func (*Builder) WithVolume ¶
WithVolume sets the Volumes field in Pod with provided arguments
func (*Builder) WithVolumeBuilder ¶
WithVolumeBuilder sets Volumes field of deployment.
type ExecOutput ¶
ExecOutput struct contains stdout and stderr
type KubeClient ¶
type KubeClient struct {
// contains filtered or unexported fields
}
KubeClient enables kubernetes API operations on pod instance
func NewKubeClient ¶
func NewKubeClient(opts ...KubeClientBuildOption) *KubeClient
NewKubeClient returns a new instance of KubeClient meant for cstor volume replica operations
func (*KubeClient) Delete ¶
func (k *KubeClient) Delete(name string, opts *metav1.DeleteOptions) error
Delete deletes a pod instance present in kubernetes cluster
func (*KubeClient) DeleteCollection ¶
func (k *KubeClient) DeleteCollection(listOpts metav1.ListOptions, deleteOpts *metav1.DeleteOptions) error
DeleteCollection deletes a collection of pod objects.
func (*KubeClient) Exec ¶
func (k *KubeClient) Exec(name string, opts *corev1.PodExecOptions) (*ExecOutput, error)
Exec runs a command remotely in a container of a pod
func (*KubeClient) ExecRaw ¶
func (k *KubeClient) ExecRaw(name string, opts *corev1.PodExecOptions) ([]byte, error)
ExecRaw runs a command remotely in a container of a pod and returns raw output
func (*KubeClient) Get ¶
func (k *KubeClient) Get(name string, opts metav1.GetOptions) (*corev1.Pod, error)
Get gets a pod object present in kubernetes cluster
func (*KubeClient) GetRaw ¶
func (k *KubeClient) GetRaw(name string, opts metav1.GetOptions) ([]byte, error)
GetRaw gets pod object for a given name and namespace present in kubernetes cluster and returns result in raw byte.
func (*KubeClient) List ¶
func (k *KubeClient) List(opts metav1.ListOptions) (*corev1.PodList, error)
List returns a list of pod instances present in kubernetes cluster
func (*KubeClient) WithKubeConfig ¶
func (k *KubeClient) WithKubeConfig(config *rest.Config) *KubeClient
WithKubeConfig sets the kubernetes config against the KubeClient instance
func (*KubeClient) WithNamespace ¶
func (k *KubeClient) WithNamespace(namespace string) *KubeClient
WithNamespace sets the kubernetes namespace against the provided namespace
type KubeClientBuildOption ¶
type KubeClientBuildOption func(*KubeClient)
KubeClientBuildOption defines the abstraction to build a KubeClient instance
func WithClientSet ¶
func WithClientSet(c *clientset.Clientset) KubeClientBuildOption
WithClientSet sets the kubernetes client against the KubeClient instance
func WithKubeConfigPath ¶
func WithKubeConfigPath(path string) KubeClientBuildOption
WithKubeConfigPath sets the kubeConfig path against client instance
type ListBuilder ¶
type ListBuilder struct {
// contains filtered or unexported fields
}
ListBuilder enables building an instance of Podlist
func ListBuilderForAPIList ¶
func ListBuilderForAPIList(pods *corev1.PodList) *ListBuilder
ListBuilderForAPIList returns a instance of ListBuilder from API PodList
func ListBuilderForObjectList ¶
func ListBuilderForObjectList(pods ...*Pod) *ListBuilder
ListBuilderForObjectList returns a instance of ListBuilder from API Pods
func NewListBuilder ¶
func NewListBuilder() *ListBuilder
NewListBuilder returns a instance of ListBuilder
func (*ListBuilder) List ¶
func (b *ListBuilder) List() *PodList
List returns the list of pod instances that was built by this builder
func (*ListBuilder) WithFilter ¶
func (b *ListBuilder) WithFilter(pred ...Predicate) *ListBuilder
WithFilter add filters on which the pod has to be filtered
type Pod ¶
type Pod struct {
// contains filtered or unexported fields
}
Pod holds the api's pod objects
func NewForAPIObject ¶
NewForAPIObject returns a new instance of Pod
func (*Pod) GetAPIObject ¶
GetAPIObject returns a API's Pod
func (*Pod) HasLabel ¶
HasLabel return true if provided lable key and value are present in the the provided PodList instance
func (*Pod) IsCompleted ¶
IsCompleted retuns true if the pod is in completed state
type PodList ¶
type PodList struct {
// contains filtered or unexported fields
}
PodList holds the list of API pod instances
func (*PodList) GetScheduledNodes ¶
GetScheduledNodes returns the nodes on which pods are scheduled
func (*PodList) IsMatchNodeAny ¶
IsMatchNodeAny checks the PodList is running on the provided nodes
type Predicate ¶
Predicate defines an abstraction to determine conditional checks against the provided pod instance
func HasLabels ¶
HasLabels returns true if provided labels map[key]value are present in the provided PodList instance
func IsCompleted ¶
func IsCompleted() Predicate
IsCompleted is a predicate to filter out pods which in completed state