Documentation ¶
Index ¶
- type Client
- type FakeProblemClient
- func (f *FakeProblemClient) AssertConditions(expected []v1.NodeCondition) error
- func (f *FakeProblemClient) Eventf(_ string, _, _, _ string, _ ...interface{})
- func (f *FakeProblemClient) GetConditions(_ context.Context, types []v1.NodeConditionType) ([]v1.NodeCondition, error)
- func (f *FakeProblemClient) GetNode(_ context.Context) (*v1.Node, error)
- func (f *FakeProblemClient) InjectError(fun string, err error)
- func (f *FakeProblemClient) SetConditions(_ context.Context, conditions []v1.NodeCondition) error
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // GetConditions get all specific conditions of current node. GetConditions(ctx context.Context, conditionTypes []corev1.NodeConditionType) ([]corev1.NodeCondition, error) // SetConditions set or update conditions of current node. SetConditions(ctx context.Context, conditions []corev1.NodeCondition) error // Eventf reports the event. Eventf(eventType string, source, reason, messageFmt string, args ...interface{}) // GetNode returns the Node object of the node on which the // node-problem-detector runs. GetNode(ctx context.Context) (*corev1.Node, error) }
Client is the interface of problem client.
type FakeProblemClient ¶
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(_ string, _, _, _ string, _ ...interface{})
Eventf does nothing now.
func (*FakeProblemClient) GetConditions ¶
func (f *FakeProblemClient) GetConditions(_ context.Context, 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(_ context.Context, conditions []v1.NodeCondition) error
SetConditions is a fake mimic of SetConditions, it only update the internal condition cache.
type Options ¶
type Options struct { // AgentName is the name of the agent used to communicate with Kubernetes ApiServer. AgentName string // AgentVersion is the version of the agent used to communicate with Kubernetes ApiServer. AgentVersion string // NodeName is the node name used to communicate with Kubernetes ApiServer. NodeName string // EventNamespace is the namespace events are written to EventNamespace string // KubeConfigPath allows to override in-cluster config KubeConfigPath string // Log is the logger Log logrus.FieldLogger }
Click to show internal directories.
Click to hide internal directories.