Documentation ¶
Index ¶
- func GetFirstTerminationMessage(pod *corev1.Pod) string
- func GetJobPod(ctx context.Context, kubeClientset kubernetes.Interface, ...) (*corev1.Pod, error)
- func GetJobPodByJobName(ctx context.Context, kubeClientset kubernetes.Interface, ...) (*corev1.Pod, error)
- func GetOperationsResult(ctx context.Context, pod *corev1.Pod, result interface{}) error
- func InjectClients(ctx context.Context)
- func IsJobComplete(job *batchv1.Job) bool
- func IsJobFailed(job *batchv1.Job) bool
- func IsJobSucceeded(job *batchv1.Job) bool
- func JobFailedMessage(job *batchv1.Job) string
- type Client
- func (c *Client) CreateNamespaceIfNeeded() error
- func (c *Client) DeleteNamespaceIfNeeded() error
- func (c *Client) DuplicateSecret(t *testing.T, name, namespace string)
- func (c *Client) LogsFor(namespace, name string, gvr schema.GroupVersionResource) (string, error)
- func (c *Client) WaitForResourceReady(namespace, name string, gvr schema.GroupVersionResource, timeout time.Duration) error
- func (c *Client) WaitUntilJobDone(namespace, name string, timeout time.Duration) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetJobPod ¶
func GetJobPod(ctx context.Context, kubeClientset kubernetes.Interface, namespace, uid, operation string) (*corev1.Pod, error)
GetJobProd will find the Pod that belongs to the resource that created it. Uses label ""controller-uid as the label selector. So, your job should tag the job with that label as the UID of the resource that's needing it. For example, if you create a storage object that requires us to create a notification for it, the controller should set the label on the Job responsible for creating the Notification for it with the label "controller-uid" set to the uid of the storage CR.
func GetJobPodByJobName ¶
func GetJobPodByJobName(ctx context.Context, kubeClientset kubernetes.Interface, namespace, jobName string) (*corev1.Pod, error)
GetJobPodByJobName will find the Pods that belong to that job. Each pod for a given job will have label called: "job-name" set to the job that it belongs to, so just filter by that.
func GetOperationsResult ¶
func InjectClients ¶ added in v0.2.0
func IsJobComplete ¶
func IsJobFailed ¶
func IsJobSucceeded ¶
func JobFailedMessage ¶
Types ¶
type Client ¶
type Client struct { Kube kubernetes.Interface Dynamic dynamic.Interface Namespace string // contains filtered or unexported fields }
Client holds instances of interfaces for making requests to Kubernetes.
func NewClient ¶
NewClient instantiates and returns clientsets required for making request to the cluster specified by the combination of clusterName and configPath.
func (*Client) CreateNamespaceIfNeeded ¶
CreateNamespaceIfNeeded creates a new namespace if it does not exist.
func (*Client) DeleteNamespaceIfNeeded ¶
func (*Client) DuplicateSecret ¶
DuplicateSecret duplicates a secret from a namespace to a new namespace.
func (*Client) WaitForResourceReady ¶
func (c *Client) WaitForResourceReady(namespace, name string, gvr schema.GroupVersionResource, timeout time.Duration) error
WaitForResourceReady waits until the specified resource in the given namespace are ready.