statusmanager

package
v0.0.0-...-7604c18 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClusteredNameSeparator = '/'
)
View Source
const (
	// if a rollout has not made any progress by this time,
	// mark ourselves as Degraded
	ProgressTimeout = 10 * time.Minute
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusteredName

type ClusteredName struct {
	ClusterName string
	Namespace   string
	Name        string
}

func NewClusteredName

func NewClusteredName(obj crclient.Object) ClusteredName

func (ClusteredName) String

func (c ClusteredName) String() string

type DaemonSetLister

type DaemonSetLister interface {
	List(selector labels.Selector) (ret []*appsv1.DaemonSet, err error)
}

type DeploymentLister

type DeploymentLister interface {
	List(selector labels.Selector) (ret []*appsv1.Deployment, err error)
}

type PodWatcher

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

PodWatcher is a controller adjacent to the StatusManager that triggers a re-reconcile whenever an "interesting" daemonset, deployment, or statefulset is created / updated. Specifically, it watches for objects with the label "networkoperator.openshift.io/generates-operator-status" set.

func (*PodWatcher) Reconcile

func (p *PodWatcher) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error)

Reconcile triggers a re-update of Status.

type StatefulSetLister

type StatefulSetLister interface {
	List(selector labels.Selector) (ret []*appsv1.StatefulSet, err error)
}

type StatusLevel

type StatusLevel int
const (
	PanicLevel StatusLevel = iota // Special StatusLevel used when recovering from a panic
	ClusterConfig
	OperatorConfig
	OperatorRender
	ProxyConfig
	InjectorConfig
	PodDeployment
	PKIConfig
	EgressRouterConfig
	RolloutHung
	CertificateSigner
	InfrastructureConfig
	DashboardConfig
)

type StatusManager

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

StatusManager coordinates changes to ClusterOperator.Status

func New

func New(client cnoclient.Client, name, cluster string) *StatusManager

func (*StatusManager) AddPodWatcher

func (s *StatusManager) AddPodWatcher(mgr manager.Manager) error

AddPodWatcher wires up the PodWatcher to the controller-manager.

func (*StatusManager) CheckCrashLoopBackOffPods

func (status *StatusManager) CheckCrashLoopBackOffPods(name ClusteredName, selector map[string]string, kind string) []string

CheckCrashLoopBackOffPods checks for pods (matching the label selector) with any containers in the CrashLoopBackoff state. It returns a human-readable string for any pod in such a state. name should be the name of a DaemonSet or Deployment or StatefulSet.

func (*StatusManager) SetDegraded

func (status *StatusManager) SetDegraded(statusLevel StatusLevel, reason, message string)

func (*StatusManager) SetDegradedOnPanicAndCrash

func (status *StatusManager) SetDegradedOnPanicAndCrash(panicVal interface{})

func (*StatusManager) SetFromPods

func (status *StatusManager) SetFromPods()

SetFromPods sets the operator Degraded/Progressing/Available status, based on the current status of the manager's DaemonSets, Deployments and StatefulSets.

func (*StatusManager) SetNotDegraded

func (status *StatusManager) SetNotDegraded(statusLevel StatusLevel)

func (*StatusManager) SetProgressing

func (status *StatusManager) SetProgressing(statusLevel StatusLevel, reason, message string)

func (*StatusManager) SetRelatedClusterObjects

func (status *StatusManager) SetRelatedClusterObjects(relatedObjects []hypershift.RelatedObject)

func (*StatusManager) SetRelatedObjects

func (status *StatusManager) SetRelatedObjects(relatedObjects []configv1.ObjectReference)

func (*StatusManager) UnsetProgressing

func (status *StatusManager) UnsetProgressing(statusLevel StatusLevel)

Jump to

Keyboard shortcuts

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