controller

package
v0.60.1 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: Apache-2.0 Imports: 47 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Informer factory
	KubeInformerFactory        informers.SharedInformerFactory
	KubedbInformerFactory      kubedbinformers.SharedInformerFactory
	AppCatInformerFactory      appcat_in.SharedInformerFactory
	CertManagerInformerFactory cmInformers.SharedInformerFactory
	PetSetInformerFactory      psinformer.SharedInformerFactory
	ManifestInformerFactory    manifestinformers.SharedInformerFactory

	// External tool to initialize the database
	Initializers Initializers

	// Secret
	SecretInformer cache.SharedIndexInformer
	SecretLister   corelisters.SecretLister

	// PetSet Watcher
	PSQueue    *queue.Worker[any]
	PSInformer cache.SharedIndexInformer
	PSLister   pslister.PetSetLister

	MWInformer cache.SharedIndexInformer
	// manifestWorkerLister is able to list/get manifestWork from a shared informer's store
	MWLister manifestlisters.ManifestWorkLister

	// Only watch or reconcile objects in this namespace (usually for license reasons)
	RestrictToNamespace    string
	LicenseRestrictions    configapi.LicenseRestrictions
	ResyncPeriod           time.Duration
	ReadinessProbeInterval time.Duration
	MaxNumRequeues         int
	NumThreads             int
	NetworkPolicyEnabled   bool
	ShardConfig            string
}

type Controller

type Controller struct {
	ClientConfig *rest.Config
	// KubeBuilder Client
	KBClient client.Client
	// Kubernetes client
	Client kubernetes.Interface
	// KubeDB client
	DBClient cs.Interface
	// PetSet client
	PSClient petsetcs.Interface
	// ManifestWork client
	OCMClient ocmclient.Interface
	// Dynamic client
	DynamicClient dynamic.Interface
	// AppCatalog client
	AppCatalogClient appcat_cs.Interface
	// Cluster topology when the operator started
	ClusterTopology *core_util.Topology
	// Event Recorder
	Recorder record.EventRecorder
	// Audit Event Publisher
	Auditor *auditlib.EventPublisher
}

func (*Controller) CreateDeploymentPodDisruptionBudget

func (c *Controller) CreateDeploymentPodDisruptionBudget(deployment *apps.Deployment) error

func (*Controller) SyncPetSetPDBWithCustomLabelSelectors added in v0.44.0

func (c *Controller) SyncPetSetPDBWithCustomLabelSelectors(ps *psapi.PetSet, replicas int32, labels map[string]string, matchLabelSelectors map[string]string) error

func (*Controller) SyncPetSetPodDisruptionBudget added in v0.44.0

func (c *Controller) SyncPetSetPodDisruptionBudget(ps *psapi.PetSet) error

SyncPetSetPodDisruptionBudget syncs the PDB with the current state of the petSet. The maxUnavailable is calculated based petSet replica count, maxUnavailable = (replicas-1)/2. Also cleanup the PDB, when replica count is 1 or less.

type Initializers

type Initializers struct {
	Stash StashInitializer
}

type OpsRequestController added in v0.60.1

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

func NewOpsRequestController added in v0.60.1

func NewOpsRequestController(kbClient client.Client, kind string) *OpsRequestController

func (*OpsRequestController) AddCancelFunc added in v0.60.1

func (c *OpsRequestController) AddCancelFunc(key string, cancelFunc *context.CancelFunc)

func (*OpsRequestController) DeleteParallelismController added in v0.60.1

func (c *OpsRequestController) DeleteParallelismController(key string)

func (*OpsRequestController) GetParallelismController added in v0.60.1

func (c *OpsRequestController) GetParallelismController(key string) *ParallelismController

func (*OpsRequestController) IsCompleted added in v0.60.1

func (c *OpsRequestController) IsCompleted(key, conditionType string) bool

func (*OpsRequestController) KeyExists added in v0.60.1

func (c *OpsRequestController) KeyExists(key string) bool

func (*OpsRequestController) RemoveCancelFunc added in v0.60.1

func (c *OpsRequestController) RemoveCancelFunc(key string)

func (*OpsRequestController) SetParallelismController added in v0.60.1

func (c *OpsRequestController) SetParallelismController(key string, cancelFunc *context.CancelFunc)

func (*OpsRequestController) ShouldProceed added in v0.60.1

func (c *OpsRequestController) ShouldProceed(key, conditionType string) bool

type ParallelismController added in v0.60.1

type ParallelismController struct {
	*sync.Mutex
	// contains filtered or unexported fields
}

type StashInitializer

type StashInitializer struct {
	StashClient          scs.Interface
	StashInformerFactory stashinformer.SharedInformerFactory
	// StashInitializer RestoreSession
	RSQueue    *queue.Worker[any]
	RSInformer cache.SharedIndexInformer
	RSLister   lister.RestoreSessionLister

	// StashInitializer RestoreBatch
	RBQueue    *queue.Worker[any]
	RBInformer cache.SharedIndexInformer
	RBLister   lister.RestoreBatchLister
}

Directories

Path Synopsis
initializer

Jump to

Keyboard shortcuts

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