job

package
v0.0.0-...-83a5f58 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: Apache-2.0 Imports: 14 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"

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 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 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

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