controller

package
v1.14.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 52 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

View Source
var (
	QueueOps                  = queue.NewQueueOperationsCtx()
	CtxOperatorConfig         = typedctx.WithDefault[*config.OperatorConfig](nil)
	CtxClusterNN              = typedctx.WithDefault(types.NamespacedName{})
	CtxSecretNN               = typedctx.WithDefault(types.NamespacedName{})
	CtxSecret                 = typedctx.WithDefault[*corev1.Secret](nil)
	CtxSecretHash             = typedctx.WithDefault("")
	CtxCluster                = typedctx.WithDefault[*v1alpha1.SpiceDBCluster](nil)
	CtxConfig                 = typedctx.WithDefault[*config.Config](nil)
	CtxMigrationHash          = typedctx.WithDefault("")
	CtxDeployments            = typedctx.Boxed(make([]*appsv1.Deployment, 0))
	CtxJobs                   = typedctx.Boxed(make([]*batchv1.Job, 0))
	CtxCurrentMigrationJob    = typedctx.WithDefault[*batchv1.Job](nil)
	CtxCurrentSpiceDeployment = typedctx.WithDefault[*appsv1.Deployment](nil)
	CtxSelfPauseObject        = typedctx.WithDefault(new(v1alpha1.SpiceDBCluster))
)
View Source
var (
	OwnedFactoryKey     = typed.NewFactoryKey(v1alpha1.SpiceDBClusterResourceName, "local", "unfiltered")
	DependentFactoryKey = typed.NewFactoryKey(v1alpha1.SpiceDBClusterResourceName, "local", "dependents")
)

Functions

func NewPauseHandler added in v1.1.0

func NewPauseHandler(
	patchStatus func(ctx context.Context, patch *v1alpha1.SpiceDBCluster) error,
	next handler.ContextHandler,
) handler.Handler

func NewSecretAdoptionHandler added in v1.0.0

func NewSecretAdoptionHandler(recorder record.EventRecorder, getFromCache func(ctx context.Context) (*corev1.Secret, error), missingFunc func(ctx context.Context, err error), secretIndexer *typed.Indexer[*corev1.Secret], secretApplyFunc adopt.ApplyFunc[*corev1.Secret, *applycorev1.SecretApplyConfiguration], existsFunc func(ctx context.Context, name types.NamespacedName) error, next handler.Handler) handler.Handler

func NewSelfPauseHandler added in v1.0.0

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

Types

type ConfigChangedHandler added in v1.0.0

type ConfigChangedHandler struct {
	// contains filtered or unexported fields
}

func (*ConfigChangedHandler) Handle added in v1.0.0

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

type Controller

type Controller struct {
	*manager.OwnedResourceController
	// contains filtered or unexported fields
}

func NewController

func NewController(ctx context.Context, registry *typed.Registry, dclient dynamic.Interface, kclient kubernetes.Interface, configFilePath string, broadcaster record.EventBroadcaster) (*Controller, error)

func (*Controller) Handle added in v1.0.0

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

Handle inspects the current SpiceDBCluster object and ensures the desired state is persisted on the cluster.

func (*Controller) Patch added in v1.0.0

func (c *Controller) Patch(ctx context.Context, patch *v1alpha1.SpiceDBCluster) error

func (*Controller) PatchStatus added in v1.0.0

func (c *Controller) PatchStatus(ctx context.Context, patch *v1alpha1.SpiceDBCluster) error

type DeploymentHandler added in v1.0.0

type DeploymentHandler struct {
	// contains filtered or unexported fields
}

func (*DeploymentHandler) Handle added in v1.0.0

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

type JobCleanupHandler added in v1.0.0

type JobCleanupHandler struct {
	// contains filtered or unexported fields
}

func (*JobCleanupHandler) Handle added in v1.0.0

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

type MigrationCheckHandler added in v1.0.0

type MigrationCheckHandler struct {
	// contains filtered or unexported fields
}

func (*MigrationCheckHandler) Handle added in v1.0.0

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

type MigrationRunHandler added in v1.0.0

type MigrationRunHandler struct {
	// contains filtered or unexported fields
}

func (*MigrationRunHandler) Handle added in v1.0.0

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

type ValidateConfigHandler added in v1.0.0

type ValidateConfigHandler struct {
	// contains filtered or unexported fields
}

func (*ValidateConfigHandler) Handle added in v1.0.0

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

type WaitForMigrationsHandler added in v1.0.0

type WaitForMigrationsHandler struct {
	// contains filtered or unexported fields
}

func (*WaitForMigrationsHandler) Handle added in v1.0.0

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