impl

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Affinity

type Affinity struct{}

Affinity does not pass if a node has at least one pod, which should be scheduled on operational nodes and other nodes are in maintenance-required, which do not have such a pod.

func (*Affinity) AfterEval

func (a *Affinity) AfterEval(chainResult bool, params plugin.Parameters) error

func (*Affinity) Check

func (a *Affinity) Check(params plugin.Parameters) (bool, error)

func (*Affinity) New

func (a *Affinity) New(config *ucfg.Config) (plugin.Checker, error)

New creates a new Slack instance with the given config.

type AlterAnnotation

type AlterAnnotation struct {
	Key    string
	Value  string
	Remove bool
}

AlterAnnotation is a trigger plugin, which can add, change or remove an annotation.

func (*AlterAnnotation) New

func (a *AlterAnnotation) New(config *ucfg.Config) (plugin.Trigger, error)

New creates a new AlterAnnotation instance with the given config.

func (*AlterAnnotation) Trigger

func (a *AlterAnnotation) Trigger(params plugin.Parameters) error

Trigger ensures the annotation with the provided key is removed if removes is set to true. Otherwise it sets the annotation with the provided key to the provided value adding the annotation if required.

type AlterLabel

type AlterLabel struct {
	Key    string
	Value  string
	Remove bool
}

AlterLabel is a trigger plugin, which can add, change or remove a label.

func (*AlterLabel) New

func (a *AlterLabel) New(config *ucfg.Config) (plugin.Trigger, error)

New creates a new AlterLabel instance with the given config.

func (*AlterLabel) Trigger

func (a *AlterLabel) Trigger(params plugin.Parameters) error

Trigger ensures the label with the provided key is removed if removes is set to true. Otherwise it sets the label with the provided key to the provided value adding the label if required.

type Condition

type Condition struct {
	Type   string
	Status string
}

Condition is a check plugin that checks if a node has a certain status for a defined condition.

func (*Condition) AfterEval

func (c *Condition) AfterEval(chainResult bool, params plugin.Parameters) error

func (*Condition) Check

func (c *Condition) Check(params plugin.Parameters) (bool, error)

Check asserts that the given status matches the specified condition.

func (*Condition) New

func (c *Condition) New(config *ucfg.Config) (plugin.Checker, error)

New creates a new Condition instance with the given config.

type HasAnnotation

type HasAnnotation struct {
	Key   string
	Value string
}

HasAnnotation is a check plugin that checks whether a node has an annotation or an annotation with a certain value.

func (*HasAnnotation) AfterEval

func (h *HasAnnotation) AfterEval(chainResult bool, params plugin.Parameters) error

func (*HasAnnotation) Check

func (h *HasAnnotation) Check(params plugin.Parameters) (bool, error)

Check checks whether a node has an annotation (if h.Value == "") or an annotation with a certain value (if h.Value != "").

func (*HasAnnotation) New

func (h *HasAnnotation) New(config *ucfg.Config) (plugin.Checker, error)

New creates a new HasAnnotation instance with the given config.

type HasLabel

type HasLabel struct {
	Key   string
	Value string
}

HasLabel is a check plugin that checks whether a node has a label or a label with a certain value.

func (*HasLabel) AfterEval

func (h *HasLabel) AfterEval(chainResult bool, params plugin.Parameters) error

func (*HasLabel) Check

func (h *HasLabel) Check(params plugin.Parameters) (bool, error)

Check checks whether a node has a label (if h.Value == "") or a label with a certain value (if h.Value != "").

func (*HasLabel) New

func (h *HasLabel) New(config *ucfg.Config) (plugin.Checker, error)

New creates a new HasLabel instance with the given config.

type Mail

type Mail struct {
	Auth     bool
	Message  string
	Subject  string
	Address  string
	From     string
	To       []string
	Identity string
	User     string
	Password string
}

Mail is a notification plugins that sends an e-mail.

func (*Mail) New

func (m *Mail) New(config *ucfg.Config) (plugin.Notifier, error)

New creates a new Mail instance with the given config.

func (*Mail) Notify

func (m *Mail) Notify(params plugin.Parameters) error

Notify performs connects to the provided SMTP server and transmits the configured message.

type MaxMaintenance

type MaxMaintenance struct {
	MaxNodes int
}

MaxMaintenance is a check plugin that checks whether the amount of nodes with the in-maintenance state does not exceed the specified amount.

func (*MaxMaintenance) AfterEval

func (m *MaxMaintenance) AfterEval(chainResult bool, params plugin.Parameters) error

func (*MaxMaintenance) Check

func (m *MaxMaintenance) Check(params plugin.Parameters) (bool, error)

Check asserts that no more then the specified amount of nodes is in the in-maintenance state.

func (*MaxMaintenance) New

func (m *MaxMaintenance) New(config *ucfg.Config) (plugin.Checker, error)

New creates a new MaxMaintenance instance with the given config.

type NodeCount

type NodeCount struct {
	Count int
}

func (*NodeCount) AfterEval

func (n *NodeCount) AfterEval(chainResult bool, params plugin.Parameters) error

func (*NodeCount) Check

func (n *NodeCount) Check(params plugin.Parameters) (bool, error)

Check asserts that the cluster has at least the configured amount of nodes.

func (*NodeCount) New

func (n *NodeCount) New(config *ucfg.Config) (plugin.Checker, error)

New creates a new Count instance with the given config.

type SlackThread

type SlackThread struct {
	Token     string
	Channel   string
	Title     string
	Message   string
	LeaseName types.NamespacedName
	Period    time.Duration
	// contains filtered or unexported fields
}

Slack is a notification plugin that uses a slack webhook and a channel to post a notification about the nodes state in slack while grouping messages within a certain period in a thread.

func (*SlackThread) New

func (st *SlackThread) New(config *ucfg.Config) (plugin.Notifier, error)

New creates a new Slack instance with the given config.

func (*SlackThread) Notify

func (st *SlackThread) Notify(params plugin.Parameters) error

func (*SlackThread) SetTestURL

func (st *SlackThread) SetTestURL(url string)

type SlackWebhook

type SlackWebhook struct {
	Hook    string
	Channel string
	Message string
}

SlackWebhook is a notification plugin that uses a slack webhook and a channel to post a notification about the nodes state in slack.

func (*SlackWebhook) New

func (sw *SlackWebhook) New(config *ucfg.Config) (plugin.Notifier, error)

New creates a new Slack instance with the given config.

func (*SlackWebhook) Notify

func (sw *SlackWebhook) Notify(params plugin.Parameters) error

Notify performs a POST-Request to the slack API to create a message within slack.

type Stagger

type Stagger struct {
	Duration       time.Duration
	LeaseName      string
	LeaseNamespace string
	Parallel       int
	// contains filtered or unexported fields
}

Stagger is a check plugin that checks that only one node can pass every configurable period.

func (*Stagger) AfterEval

func (s *Stagger) AfterEval(chainResult bool, params plugin.Parameters) error

If the whole check chain passed, the lease needs to be grabed, so other nodes are blocked from progressing.

func (*Stagger) Check

func (s *Stagger) Check(params plugin.Parameters) (bool, error)

Check asserts that since the last successful check is a certain time has passed.

func (*Stagger) New

func (s *Stagger) New(config *ucfg.Config) (plugin.Checker, error)

New creates a new Stagger instance with the given config.

type TimeWindow

type TimeWindow struct {
	Start    time.Time
	End      time.Time
	Weekdays []time.Weekday
	Exclude  []time.Time
}

TimeWindow is a check plugin that checks whether it is invoked on a certain weekday with a specified timewindow.

func (*TimeWindow) AfterEval

func (tw *TimeWindow) AfterEval(chainResult bool, params plugin.Parameters) error

func (*TimeWindow) Check

func (tw *TimeWindow) Check(params plugin.Parameters) (bool, error)

Check checks whether the current time is within specified time window on allowed weekdays.

func (*TimeWindow) New

func (tw *TimeWindow) New(config *ucfg.Config) (plugin.Checker, error)

New creates a new TimeWindow instance with the given config.

type Wait

type Wait struct {
	Duration time.Duration
}

func (*Wait) AfterEval

func (w *Wait) AfterEval(chainResult bool, params plugin.Parameters) error

func (*Wait) Check

func (w *Wait) Check(params plugin.Parameters) (bool, error)

func (*Wait) New

func (w *Wait) New(config *ucfg.Config) (plugin.Checker, error)

type WaitExclude

type WaitExclude struct {
	Duration time.Duration
	Exclude  []time.Weekday
}

func (*WaitExclude) AfterEval

func (we *WaitExclude) AfterEval(chainResult bool, params plugin.Parameters) error

func (*WaitExclude) Check

func (we *WaitExclude) Check(params plugin.Parameters) (bool, error)

func (*WaitExclude) New

func (we *WaitExclude) New(config *ucfg.Config) (plugin.Checker, error)

Jump to

Keyboard shortcuts

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