chi

package
v0.0.0-...-a89fa9e Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: Apache-2.0 Imports: 79 Imported by: 2

Documentation

Index

Constants

View Source
const FinalizerName = "finalizer.clickhouseinstallation.altinity.com"

FinalizerName specifies name of the finalizer to be used with CHI

Variables

View Source
var (
	// ErrKeeperRefResolve indicates a failure to resolve a keeper reference (e.g., service not found).
	ErrKeeperRefResolve = errors.New("failed to resolve keeper ref")
	// ErrKeeperRefNoNodes indicates a keeper reference resolved successfully but produced zero nodes.
	ErrKeeperRefNoNodes = errors.New("keeper ref resolved to 0 nodes")
	// ErrKeeperNotReady indicates the referenced keeper's pods are not all Running yet.
	ErrKeeperNotReady = errors.New("keeper not ready")
)

Functions

func NewDropReplicaOptions

func NewDropReplicaOptions() *dropReplicaOptions

func NewDropReplicaOptionsArr

func NewDropReplicaOptionsArr(opts ...*dropReplicaOptions) (res dropReplicaOptionsArr)

NewDropReplicaOptionsArr creates new dropReplicaOptions array

func NewInformerFactoryForCHOPGeneratedObjects

func NewInformerFactoryForCHOPGeneratedObjects(
	kubeClient kube.Interface,
	resyncPeriod time.Duration,
) kubeInformers.SharedInformerFactory

NewInformerFactoryForCHOPGeneratedObjects builds the kube informer factory, narrowed at the API server to objects the operator generated.

Without the selector these caches, and the DeltaFIFO feeding them, scale with the size of the whole cluster rather than with the number of managed installations: GetInformerNamespace falls back to NamespaceAll for every watch-namespace form except a single literal name, which covers the shipped kube-system bundle (where an empty include means watch-all) and OLM AllNamespaces (which arrives as ".*" and fails the DNS-label check).

Safe because these informers are an event source only - nothing takes a Lister or an Indexer off this factory, and reads go through the kube client directly - and because every handler already gates on the same label through isTrackedObject. The selector tests one of that gate's two conjuncts - the gate also requires the namespace to be watched - so everything it drops was already discarded by the handlers.

One behaviour does change: an object that LOSES the label leaves the selector, and the API server reports that to a filtered watch as a deletion carrying the last matching version. The handler therefore runs, and for a Pod that means one log line and one PodDelete counter - nothing destructive, and no further events for that object.

EndpointSlices are watched but written by kube, not by us; they match only because the EndpointSlice controller mirrors the Service's labels onto them.

func NewMigrateTableOptions

func NewMigrateTableOptions() *migrateTableOptions

func NewMigrateTableOptionsArr

func NewMigrateTableOptionsArr(opts ...*migrateTableOptions) (res migrateTableOptionsArr)

NewMigrateTableOptionsArr creates new migrateTableOptions array

func ShouldEnqueue

func ShouldEnqueue(cr *api.ClickHouseInstallation) bool

Types

type Controller

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

Controller defines CRO controller

func NewController

func NewController(
	chopClient chopClientSet.Interface,
	extClient apiExtensions.Interface,
	kubeClient kube.Interface,
	dynamicClient dynamic.Interface,
	chopConfigInformerFactory chopInformers.SharedInformerFactory,
	chopInformerFactory chopInformers.SharedInformerFactory,
	kubeInformerFactory kubeInformers.SharedInformerFactory,
) *Controller

NewController creates instance of Controller

func (*Controller) GetCR

GetCR gets CR by any object that is either a CR itself or has labels referencing a CR

func (*Controller) OnStatefulSetCreateFailed

func (c *Controller) OnStatefulSetCreateFailed(ctx context.Context, host *api.Host) common.ErrorCRUD

OnStatefulSetCreateFailed handles situation when StatefulSet create failed on k8s level

func (*Controller) OnStatefulSetUpdateFailed

func (c *Controller) OnStatefulSetUpdateFailed(ctx context.Context, rollbackStatefulSet *apps.StatefulSet, host *api.Host, kubeSTS interfaces.IKubeSTS) common.ErrorCRUD

OnStatefulSetUpdateFailed handles situation when StatefulSet update failed in k8s level It can try to revert StatefulSet to its previous version, specified in rollbackStatefulSet

func (*Controller) Run

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

Run syncs caches, starts workers

func (*Controller) StartCHKWatcher

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

StartCHKWatcher starts a dynamic informer for CHK resources. When a CHK transitions to Completed status, finds dependent CHIs and enqueues reconcile for them. Respects the reconcile.coordination.keeper.onKeeperResourceUpdate config setting.

type Skip

type Skip struct {
	New             bool
	Stopped         bool
	StoppedAncestor bool
}

type VersionOptions

type VersionOptions struct {
	Skip
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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