controller

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2025 License: Apache-2.0 Imports: 47 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ComponentLabel     = "auto.pulumi.com/component"
	WorkspaceNameLabel = "auto.pulumi.com/workspace-name"
	UpdateNameLabel    = "auto.pulumi.com/update-name"

	WorkspaceComponent ComponentType = "workspace"
	UpdateComponent    ComponentType = "update"
)
View Source
const (
	SecretOutputsAnnotation = "pulumi.com/secrets" //nolint:gosec // this is not a hardcoded credential
	UpdateIndexerWorkspace  = "index.spec.workspaceRef"

	UpdateConditionTypeComplete    = "Complete"
	UpdateConditionTypeFailed      = "Failed"
	UpdateConditionTypeProgressing = "Progressing"

	UpdateConditionReasonComplete    = "Complete"
	UpdateConditionReasonUpdated     = "Updated"
	UpdateConditionReasonProgressing = "Progressing"

	UpdateConditionReasonAborted         = "Aborted"
	UpdateConditionReasonCanceled        = "Canceled"
	UpdateConditionReasonUpdateFailed    = "UpdateFailed"
	UpdateConditionReasonUpdateSucceeded = "UpdateSucceeded"
)
View Source
const (
	WorkspaceIndexerFluxSource  = "index.spec.flux.sourceRef"
	WorkspaceConditionTypeReady = autov1alpha1.WorkspaceReady
	PodAnnotationInitialized    = "auto.pulumi.com/initialized"
	PodAnnotationRevisionHash   = "auto.pulumi.com/revision-hash"

	// Termination grace period for the workspace pod and any update running in it.
	// Upon an update to the workspec spec or content, the statefulset will be updated,
	// leading to graceful pod replacement. The pod receives a SIGTERM signal and has
	// this much time to shut down before it is killed.
	WorkspacePodTerminationGracePeriodSeconds = 10 * 60
)
View Source
const (
	FieldManager                 = "pulumi-kubernetes-operator"
	WorkspacePulumiContainerName = "pulumi"
	WorkspaceShareVolumeName     = "share"
	WorkspaceShareMountPath      = "/share"
	WorkspaceGrpcPort            = 50051
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ComponentType

type ComponentType = string

type ConnectionManager

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

ConnectionManager is responsible for managing connections to workspaces.

func NewConnectionManager

func NewConnectionManager(config *rest.Config, opts ConnectionManagerOptions) (*ConnectionManager, error)

func (*ConnectionManager) Connect

func (*ConnectionManager) Start

func (m *ConnectionManager) Start(ctx context.Context) error

Starts the connection manager, e.g. to periodically clean token caches.

type ConnectionManagerOptions

type ConnectionManagerOptions struct {
	// The service account to impersonate for authentication purposes (i.e. the operator's KSA).
	ServiceAccount types.NamespacedName
}

type DebugPredicate

type DebugPredicate struct {
	Controller string
}

func (*DebugPredicate) Create

func (p *DebugPredicate) Create(e event.CreateEvent) bool

func (*DebugPredicate) Delete

func (p *DebugPredicate) Delete(e event.DeleteEvent) bool

func (*DebugPredicate) Generic

func (p *DebugPredicate) Generic(e event.GenericEvent) bool

func (*DebugPredicate) Update

func (p *DebugPredicate) Update(e event.UpdateEvent) bool

type Event

type Event interface {
	EventType() string
	Reason() string
}

type OwnerReferencesChangedPredicate

type OwnerReferencesChangedPredicate struct{}

func (OwnerReferencesChangedPredicate) Create

func (OwnerReferencesChangedPredicate) Delete

func (OwnerReferencesChangedPredicate) Generic

func (OwnerReferencesChangedPredicate) Update

type UpdateReconciler

type UpdateReconciler struct {
	client.Client
	Scheme            *runtime.Scheme
	Recorder          record.EventRecorder
	ConnectionManager *ConnectionManager
}

UpdateReconciler reconciles a Update object

func (*UpdateReconciler) Reconcile

func (r *UpdateReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile manages the Update CRD and initiates Pulumi operations.

func (*UpdateReconciler) SetupWithManager

func (r *UpdateReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type WorkspaceReconciler

type WorkspaceReconciler struct {
	client.Client
	Scheme            *runtime.Scheme
	Recorder          record.EventRecorder
	ConnectionManager *ConnectionManager
}

WorkspaceReconciler reconciles a Workspace object

func (*WorkspaceReconciler) Reconcile

func (r *WorkspaceReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*WorkspaceReconciler) SetupWithManager

func (r *WorkspaceReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

Jump to

Keyboard shortcuts

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