Documentation
¶
Index ¶
- Constants
- func BuildTagArgs(tagList []string) []string
- func NewExecutor(config job.Config) queue.Executor
- type ArchiveExecutor
- func (*ArchiveExecutor) Exclusive() bool
- func (a *ArchiveExecutor) Execute() error
- func (a *ArchiveExecutor) GetConcurrencyLimit() int
- func (g *ArchiveExecutor) GetJobNamespace() string
- func (g *ArchiveExecutor) GetJobNamespacedName() types.NamespacedName
- func (g *ArchiveExecutor) GetJobType() v1alpha1.JobType
- func (g *ArchiveExecutor) GetRepository() string
- func (g *ArchiveExecutor) Logger() logr.Logger
- func (g *ArchiveExecutor) RegisterJobSucceededConditionCallback()
- type BackupExecutor
- func (*BackupExecutor) Exclusive() bool
- func (b *BackupExecutor) Execute() error
- func (b *BackupExecutor) GetConcurrencyLimit() int
- func (g *BackupExecutor) GetJobNamespace() string
- func (g *BackupExecutor) GetJobNamespacedName() types.NamespacedName
- func (g *BackupExecutor) GetJobType() v1alpha1.JobType
- func (g *BackupExecutor) GetRepository() string
- func (g *BackupExecutor) Logger() logr.Logger
- func (g *BackupExecutor) RegisterJobSucceededConditionCallback()
- type CheckExecutor
- func (*CheckExecutor) Exclusive() bool
- func (c *CheckExecutor) Execute() error
- func (c *CheckExecutor) GetConcurrencyLimit() int
- func (g *CheckExecutor) GetJobNamespace() string
- func (g *CheckExecutor) GetJobNamespacedName() types.NamespacedName
- func (g *CheckExecutor) GetJobType() v1alpha1.JobType
- func (g *CheckExecutor) GetRepository() string
- func (g *CheckExecutor) Logger() logr.Logger
- func (g *CheckExecutor) RegisterJobSucceededConditionCallback()
- type EnvVarConverter
- type PruneExecutor
- func (p *PruneExecutor) Exclusive() bool
- func (p *PruneExecutor) Execute() error
- func (p *PruneExecutor) GetConcurrencyLimit() int
- func (g *PruneExecutor) GetJobNamespace() string
- func (g *PruneExecutor) GetJobNamespacedName() types.NamespacedName
- func (g *PruneExecutor) GetJobType() v1alpha1.JobType
- func (g *PruneExecutor) GetRepository() string
- func (g *PruneExecutor) Logger() logr.Logger
- func (g *PruneExecutor) RegisterJobSucceededConditionCallback()
- type QueueWorker
- type RestoreExecutor
- func (*RestoreExecutor) Exclusive() bool
- func (r *RestoreExecutor) Execute() error
- func (r *RestoreExecutor) GetConcurrencyLimit() int
- func (g *RestoreExecutor) GetJobNamespace() string
- func (g *RestoreExecutor) GetJobNamespacedName() types.NamespacedName
- func (g *RestoreExecutor) GetJobType() v1alpha1.JobType
- func (g *RestoreExecutor) GetRepository() string
- func (g *RestoreExecutor) Logger() logr.Logger
- func (g *RestoreExecutor) RegisterJobSucceededConditionCallback()
Constants ¶
const ( // ConditionRoleReady indicates whether the k8up Role was created successfully ConditionRoleReady status.ConditionType = "RoleReady" // ConditionRoleBindingReady indicates whether the k8up RoleBinding was created successfully ConditionRoleBindingReady status.ConditionType = "RoleBindingReady" // ConditionServiceAccountReady indicates whether the k8up ServiceAccount was created successfully ConditionServiceAccountReady status.ConditionType = "ServiceAccountReady" )
Conditions a Backup object can take
const ( // ConditionJobCreated indicates whether the relevant job was created or not and perhaps why ConditionJobCreated status.ConditionType = "JobCreated" // ConditionJobSucceeded indicates that the relevant job has ended and was successful ConditionJobSucceeded status.ConditionType = "JobSucceeded" // ConditionCleanupSucceeded indicates whether the cleanup job succeeded ConditionCleanupSucceeded status.ConditionType = "CleanupSucceeded" )
Generic conditions
Variables ¶
This section is empty.
Functions ¶
func BuildTagArgs ¶
BuildTagArgs will prepend "--tag " to every element in the given []string
Types ¶
type ArchiveExecutor ¶
type ArchiveExecutor struct {
// contains filtered or unexported fields
}
ArchiveExecutor will execute the batch.job for archive.
func NewArchiveExecutor ¶
func NewArchiveExecutor(config job.Config) *ArchiveExecutor
NewArchiveExecutor will return a new executor for archive jobs.
func (*ArchiveExecutor) Execute ¶
func (a *ArchiveExecutor) Execute() error
Execute creates the actual batch.job on the k8s api.
func (*ArchiveExecutor) GetConcurrencyLimit ¶
func (a *ArchiveExecutor) GetConcurrencyLimit() int
GetConcurrencyLimit returns the concurrent jobs limit
func (*ArchiveExecutor) GetJobNamespace ¶
func (g *ArchiveExecutor) GetJobNamespace() string
func (*ArchiveExecutor) GetJobNamespacedName ¶
func (g *ArchiveExecutor) GetJobNamespacedName() types.NamespacedName
func (*ArchiveExecutor) GetJobType ¶
func (*ArchiveExecutor) GetRepository ¶
func (g *ArchiveExecutor) GetRepository() string
func (*ArchiveExecutor) RegisterJobSucceededConditionCallback ¶
func (g *ArchiveExecutor) RegisterJobSucceededConditionCallback()
RegisterJobSucceededConditionCallback registers an observer on the job which updates ConditionJobSucceeded when the job succeeds or fails, respectively.
type BackupExecutor ¶
type BackupExecutor struct {
// contains filtered or unexported fields
}
BackupExecutor creates a batch.job object on the cluster. It merges all the information provided by defaults and the CRDs to ensure the backup has all information to run.
func NewBackupExecutor ¶
func NewBackupExecutor(config job.Config) *BackupExecutor
NewBackupExecutor returns a new BackupExecutor.
func (*BackupExecutor) Execute ¶
func (b *BackupExecutor) Execute() error
Execute triggers the actual batch.job creation on the cluster. It will also register a callback function on the observer so the prebackup pods can be removed after the backup has finished.
func (*BackupExecutor) GetConcurrencyLimit ¶
func (b *BackupExecutor) GetConcurrencyLimit() int
GetConcurrencyLimit returns the concurrent jobs limit
func (*BackupExecutor) GetJobNamespace ¶
func (g *BackupExecutor) GetJobNamespace() string
func (*BackupExecutor) GetJobNamespacedName ¶
func (g *BackupExecutor) GetJobNamespacedName() types.NamespacedName
func (*BackupExecutor) GetJobType ¶
func (*BackupExecutor) GetRepository ¶
func (g *BackupExecutor) GetRepository() string
func (*BackupExecutor) RegisterJobSucceededConditionCallback ¶
func (g *BackupExecutor) RegisterJobSucceededConditionCallback()
RegisterJobSucceededConditionCallback registers an observer on the job which updates ConditionJobSucceeded when the job succeeds or fails, respectively.
type CheckExecutor ¶
type CheckExecutor struct {
// contains filtered or unexported fields
}
CheckExecutor will execute the batch.job for checks.
func NewCheckExecutor ¶
func NewCheckExecutor(config job.Config) *CheckExecutor
NewCheckExecutor will return a new executor for check jobs.
func (*CheckExecutor) Exclusive ¶
func (*CheckExecutor) Exclusive() bool
Exclusive should return true for jobs that can't run while other jobs run.
func (*CheckExecutor) Execute ¶
func (c *CheckExecutor) Execute() error
Execute creates the actual batch.job on the k8s api.
func (*CheckExecutor) GetConcurrencyLimit ¶
func (c *CheckExecutor) GetConcurrencyLimit() int
GetConcurrencyLimit returns the concurrent jobs limit
func (*CheckExecutor) GetJobNamespace ¶
func (g *CheckExecutor) GetJobNamespace() string
func (*CheckExecutor) GetJobNamespacedName ¶
func (g *CheckExecutor) GetJobNamespacedName() types.NamespacedName
func (*CheckExecutor) GetJobType ¶
func (*CheckExecutor) GetRepository ¶
func (g *CheckExecutor) GetRepository() string
func (*CheckExecutor) RegisterJobSucceededConditionCallback ¶
func (g *CheckExecutor) RegisterJobSucceededConditionCallback()
RegisterJobSucceededConditionCallback registers an observer on the job which updates ConditionJobSucceeded when the job succeeds or fails, respectively.
type EnvVarConverter ¶
type EnvVarConverter struct {
Vars map[string]envVarEntry
}
EnvVarConverter can convert the given map to a []corev1.EnvVar. It also provides a function to merge another EnvVarConverter instance into itself. The merge will overwrite all zero-valued or nor declared entries.
func DefaultEnv ¶
func DefaultEnv(namespace string) EnvVarConverter
DefaultEnv returns an environment that contains the default values for the fields.
func NewEnvVarConverter ¶
func NewEnvVarConverter() EnvVarConverter
NewEnvVarConverter returns a new
func (*EnvVarConverter) Convert ¶
func (e *EnvVarConverter) Convert() []corev1.EnvVar
Convert returns a ready-to-use []corev1.EnvVar where all the key value pairs have been added according to their type. If string and envVarSource are set the string will have precedence.
func (*EnvVarConverter) Merge ¶
func (e *EnvVarConverter) Merge(source EnvVarConverter) error
Merge will merge the source into the instance. If there's no entry in the instance that exists in the source, the source entry will be added. If there's a zero-valued entry, it will also be overwritten.
func (*EnvVarConverter) SetEnvVarSource ¶
func (e *EnvVarConverter) SetEnvVarSource(key string, value *corev1.EnvVarSource)
SetEnvVarSource add an EnvVarSource to the environment with the given key.
func (*EnvVarConverter) SetString ¶
func (e *EnvVarConverter) SetString(key, value string)
SetString adds a string key and value pair to the environment.
type PruneExecutor ¶
type PruneExecutor struct {
// contains filtered or unexported fields
}
PruneExecutor will execute the batch.job for Prunes.
func NewPruneExecutor ¶
func NewPruneExecutor(config job.Config) *PruneExecutor
NewPruneExecutor will return a new executor for Prune jobs.
func (*PruneExecutor) Exclusive ¶
func (p *PruneExecutor) Exclusive() bool
Exclusive should return true for jobs that can't run while other jobs run.
func (*PruneExecutor) Execute ¶
func (p *PruneExecutor) Execute() error
Execute creates the actual batch.job on the k8s api.
func (*PruneExecutor) GetConcurrencyLimit ¶
func (p *PruneExecutor) GetConcurrencyLimit() int
GetConcurrencyLimit returns the concurrent jobs limit
func (*PruneExecutor) GetJobNamespace ¶
func (g *PruneExecutor) GetJobNamespace() string
func (*PruneExecutor) GetJobNamespacedName ¶
func (g *PruneExecutor) GetJobNamespacedName() types.NamespacedName
func (*PruneExecutor) GetJobType ¶
func (*PruneExecutor) GetRepository ¶
func (g *PruneExecutor) GetRepository() string
func (*PruneExecutor) RegisterJobSucceededConditionCallback ¶
func (g *PruneExecutor) RegisterJobSucceededConditionCallback()
RegisterJobSucceededConditionCallback registers an observer on the job which updates ConditionJobSucceeded when the job succeeds or fails, respectively.
type QueueWorker ¶
type QueueWorker struct {
// contains filtered or unexported fields
}
QueueWorker is the object responsible for iterating the job queue and triggering the execution of the jobs.
func GetExecutor ¶
func GetExecutor() *QueueWorker
GetExecutor will return the singleton instance for the executor.
type RestoreExecutor ¶
type RestoreExecutor struct {
// contains filtered or unexported fields
}
func NewRestoreExecutor ¶
func NewRestoreExecutor(config job.Config) *RestoreExecutor
NewRestoreExecutor will return a new executor for Restore jobs.
func (*RestoreExecutor) Execute ¶
func (r *RestoreExecutor) Execute() error
Execute creates the actual batch.job on the k8s api.
func (*RestoreExecutor) GetConcurrencyLimit ¶
func (r *RestoreExecutor) GetConcurrencyLimit() int
GetConcurrencyLimit returns the concurrent jobs limit
func (*RestoreExecutor) GetJobNamespace ¶
func (g *RestoreExecutor) GetJobNamespace() string
func (*RestoreExecutor) GetJobNamespacedName ¶
func (g *RestoreExecutor) GetJobNamespacedName() types.NamespacedName
func (*RestoreExecutor) GetJobType ¶
func (*RestoreExecutor) GetRepository ¶
func (g *RestoreExecutor) GetRepository() string
func (*RestoreExecutor) RegisterJobSucceededConditionCallback ¶
func (g *RestoreExecutor) RegisterJobSucceededConditionCallback()
RegisterJobSucceededConditionCallback registers an observer on the job which updates ConditionJobSucceeded when the job succeeds or fails, respectively.