job

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const CONTAINER_NAME_COMMAND = "shopware-command"
View Source
const CONTAINER_NAME_MIGRATION_JOB = "shopware-migration"
View Source
const CONTAINER_NAME_SETUP_JOB = "shopware-setup"
View Source
const CONTAINER_NAME_SNAPSHOT = "operator-snapshot"

Variables

View Source
var MigrationJobIdentifyer = map[string]string{"type": "migration"}

Functions

func CommandCronJob

func CommandCronJob(store v1.Store, ex v1.StoreExec) *batchv1.CronJob

func CommandJob

func CommandJob(store v1.Store, ex v1.StoreExec) *batchv1.Job

func CommandJobName

func CommandJobName(exec v1.StoreExec) string

func DeleteAllMigrationJobs

func DeleteAllMigrationJobs(ctx context.Context, c client.Client, store *v1.Store) error

func DeleteSetupJob

func DeleteSetupJob(ctx context.Context, c client.Client, store v1.Store) error

func GetCommandCronJob

func GetCommandCronJob(
	ctx context.Context,
	client client.Client,
	store v1.Store,
	exec v1.StoreExec,
) (*batchv1.CronJob, error)

func GetCommandJob

func GetCommandJob(
	ctx context.Context,
	client client.Client,
	store v1.Store,
	exec v1.StoreExec,
) (*batchv1.Job, error)

func GetMigrateHash

func GetMigrateHash(store v1.Store) string

func GetMigrationJob

func GetMigrationJob(
	ctx context.Context,
	client client.Client,
	store v1.Store,
) (*batchv1.Job, error)

func GetSetupJob

func GetSetupJob(ctx context.Context, client client.Client, store v1.Store) (*batchv1.Job, error)

func GetSetupJobName

func GetSetupJobName(store v1.Store) string

func GetSnapshotCreateJob

func GetSnapshotCreateJob(
	ctx context.Context,
	client client.Client,
	store v1.Store,
	snap v1.StoreSnapshotCreate,
) (*batchv1.Job, error)

func GetSnapshotRestoreJob

func GetSnapshotRestoreJob(
	ctx context.Context,
	client client.Client,
	store v1.Store,
	snap v1.StoreSnapshotRestore,
) (*batchv1.Job, error)

func IsCommandJobCompleted

func IsCommandJobCompleted(
	ctx context.Context,
	c client.Client,
	store v1.Store,
	exec v1.StoreExec,
) (bool, error)

This is just a soft check, use container check for a clean check Will return true if container is stopped (Completed, Error)

func IsMigrationJobCompleted

func IsMigrationJobCompleted(
	ctx context.Context,
	c client.Client,
	store v1.Store,
) (bool, error)

This is just a soft check, use container check for a clean check Will return true if container is stopped (Completed, Error)

func IsSetupJobCompleted

func IsSetupJobCompleted(
	ctx context.Context,
	c client.Client,
	store v1.Store,
) (bool, error)

This is just a soft check, use container check for a clean check Will return true if container is stopped (Completed, Error)

func IsSnapshotJobCompleted

func IsSnapshotJobCompleted(
	ctx context.Context,
	c client.Client,
	j *batchv1.Job,
) (bool, error)

func MigrateJobName

func MigrateJobName(store v1.Store) string

func MigrationJob

func MigrationJob(store v1.Store) *batchv1.Job

func SetupJob

func SetupJob(store v1.Store) *batchv1.Job

func SnapshotCreateJob

func SnapshotCreateJob(store v1.Store, snapshot v1.StoreSnapshotCreate) *batchv1.Job

func SnapshotJobName

func SnapshotJobName(snap metav1.ObjectMeta, subCommand string) string

func SnapshotRestoreJob

func SnapshotRestoreJob(store v1.Store, snapshot v1.StoreSnapshotRestore) *batchv1.Job

Types

type JobState

type JobState struct {
	ExitCode int
	Running  bool
}

func IsJobContainerDone

func IsJobContainerDone(
	ctx context.Context,
	c client.Client,
	job *batchv1.Job,
	containerName string,
) (JobState, error)

This is used when sidecars are able to run. We should always use this method for checking

func (JobState) HasErrors

func (s JobState) HasErrors() bool

func (JobState) IsDone

func (s JobState) IsDone() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL