handlers

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2022 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventRunningMigrations = "RunningMigrations"

	HandlerDeploymentKey        handler.Key = "deploymentChain"
	HandlerMigrationRunKey      handler.Key = "runMigration"
	HandlerWaitForMigrationsKey handler.Key = "waitForMigrationChain"
)
View Source
const EventInvalidSpiceDBConfig = "InvalidSpiceDBConfig"
View Source
const EventMigrationsComplete = "MigrationsCompleted"
View Source
const EventSecretAdoptedBySpiceDBCluster = "SecretAdoptedBySpiceDB"
View Source
const HandlerSelfPauseKey handler.Key = "nextSelfPause"

Variables

This section is empty.

Functions

func NewConfigChangedHandler

func NewConfigChangedHandler(ctrls libctrl.HandlerControls, cluster *v1alpha1.SpiceDBCluster, patchStatus func(ctx context.Context, patch *v1alpha1.SpiceDBCluster) error, next handler.Handler) handler.Handler

func NewEnsureDeploymentHandler

func NewEnsureDeploymentHandler(ctrls libctrl.HandlerControls,
	applyDeployment func(ctx context.Context, dep *applyappsv1.DeploymentApplyConfiguration) (*appsv1.Deployment, error),
	deleteDeployment func(ctx context.Context, name string) error,
	patchStatus func(ctx context.Context, patch *v1alpha1.SpiceDBCluster) error,
	next handler.ContextHandler,
) handler.Handler

func NewJobCleanupHandler

func NewJobCleanupHandler(ctrls libctrl.HandlerControls,
	getJobPods func(ctx context.Context) []*corev1.Pod,
	getJobs func(ctx context.Context) []*batchv1.Job,
	deleteJob func(ctx context.Context, name string) error,
	deletePod func(ctx context.Context, name string) error,
) handler.Handler

func NewMigrationCheckHandler

func NewMigrationCheckHandler(ctrls libctrl.HandlerControls, recorder record.EventRecorder, next handler.Handlers) handler.Handler

func NewMigrationRunHandler

func NewMigrationRunHandler(ctrls libctrl.HandlerControls,
	patchStatus func(ctx context.Context, patch *v1alpha1.SpiceDBCluster) error,
	applyJob func(ctx context.Context, job *applybatchv1.JobApplyConfiguration) error,
	deleteJob func(ctx context.Context, name string) error,
	next handler.ContextHandler,
) handler.Handler

func NewSecretAdoptionHandler

func NewSecretAdoptionHandler(ctrls libctrl.HandlerControls, recorder record.EventRecorder, secretName string, secretIndexer cache.Indexer, secretApplyFunc SecretApplyFunc, next handler.Handler) handler.Handler

func NewSelfPauseHandler

func NewSelfPauseHandler(ctrls libctrl.HandlerControls, cluster *v1alpha1.SpiceDBCluster,
	patch func(ctx context.Context, patch *v1alpha1.SpiceDBCluster) error,
	patchStatus func(ctx context.Context, patch *v1alpha1.SpiceDBCluster) error,
) handler.Handler

func NewValidateConfigHandler

func NewValidateConfigHandler(ctrls libctrl.HandlerControls, uid types.UID, rawConfig json.RawMessage, spicedbImage string, generation int64, patchStatus func(ctx context.Context, patch *v1alpha1.SpiceDBCluster) error, recorder record.EventRecorder, next handler.Handler) handler.Handler

func NewWaitForMigrationsHandler

func NewWaitForMigrationsHandler(ctrls libctrl.HandlerControls, recorder record.EventRecorder, next handler.Handlers) handler.Handler

Types

type ConfigChangedHandler

type ConfigChangedHandler struct {
	libctrl.ControlAll
	// contains filtered or unexported fields
}

func (*ConfigChangedHandler) Handle

func (c *ConfigChangedHandler) Handle(ctx context.Context)

type DeploymentHandler

type DeploymentHandler struct {
	libctrl.ControlAll
	// contains filtered or unexported fields
}

func (*DeploymentHandler) Handle

func (m *DeploymentHandler) Handle(ctx context.Context)

type JobCleanupHandler

type JobCleanupHandler struct {
	libctrl.ControlAll
	// contains filtered or unexported fields
}

func (*JobCleanupHandler) Handle

func (s *JobCleanupHandler) Handle(ctx context.Context)

type MigrationCheckHandler

type MigrationCheckHandler struct {
	libctrl.ControlRequeueErr
	// contains filtered or unexported fields
}

TODO: could be generalized as some sort of "Hash Handoff" flow

func (*MigrationCheckHandler) Handle

func (m *MigrationCheckHandler) Handle(ctx context.Context)

type MigrationRunHandler

type MigrationRunHandler struct {
	libctrl.ControlAll
	// contains filtered or unexported fields
}

TODO: see if the config hashing can be generalized / unified with the object hashing

func (*MigrationRunHandler) Handle

func (m *MigrationRunHandler) Handle(ctx context.Context)

type SecretAdopterHandler

type SecretAdopterHandler struct {
	libctrl.ControlAll
	// contains filtered or unexported fields
}

TODO: generic adoption handler

func (*SecretAdopterHandler) Handle

func (s *SecretAdopterHandler) Handle(ctx context.Context)

type SecretApplyFunc

type SecretApplyFunc func(ctx context.Context, secret *applycorev1.SecretApplyConfiguration, opts metav1.ApplyOptions) (result *corev1.Secret, err error)

type ValidateConfigHandler

type ValidateConfigHandler struct {
	libctrl.ControlAll
	// contains filtered or unexported fields
}

func (*ValidateConfigHandler) Handle

func (c *ValidateConfigHandler) Handle(ctx context.Context)

type WaitForMigrationsHandler

type WaitForMigrationsHandler struct {
	libctrl.ControlRequeueAfter
	// contains filtered or unexported fields
}

func (*WaitForMigrationsHandler) Handle

func (m *WaitForMigrationsHandler) Handle(ctx context.Context)

Jump to

Keyboard shortcuts

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