Documentation ¶
Index ¶
- Constants
- func FindStatusCondition(conditions []batchv1.JobCondition, conditionType batchv1.JobConditionType) *batchv1.JobCondition
- func HasFailed(conditions []batchv1.JobCondition) bool
- func HasStarted(conditions []batchv1.JobCondition) bool
- func HasSucceeded(conditions []batchv1.JobCondition) bool
- func MutateBatchJob(ctx context.Context, batchJob *batchv1.Job, jobObj k8upv1.JobObject, ...) error
- func ReconcileJobStatus(ctx context.Context, key types.NamespacedName, client client.Client, ...) error
- func SetFailed(ctx context.Context, name, ns string, typ k8upv1.JobType, ...)
- func SetSucceeded(ctx context.Context, name, ns string, typ k8upv1.JobType, ...)
- func Sha256Hash(v string) string
- func UpdateStatus(ctx context.Context, batchJob *batchv1.Job, obj k8upv1.JobObject)
- type Config
- func (c *Config) SetConditionFalseWithMessage(ctx context.Context, condition k8upv1.ConditionType, ...)
- func (c *Config) SetConditionTrue(ctx context.Context, condition k8upv1.ConditionType, ...)
- func (c *Config) SetConditionTrueWithMessage(ctx context.Context, condition k8upv1.ConditionType, ...)
- func (c *Config) SetConditionUnknownWithMessage(ctx context.Context, condition k8upv1.ConditionType, ...)
- func (c *Config) SetFinished(ctx context.Context, namespace, name string)
- func (c *Config) SetStarted(ctx context.Context, message string, args ...interface{})
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 ¶
func FindStatusCondition ¶ added in v2.6.0
func FindStatusCondition(conditions []batchv1.JobCondition, conditionType batchv1.JobConditionType) *batchv1.JobCondition
FindStatusCondition finds the condition with the given type in the batchv1.JobCondition slice. Returns nil if not found.
func HasFailed ¶ added in v2.6.0
func HasFailed(conditions []batchv1.JobCondition) bool
func HasStarted ¶ added in v2.6.0
func HasStarted(conditions []batchv1.JobCondition) bool
func HasSucceeded ¶ added in v2.6.0
func HasSucceeded(conditions []batchv1.JobCondition) bool
func MutateBatchJob ¶ added in v2.6.0
func MutateBatchJob(ctx context.Context, batchJob *batchv1.Job, jobObj k8upv1.JobObject, config Config, c client.Client) error
MutateBatchJob mutates the given Job with generic spec applicable to all K8up-spawned Jobs.
func ReconcileJobStatus ¶ added in v2.6.0
func SetSucceeded ¶ added in v2.6.0
func Sha256Hash ¶ added in v2.6.0
Sha256Hash returns the SHA256 hash string of the given string Returns empty string if v is empty. The returned hash is shortened to 63 characters to fit into a label.
Types ¶
type Config ¶
Config represents the whole context for a given job. It contains everything that is necessary to handle the job.
func (*Config) SetConditionFalseWithMessage ¶
func (c *Config) SetConditionFalseWithMessage(ctx context.Context, condition k8upv1.ConditionType, reason k8upv1.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(ctx context.Context, condition k8upv1.ConditionType, reason k8upv1.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(ctx context.Context, condition k8upv1.ConditionType, reason k8upv1.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(ctx context.Context, condition k8upv1.ConditionType, reason k8upv1.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.