Documentation ¶
Index ¶
- func BuildTagArgs(tagList []string) []string
- func NewExecutor(config job.Config) queue.Executor
- type ArchiveExecutor
- func (g *ArchiveExecutor) CreateObjectIfNotExisting(obj client.Object) error
- 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() k8upv1.JobType
- func (g *ArchiveExecutor) GetRepository() string
- func (g *ArchiveExecutor) Logger() logr.Logger
- func (g *ArchiveExecutor) RegisterJobSucceededConditionCallback()
- type BackupExecutor
- func (g *BackupExecutor) CreateObjectIfNotExisting(obj client.Object) error
- 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() k8upv1.JobType
- func (g *BackupExecutor) GetRepository() string
- func (g *BackupExecutor) Logger() logr.Logger
- func (g *BackupExecutor) RegisterJobSucceededConditionCallback()
- func (b *BackupExecutor) StartPreBackup() (bool, error)
- func (b *BackupExecutor) StopPreBackupDeployments()
- type CheckExecutor
- func (g *CheckExecutor) CreateObjectIfNotExisting(obj client.Object) error
- 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() k8upv1.JobType
- func (g *CheckExecutor) GetRepository() string
- func (g *CheckExecutor) Logger() logr.Logger
- func (g *CheckExecutor) RegisterJobSucceededConditionCallback()
- type EnvVarConverter
- func (e *EnvVarConverter) Convert() []corev1.EnvVar
- func (e *EnvVarConverter) Merge(source EnvVarConverter) error
- func (e *EnvVarConverter) SetEnvVarSource(key string, value *corev1.EnvVarSource)
- func (e *EnvVarConverter) SetString(key, value string)
- func (e *EnvVarConverter) SetStringOrDefault(key, value, def string)
- type PruneExecutor
- func (g *PruneExecutor) CreateObjectIfNotExisting(obj client.Object) error
- 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() k8upv1.JobType
- func (g *PruneExecutor) GetRepository() string
- func (g *PruneExecutor) Logger() logr.Logger
- func (g *PruneExecutor) RegisterJobSucceededConditionCallback()
- type QueueWorker
- type RestoreExecutor
- func (g *RestoreExecutor) CreateObjectIfNotExisting(obj client.Object) error
- 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() k8upv1.JobType
- func (g *RestoreExecutor) GetRepository() string
- func (g *RestoreExecutor) Logger() logr.Logger
- func (g *RestoreExecutor) RegisterJobSucceededConditionCallback()
Constants ¶
This section is empty.
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) CreateObjectIfNotExisting ¶
CreateObjectIfNotExisting tries to create the given object, but ignores AlreadyExistsError. If it fails for any other reason, the Ready condition is set to False with the error message and reason.
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) CreateObjectIfNotExisting ¶
CreateObjectIfNotExisting tries to create the given object, but ignores AlreadyExistsError. If it fails for any other reason, the Ready condition is set to False with the error message and reason.
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 PreBackupPods 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.
func (*BackupExecutor) StartPreBackup ¶
func (b *BackupExecutor) StartPreBackup() (bool, error)
StartPreBackup will start the defined pods as deployments. It returns true and no error if there are no PreBackups to run after setting the ConditionPreBackupPodsReady accordingly. Returns false and error if the retrieval of PreBackupPod templates failed (with status update).
func (*BackupExecutor) StopPreBackupDeployments ¶
func (b *BackupExecutor) StopPreBackupDeployments()
StopPreBackupDeployments will remove the deployments.
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) CreateObjectIfNotExisting ¶
CreateObjectIfNotExisting tries to create the given object, but ignores AlreadyExistsError. If it fails for any other reason, the Ready condition is set to False with the error message and reason.
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.
func (*EnvVarConverter) SetStringOrDefault ¶
func (e *EnvVarConverter) SetStringOrDefault(key, value, def string)
SetStringOrDefault adds a string key and value pair to the environment. If value is an empty string, it will use the given default value.
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) CreateObjectIfNotExisting ¶
CreateObjectIfNotExisting tries to create the given object, but ignores AlreadyExistsError. If it fails for any other reason, the Ready condition is set to False with the error message and reason.
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) CreateObjectIfNotExisting ¶
CreateObjectIfNotExisting tries to create the given object, but ignores AlreadyExistsError. If it fails for any other reason, the Ready condition is set to False with the error message and reason.
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.