Documentation ¶
Index ¶
- func NewVSphereProblemDetectorController(operatorClient *OperatorClient, kubeClient kubernetes.Interface, ...) factory.Controller
- func RunOperator(ctx context.Context, controllerConfig *controllercmd.ControllerContext) error
- type CheckThreadPool
- type OperatorClient
- func (c OperatorClient) GetObjectMeta() (*metav1.ObjectMeta, error)
- func (c OperatorClient) GetOperatorInstance() (*operatorv1.Storage, error)
- func (c OperatorClient) GetOperatorState() (*operatorv1.OperatorSpec, *operatorv1.OperatorStatus, string, error)
- func (c OperatorClient) GetOperatorStateWithQuorum(ctx context.Context) (*operatorv1.OperatorSpec, *operatorv1.OperatorStatus, string, error)
- func (c OperatorClient) Informer() cache.SharedIndexInformer
- func (c OperatorClient) UpdateOperatorSpec(ctx context.Context, resourceVersion string, spec *operatorv1.OperatorSpec) (*operatorv1.OperatorSpec, string, error)
- func (c OperatorClient) UpdateOperatorStatus(ctx context.Context, resourceVersion string, status *operatorv1.OperatorStatus) (*operatorv1.OperatorStatus, error)
- type ResultCollector
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.
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 (c OperatorClient) GetOperatorState() (*operatorv1.OperatorSpec, *operatorv1.OperatorStatus, string, error)
func (OperatorClient) GetOperatorStateWithQuorum ¶
func (c OperatorClient) GetOperatorStateWithQuorum(ctx context.Context) (*operatorv1.OperatorSpec, *operatorv1.OperatorStatus, string, error)
func (OperatorClient) Informer ¶
func (c OperatorClient) Informer() cache.SharedIndexInformer
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.