Documentation
¶
Index ¶
- Constants
- func GenerateGenericJob(obj Object, config Config) (*batchv1.Job, error)
- type Config
- func (c *Config) SetConditionFalseWithMessage(condition k8upv1alpha1.ConditionType, reason k8upv1alpha1.ConditionReason, ...)
- func (c *Config) SetConditionTrue(condition k8upv1alpha1.ConditionType, reason k8upv1alpha1.ConditionReason)
- func (c *Config) SetConditionTrueWithMessage(condition k8upv1alpha1.ConditionType, reason k8upv1alpha1.ConditionReason, ...)
- func (c *Config) SetConditionUnknownWithMessage(condition k8upv1alpha1.ConditionType, reason k8upv1alpha1.ConditionReason, ...)
- func (c *Config) SetFinished(namespace, name string)
- func (c *Config) SetStarted(message string, args ...interface{})
- type Object
Constants ¶
const ( // K8uplabel is a label that is required for the operator to differentiate // batchv1.job objects managed by k8up from others. K8uplabel = "k8upjob" // K8upExclusive is needed to determine if a given job is considered exclusive or not. K8upExclusive = "k8upjob/exclusive" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Client client.Client Log logr.Logger CTX context.Context Obj Object Scheme *runtime.Scheme Repository string }
Config represents the whole context for a given job. It contains everything that is necessary to handle the job.
func NewConfig ¶
func NewConfig(ctx context.Context, client client.Client, log logr.Logger, obj Object, scheme *runtime.Scheme, repository string) Config
NewConfig returns a new configuration.
func (*Config) SetConditionFalseWithMessage ¶
func (c *Config) SetConditionFalseWithMessage(condition k8upv1alpha1.ConditionType, reason k8upv1alpha1.ConditionReason, message string, args ...interface{})
SetConditionFalseWithMessage tells the K8s controller at once that the status of the given Condition is now "False" and provides the given message. The arguments `message` and `args` follow the fmt.Sprintf() syntax.
func (*Config) SetConditionTrue ¶
func (c *Config) SetConditionTrue(condition k8upv1alpha1.ConditionType, reason k8upv1alpha1.ConditionReason)
SetConditionTrue tells the K8s controller at once that the status of the given Conditions is now "True"
func (*Config) SetConditionTrueWithMessage ¶
func (c *Config) SetConditionTrueWithMessage(condition k8upv1alpha1.ConditionType, reason k8upv1alpha1.ConditionReason, message string, args ...interface{})
SetConditionTrueWithMessage tells the K8s controller at once that the status of the given Condition is now "True" and provides the given message. The arguments `message` and `args` follow the fmt.Sprintf() syntax.
func (*Config) SetConditionUnknownWithMessage ¶
func (c *Config) SetConditionUnknownWithMessage(condition k8upv1alpha1.ConditionType, reason k8upv1alpha1.ConditionReason, message string, args ...interface{})
SetConditionUnknownWithMessage tells the K8s controller at once that the status of the given Conditions is "Unknown"
func (*Config) SetFinished ¶
SetFinished marks the job as finished and updates the status.
func (*Config) SetStarted ¶
SetStarted marks the job as started and updates the status. The arguments `message` and `args` follow the fmt.Sprintf() syntax.
type Object ¶
type Object interface { GetMetaObject() metav1.Object GetRuntimeObject() runtime.Object GetStatus() k8upv1alpha1.Status SetStatus(s k8upv1alpha1.Status) GetType() v1alpha1.JobType GetResources() corev1.ResourceRequirements }
Object is an interface that must be implemented by all CRDs that implement a job.