operator

package
v0.0.0-...-cbd8539 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 54 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewVSphereProblemDetectorController

func NewVSphereProblemDetectorController(
	operatorClient *OperatorClient,
	kubeClient kubernetes.Interface,
	namespacedInformer v1helpers.KubeInformersForNamespaces,
	configInformer infrainformer.InfrastructureInformer,
	eventRecorder events.Recorder,
	clusterCSIDriverInformer clustercsidriverinformer.ClusterCSIDriverInformer) factory.Controller

func RunOperator

func RunOperator(ctx context.Context, controllerConfig *controllercmd.ControllerContext) error

Types

type CheckThreadPool

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

CheckThreadPool runs individual functions (presumably checks) as go routines. It makes sure that only limited number of functions actually run in parallel.

func NewCheckThreadPool

func NewCheckThreadPool(parallelism int, channelBufferSize int) *CheckThreadPool

Creates a new CheckThreadPool with given max. number of goroutines.

func (*CheckThreadPool) RunGoroutine

func (r *CheckThreadPool) RunGoroutine(ctx context.Context, check func())

RunGoroutine runs given check in a worker goroutine. This call can block until a worker goroutine is available.

func (*CheckThreadPool) Wait

func (r *CheckThreadPool) Wait(ctx context.Context) error

Wait blocks until all previously started goroutines finish or ctx expires.

type OperatorClient

type OperatorClient struct {
	Informers operatorclientinformers.SharedInformerFactory
	Client    operatorconfigclient.StoragesGetter
}

func (OperatorClient) GetObjectMeta

func (c OperatorClient) GetObjectMeta() (*metav1.ObjectMeta, error)

func (OperatorClient) GetOperatorInstance

func (c OperatorClient) GetOperatorInstance() (*operatorv1.Storage, error)

func (OperatorClient) GetOperatorState

func (OperatorClient) GetOperatorStateWithQuorum

func (c OperatorClient) GetOperatorStateWithQuorum(ctx context.Context) (*operatorv1.OperatorSpec, *operatorv1.OperatorStatus, string, error)

func (OperatorClient) Informer

func (OperatorClient) UpdateOperatorSpec

func (c OperatorClient) UpdateOperatorSpec(ctx context.Context, resourceVersion string, spec *operatorv1.OperatorSpec) (*operatorv1.OperatorSpec, string, error)

func (OperatorClient) UpdateOperatorStatus

func (c OperatorClient) UpdateOperatorStatus(ctx context.Context, resourceVersion string, status *operatorv1.OperatorStatus) (*operatorv1.OperatorStatus, error)

type ResultCollector

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

ResultCollector accumulates results of each check, as the checks run in parallel.

func NewResultsCollector

func NewResultsCollector() *ResultCollector

NewResultCollector creates a new ResultCollector

func (*ResultCollector) AddResult

func (r *ResultCollector) AddResult(res checkResult)

AddResult stores result of a single check. It is allowed to store result of a single check several times, e.g. once for each node. The collector will merge the result.

func (*ResultCollector) Collect

func (r *ResultCollector) Collect() ([]checkResult, error)

Collect returns currently accumulated checks. It merges results of the same check into a single error It returns status of each check and overall succeeded / failed status of all checks.

Jump to

Keyboard shortcuts

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