Documentation
¶
Index ¶
- Variables
- func SetInstance(i Ops)
- type Client
- func (c *Client) CreateCronJob(cronJob *v1beta1.CronJob) (*v1beta1.CronJob, error)
- func (c *Client) CreateJob(job *batchv1.Job) (*batchv1.Job, error)
- func (c *Client) DeleteCronJob(name, namespace string) error
- func (c *Client) DeleteJob(name, namespace string) error
- func (c *Client) GetCronJob(name, namespace string) (*v1beta1.CronJob, error)
- func (c *Client) GetJob(name, namespace string) (*batchv1.Job, error)
- func (c *Client) ListCronJobs(namespace string) (*v1beta1.CronJobList, error)
- func (c *Client) SetConfig(cfg *rest.Config)
- func (c *Client) UpdateCronJob(cronJob *v1beta1.CronJob) (*v1beta1.CronJob, error)
- func (c *Client) ValidateCronJob(cronJob *v1beta1.CronJob, timeout, retryInterval time.Duration) error
- func (c *Client) ValidateJob(name, namespace string, timeout time.Duration) error
- type CronOps
- type JobOps
- type Ops
Constants ¶
This section is empty.
Variables ¶
var NamespaceDefault = "default"
Functions ¶
func SetInstance ¶
func SetInstance(i Ops)
SetInstance replaces the instance with the provided one. Should be used only for testing purposes.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a wrapper for the kubernetes batch client.
func New ¶
func New(client batchv1client.BatchV1Interface, batchv1beta1 batchv1beta1client.BatchV1beta1Interface) *Client
New builds a new batch client.
func NewForConfig ¶
NewForConfig builds a new batch client for the given config.
func (*Client) CreateCronJob ¶
CreateCron creates the given cronJob
func (*Client) DeleteCronJob ¶
DeleteCronJob deletes the given cronJob
func (*Client) GetCronJob ¶
GetCronJob returns the cronJob given name and namespace
func (*Client) ListCronJobs ¶
func (c *Client) ListCronJobs(namespace string) (*v1beta1.CronJobList, error)
ListCronJobs returns the cronJobs in given namespace
func (*Client) UpdateCronJob ¶
UpdateCronJob creates the given cronJob
type CronOps ¶
type CronOps interface { // CreateCronJob creates the given cronJob CreateCronJob(cronJob *v1beta1.CronJob) (*v1beta1.CronJob, error) // UpdateCronJob creates the given cronJob UpdateCronJob(cronJob *v1beta1.CronJob) (*v1beta1.CronJob, error) // GetCronJob returns the cronJob given name and namespace GetCronJob(name, namespace string) (*v1beta1.CronJob, error) // DeleteCronJob deletes the given cronJob DeleteCronJob(name, namespace string) error // ValidateCronJob validates the given cronJob ValidateCronJob(cronJob *v1beta1.CronJob, timeout, retryInterval time.Duration) error // ListCronJobs list cronjobs in given namespace ListCronJobs(namespace string) (*v1beta1.CronJobList, error) }
Ops is an interface to perform kubernetes related operations on the crd resources.
type JobOps ¶
type JobOps interface { // CreateJob creates the given job CreateJob(job *batchv1.Job) (*batchv1.Job, error) // GetJob returns the job from given namespace and name GetJob(name, namespace string) (*batchv1.Job, error) // DeleteJob deletes the job with given namespace and name DeleteJob(name, namespace string) error // ValidateJob validates if the job with given namespace and name succeeds. // It waits for timeout duration for job to succeed ValidateJob(name, namespace string, timeout time.Duration) error }
JobOps is an interface to perform job operations
type Ops ¶
type Ops interface { JobOps CronOps // SetConfig sets the config and resets the client SetConfig(config *rest.Config) }
Ops is an interface to perform kubernetes related operations on the batch resources.
func NewInstanceFromConfigFile ¶
NewInstanceFromConfigFile returns new instance of client by using given config file