problemclient

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2019 License: Apache-2.0 Imports: 19 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// GetConditions get all specifiec conditions of current node.
	GetConditions(conditionTypes []v1.NodeConditionType) ([]*v1.NodeCondition, error)
	// SetConditions set or update conditions of current node.
	SetConditions(conditions []v1.NodeCondition) error
	// Eventf reports the event.
	Eventf(eventType string, source, reason, messageFmt string, args ...interface{})
}

Client is the interface of problem client

func NewClientOrDie

func NewClientOrDie(npdo *options.NodeProblemDetectorOptions) Client

NewClientOrDie creates a new problem client, panics if error occurs.

type FakeProblemClient

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

FakeProblemClient is a fake problem client for debug.

func NewFakeProblemClient

func NewFakeProblemClient() *FakeProblemClient

NewFakeProblemClient creates a new fake problem client.

func (*FakeProblemClient) AssertConditions

func (f *FakeProblemClient) AssertConditions(expected []v1.NodeCondition) error

AssertConditions asserts that the internal conditions in fake problem client should match the expected conditions.

func (*FakeProblemClient) Eventf

func (f *FakeProblemClient) Eventf(eventType string, source, reason, messageFmt string, args ...interface{})

Eventf does nothing now.

func (*FakeProblemClient) GetConditions

func (f *FakeProblemClient) GetConditions(types []v1.NodeConditionType) ([]*v1.NodeCondition, error)

GetConditions is a fake mimic of GetConditions, it returns the conditions cached internally.

func (*FakeProblemClient) InjectError

func (f *FakeProblemClient) InjectError(fun string, err error)

InjectError injects error to specific function.

func (*FakeProblemClient) SetConditions

func (f *FakeProblemClient) SetConditions(conditions []v1.NodeCondition) error

SetConditions is a fake mimic of SetConditions, it only update the internal condition cache.

Jump to

Keyboard shortcuts

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