job

package
v0.0.0-...-c7dc075 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

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