Documentation
¶
Index ¶
- func NewOperatorClient(kubeConfig *rest.Config) (v1helpers.OperatorClientWithFinalizers, ...)
- func NewVSphereProblemDetectorController(operatorClient v1helpers.OperatorClientWithFinalizers, ...) factory.Controller
- func RunOperator(ctx context.Context, controllerConfig *controllercmd.ControllerContext) error
- type CheckThreadPool
- type ResultCollector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewOperatorClient ¶
func NewOperatorClient( kubeConfig *rest.Config, ) (v1helpers.OperatorClientWithFinalizers, dynamicinformer.DynamicSharedInformerFactory, error)
func NewVSphereProblemDetectorController ¶
func NewVSphereProblemDetectorController( operatorClient v1helpers.OperatorClientWithFinalizers, 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.
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.