Documentation ¶
Index ¶
- Constants
- func GetGenericJob(obj Object, config Config) (*batchv1.Job, error)
- type Config
- func (c *Config) SetConditionFalse(condition status.ConditionType, message string, args ...interface{})
- func (c *Config) SetConditionTrue(condition status.ConditionType)
- func (c *Config) SetConditionTrueWithMessage(condition status.ConditionType, message string, args ...interface{})
- func (c *Config) SetStarted(trueCondition status.ConditionType, 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 consideret 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) SetConditionFalse ¶
func (c *Config) SetConditionFalse(condition status.ConditionType, message string, args ...interface{})
SetConditionFalse 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 status.ConditionType)
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 status.ConditionType, message string, args ...interface{})
SetConditionFalse 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) SetStarted ¶
func (c *Config) SetStarted(trueCondition status.ConditionType, message string, args ...interface{})
SetStarted sets the `c.Obj.GetStatus().Started` property to `true`. In the same call to the k8s API it also sets all the given conditions to "True". The arguments `message` and `args` follow the fmt.Sprintf() syntax.