cronjob

package
v1.10.4-beta003 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMetadataName

func GetMetadataName(name, resource string) string

GetMetadataName returns cron job metadata name

func NewApplySpec

func NewApplySpec(log *zap.SugaredLogger, parameters templateParameters) (*batchv1.CronJobApplyConfiguration, error)

NewApplySpec is a method to return cron job apply spec

Types

type Client

type Client struct {
	ClientSet *kubernetes.Clientset
	Log       *zap.SugaredLogger

	Namespace string
	// contains filtered or unexported fields
}

Client data struct for managing running cron jobs

func NewClient

func NewClient(serviceName string, servicePort int, cronJobTemplate string, namespace string) (*Client, error)

NewClient is a method to create new cron job client

func (*Client) Apply

func (c *Client) Apply(id, name string, options CronJobOptions) error

Apply is a method to create or update a cron job

func (*Client) Delete

func (c *Client) Delete(name string) error

Delete is a method to delete an existing cron job

func (*Client) DeleteAll

func (c *Client) DeleteAll(resource, selector string) error

DeleteAll is a method to delete all existing cron jobs

func (*Client) Get

func (c *Client) Get(name string) (*v1.CronJob, error)

Get is a method to retrieve an existing cron job

func (*Client) UpdateLabels added in v1.0.23

func (c *Client) UpdateLabels(cronJobSpec *v1.CronJob, oldLabels, newLabels map[string]string) error

UpdateLabels is a method to update an existing cron job labels

type CronJobOptions

type CronJobOptions struct {
	Schedule string
	Resource string
	Data     string
	Labels   map[string]string
}

Jump to

Keyboard shortcuts

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