Documentation
¶
Index ¶
- Constants
- func CalculateEventTimeDiff(startEvent, endEvent *corev1.Event) time.Duration
- func CheckNetNsCleaned(oc *exutil.CLI, nodeName, netNsPath string) error
- func ExecOnNodeWithChroot(oc *exutil.CLI, nodeName string, cmd ...string) (string, error)
- func ExecOnNodeWithNsenter(oc *exutil.CLI, nodeName string, cmd ...string) (string, error)
- func GetFirstReadyWorkerNode(oc *exutil.CLI) string
- func GetPodNetNs(oc *exutil.CLI, nodeName, podName string) (string, error)
- func WaitMCPAllowDegraded() func(*waitMCPOptions)
- func WaitMCPWithMachineCount(count int32) func(*waitMCPOptions)
Constants ¶
const (
// DebugNamespace is the namespace for debug pods
DebugNamespace = "openshift-machine-config-operator"
)
Variables ¶
This section is empty.
Functions ¶
func CalculateEventTimeDiff ¶
CalculateEventTimeDiff calculates the time difference between two Kubernetes events. It uses LastTimestamp for both events to handle repeated events correctly. For repeated events (like container restarts), Kubernetes reuses the event object and updates LastTimestamp while keeping FirstTimestamp at the original occurrence. Falls back to FirstTimestamp if LastTimestamp is zero.
func CheckNetNsCleaned ¶
CheckNetNsCleaned verifies that the network namespace file has been cleaned up. It checks if the NetNS path no longer exists on the node. Returns nil if the file is cleaned, error if it still exists.
func ExecOnNodeWithChroot ¶
ExecOnNodeWithChroot runs a command on a node using oc debug with chroot /host
func ExecOnNodeWithNsenter ¶
ExecOnNodeWithNsenter runs a command on a node using nsenter to access host namespaces This is needed for swap operations (swapon/swapoff) that require direct namespace access
func GetFirstReadyWorkerNode ¶
GetFirstReadyWorkerNode returns the name of the first Ready worker node in the cluster.
func GetPodNetNs ¶
GetPodNetNs retrieves the network namespace path for a pod using crictl. It uses crictl to get the sandbox ID and then inspects it to extract the NetNS path. Returns the NetNS path and an error if not found.
func WaitMCPAllowDegraded ¶
func WaitMCPAllowDegraded() func(*waitMCPOptions)
WaitMCPAllowDegraded tolerates transient Degraded/RenderDegraded during polling instead of failing immediately. The pool must still become fully healthy (!degraded, !renderDegraded, updated, all machines ready) before this wait succeeds.
func WaitMCPWithMachineCount ¶
func WaitMCPWithMachineCount(count int32) func(*waitMCPOptions)
WaitMCPWithMachineCount waits until the pool has the exact machine count.
Types ¶
This section is empty.