controller

package
v0.0.0-...-1a8e0d1 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ImageRef

func ImageRef(repository, tag string) string

ImageRef returns the canonical "repository:tag" string for an image.

func ShouldDeletePod

func ShouldDeletePod(policy string, phase corev1.PodPhase) bool

ShouldDeletePod determines if a pod should be deleted based on retention policy and pod phase.

Types

type ChildCR

type ChildCR interface {
	client.Object
	GetFlatSpec() *supersetv1alpha1.FlatComponentSpec
	GetConfig() string
	GetConfigChecksum() string
	GetService() *supersetv1alpha1.ComponentServiceSpec
	GetAutoscaling() *supersetv1alpha1.AutoscalingSpec
	GetPDB() *supersetv1alpha1.PDBSpec
	GetComponentStatus() *supersetv1alpha1.ChildComponentStatus
}

ChildCR is implemented by all child CRD types for generic reconciliation.

type ChildControllerDef

type ChildControllerDef struct {
	Name string
	// contains filtered or unexported fields
}

ChildControllerDef defines the data needed to register a child controller.

func ChildControllerDefs

func ChildControllerDefs() []ChildControllerDef

ChildControllerDefs returns the definitions for all child controllers.

type ChildReconciler

type ChildReconciler struct {
	client.Client
	Scheme   *runtime.Scheme
	Recorder events.EventRecorder
	Config   childReconcilerConfig
	NewObj   func() ChildCR
}

ChildReconciler is a generic reconciler for all child CRDs.

func NewChildReconciler

NewChildReconciler creates a ChildReconciler from a ChildControllerDef.

func (*ChildReconciler) Reconcile

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

Reconcile handles the reconciliation loop for a child CRD.

func (*ChildReconciler) SetupWithManager

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

SetupWithManager registers the controller with the manager.

type DeploymentConfig

type DeploymentConfig struct {
	// ContainerName is the name of the main container (e.g. "superset-web-server").
	ContainerName string

	// DefaultCommand is used when the spec Command is empty.
	DefaultCommand []string

	// DefaultArgs is used when the spec Args is empty.
	DefaultArgs []string

	// DefaultPorts are the container ports when none are specified on the spec.
	DefaultPorts []corev1.ContainerPort

	// ForceReplicas, when non-nil, overrides the spec replicas (used for singletons like beat).
	ForceReplicas *int32
}

DeploymentConfig holds the component-specific defaults needed to build a Deployment for any Superset child component.

type SupersetLifecycleTaskReconciler

type SupersetLifecycleTaskReconciler struct {
	client.Client
	Scheme   *runtime.Scheme
	Recorder events.EventRecorder
}

SupersetLifecycleTaskReconciler reconciles a SupersetLifecycleTask object. It manages the initialization lifecycle (database migrations, init commands) by running bare Pods instead of Deployments.

func (*SupersetLifecycleTaskReconciler) Reconcile

func (*SupersetLifecycleTaskReconciler) SetupWithManager

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

type SupersetReconciler

type SupersetReconciler struct {
	client.Client
	Scheme   *runtime.Scheme
	Recorder events.EventRecorder
}

SupersetReconciler reconciles a Superset object.

func (*SupersetReconciler) Reconcile

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

func (*SupersetReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type VersionDirection

type VersionDirection string

VersionDirection represents the relationship between two image versions.

const (
	DirectionUpgrade   VersionDirection = "Upgrade"
	DirectionDowngrade VersionDirection = "Downgrade"
	DirectionRebuild   VersionDirection = "Rebuild"
	DirectionUnknown   VersionDirection = "Unknown"
)

func CompareVersions

func CompareVersions(oldTag, newTag string) VersionDirection

CompareVersions determines the direction between two image tags. Returns Upgrade if newTag > oldTag, Downgrade if newTag < oldTag, Rebuild if equal, or Unknown if either tag is not valid semver.

Jump to

Keyboard shortcuts

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