Documentation
¶
Index ¶
- Constants
- type ClusteredName
- type DaemonSetLister
- type DeploymentLister
- type MachineConfigPoolWatcher
- type MachineConfigWatcher
- type PodWatcher
- type StatefulSetLister
- type StatusLevel
- type StatusManager
- func (s *StatusManager) AddMachineConfigWatchers(mgr manager.Manager) error
- func (s *StatusManager) AddPodWatcher(mgr manager.Manager) error
- func (status *StatusManager) CheckCrashLoopBackOffPods(name ClusteredName, selector map[string]string, kind string) []string
- func (status *StatusManager) SetDegraded(statusLevel StatusLevel, reason, message string)
- func (status *StatusManager) SetDegradedOnPanicAndCrash(panicVal interface{})
- func (status *StatusManager) SetFromMachineConfigPool(mcPools []mcfgv1.MachineConfigPool) error
- func (status *StatusManager) SetFromPods()
- func (status *StatusManager) SetMachineConfigs(ctx context.Context, newRenderedMachineConfigs []mcfgv1.MachineConfig) error
- func (status *StatusManager) SetNotDegraded(statusLevel StatusLevel)
- func (status *StatusManager) SetProgressing(statusLevel StatusLevel, reason, message string)
- func (status *StatusManager) SetRelatedClusterObjects(relatedObjects []hypershift.RelatedObject)
- func (status *StatusManager) SetRelatedObjects(relatedObjects []configv1.ObjectReference)
- func (status *StatusManager) UnsetProgressing(statusLevel StatusLevel)
Constants ¶
const (
ClusteredNameSeparator = '/'
)
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 ¶
func NewClusteredName ¶
func NewClusteredName(obj crclient.Object) ClusteredName
func (ClusteredName) String ¶
func (c ClusteredName) String() string
type DaemonSetLister ¶
type DeploymentLister ¶
type DeploymentLister interface {
List(selector labels.Selector) (ret []*appsv1.Deployment, err error)
}
type MachineConfigPoolWatcher ¶
type MachineConfigPoolWatcher struct {
// contains filtered or unexported fields
}
type MachineConfigWatcher ¶
type MachineConfigWatcher struct {
// contains filtered or unexported fields
}
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.
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 ¶
StatusManager coordinates changes to ClusterOperator.Status
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)