statusmanager

package
v0.0.0-...-a3935d6 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2025 License: Apache-2.0 Imports: 51 Imported by: 4

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 MachineConfigPoolWatcher

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

func (*MachineConfigPoolWatcher) Reconcile

Reconcile triggers a re-update of Status.

type MachineConfigWatcher

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

func (*MachineConfigWatcher) Reconcile

Reconcile triggers a re-update of Status.

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
	MachineConfig
	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) AddMachineConfigWatchers

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

AddMachineConfigWatchers wires up the MachineConfigWatcher and MachineConfigPoolWatcher to the controller-manager.

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) SetFromMachineConfigPool

func (status *StatusManager) SetFromMachineConfigPool(mcPools []mcfgv1.MachineConfigPool) error

SetFromMachineConfigPool reconcile loop being executed when CNO rendering pipeline renders a new machine config and reconcile of MachineConfig and MachineConfigPool events. 1. For a newly rendered machine config on particular role, Ensure appropriate machine config pools are updated with the machine config. 2. When machine config is removed for a particular role, Ensure machine config are removed from the appropriate machine config pools. While checking (1) and (2), If any one of those machine config pool is in progressing or degraded state, reflect that into network status. Note that when machine config is removed, nodes are rebooted, network operator pod recreated on a different node, CNO rendering pipeline is no longer nothing to do with that deleted machine config earlier, so cache in the status manager are rebuilt from annotation cache, so delete machine config entry from annotation cache when machine config is actually removed from machine config pool(s). This makes the status manager cache always up to date.

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) SetMachineConfigs

func (status *StatusManager) SetMachineConfigs(ctx context.Context, newRenderedMachineConfigs []mcfgv1.MachineConfig) error

SetMachineConfigs takes up newly rendered machine configs and updates status manager and annotation caches accordingly. It also invokes SetFromMachineConfigPool function to update network status for newly rendered (or) removed machine configs.

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