statusmanager

package
v0.45.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StatusLevel

type StatusLevel int

StatusLevel is used to sort priority of reported failure conditions. When operator is failing on two levels (e.g. handling configuration and deploying pods), only the higher level will be reported. This is needed, so failing pods from previous run won't silence failing render of the current run.

const (
	OperatorConfig StatusLevel = iota
	PodDeployment  StatusLevel = iota
)

type StatusManager

type StatusManager struct {
	// contains filtered or unexported fields
}

StatusManager coordinates changes to NetworkAddonsConfig.Status

func New

func New(mgr manager.Manager, name string) *StatusManager

func (*StatusManager) GetAttributes added in v0.41.0

func (status *StatusManager) GetAttributes() ([]types.NamespacedName, []types.NamespacedName, []cnao.Container, int64)

func (*StatusManager) Set

func (status *StatusManager) Set(reachedAvailableLevel bool, conditions ...conditionsv1.Condition)

Set updates the NetworkAddonsConfig.Status with the provided conditions. Since Update call can fail due to a collision with someone else writing into the status, calling set is tried several times. TODO: Calling of Patch instead may save some problems. We can reiterate later, current collision problem is detected by functional tests

func (*StatusManager) SetAttributes added in v0.41.0

func (status *StatusManager) SetAttributes(daemonSets []types.NamespacedName, deployments []types.NamespacedName, containers []cnao.Container, generation int64)

func (*StatusManager) SetFailing

func (status *StatusManager) SetFailing(level StatusLevel, reason, message string)

SetFailing marks the operator as Failing with the given reason and message. If it is not already failing for a lower-level reason, the operator's status will be updated.

func (*StatusManager) SetFromPods

func (status *StatusManager) SetFromPods()

SetFromPods sets the operator status to Failing, Progressing, or Available, based on the current status of the manager's DaemonSets and Deployments. However, this is a no-op if the StatusManager is currently marked as failing due to a configuration error.

func (*StatusManager) SetNotFailing

func (status *StatusManager) SetNotFailing(level StatusLevel)

SetNotFailing marks the operator as not Failing at the given level. If the operator status previously indicated failure at this level, it will updated to show the next higher-level failure, or else to show that the operator is no longer failing.

Jump to

Keyboard shortcuts

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