Documentation
¶
Index ¶
- Constants
- func ApplyContainerRuntimeConfigAndWaitForMCP(ctx context.Context, mcClient *machineconfigclient.Clientset, ...) error
- func ApplyKubeletConfigAndWaitForMCP(ctx context.Context, mcClient *machineconfigclient.Clientset, ...) error
- func CalculateEventTimeDiff(startEvent, endEvent *corev1.Event) time.Duration
- func CheckNetNsCleaned(ctx context.Context, oc *exutil.CLI, nodeName, netNsPath string) error
- func CleanupContainerRuntimeConfig(ctx context.Context, mcClient *machineconfigclient.Clientset, ...) error
- func CleanupCustomMCP(ctx context.Context, config *CustomMCPConfig) error
- func CleanupKubeletConfig(ctx context.Context, mcClient *machineconfigclient.Clientset, ...) error
- func CreateContainerRuntimeConfig(ctx context.Context, mcClient *machineconfigclient.Clientset, ...) (*machineconfigv1.ContainerRuntimeConfig, error)
- func CreateKubeletConfig(ctx context.Context, mcClient *machineconfigclient.Clientset, ...) (*machineconfigv1.KubeletConfig, error)
- func CreateOrUpdateKubeletConfig(ctx context.Context, mcClient *machineconfigclient.Clientset, ...) (*machineconfigv1.KubeletConfig, error)
- func CreatePodAndWaitForRunning(ctx context.Context, oc *exutil.CLI, pod *corev1.Pod) *corev1.Pod
- func EnsureNodeHasNoCustomRole(ctx context.Context, oc *exutil.CLI, nodeName string) error
- func EnsureNodesReady(ctx context.Context, oc *exutil.CLI)
- func ExecOnNodeWithChroot(ctx context.Context, oc *exutil.CLI, nodeName string, cmd ...string) (string, error)
- func ExecOnNodeWithNsenter(ctx context.Context, oc *exutil.CLI, nodeName string, cmd ...string) (string, error)
- func GetFirstReadyWorkerNode(oc *exutil.CLI) string
- func GetNotReadyNodes(ctx context.Context, oc *exutil.CLI) ([]string, error)
- func GetPodNetNs(ctx context.Context, oc *exutil.CLI, nodeName, podName string) (string, error)
- func IsAdditionalStorageConfigEnabled(ctx context.Context, oc *exutil.CLI) (bool, string)
- func NodeHasCustomRole(node corev1.Node) (string, bool)
- func SkipOnMicroShift(oc *exutil.CLI)
- func WaitForMCP(ctx context.Context, mcClient *machineconfigclient.Clientset, poolName string, ...) error
- func WaitForMCPUpdating(ctx context.Context, mcClient *machineconfigclient.Clientset, mcpName string, ...) error
- func WaitMCPAllowDegraded() func(*waitMCPOptions)
- func WaitMCPWithMachineCount(count int32) func(*waitMCPOptions)
- type CustomMCPConfig
Constants ¶
const (
// DebugNamespace is the namespace for debug pods
DebugNamespace = "openshift-machine-config-operator"
)
Variables ¶
This section is empty.
Functions ¶
func ApplyContainerRuntimeConfigAndWaitForMCP ¶
func ApplyContainerRuntimeConfigAndWaitForMCP(ctx context.Context, mcClient *machineconfigclient.Clientset, ctrcfg *machineconfigv1.ContainerRuntimeConfig, mcpName string, rolloutTimeout time.Duration) error
ApplyContainerRuntimeConfigAndWaitForMCP creates a ContainerRuntimeConfig and waits for the MCP rollout to complete.
func ApplyKubeletConfigAndWaitForMCP ¶
func ApplyKubeletConfigAndWaitForMCP(ctx context.Context, mcClient *machineconfigclient.Clientset, kubeletConfig *machineconfigv1.KubeletConfig, mcpName string, rolloutTimeout time.Duration) error
ApplyKubeletConfigAndWaitForMCP creates a KubeletConfig and waits for the MCP rollout to complete.
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 CleanupContainerRuntimeConfig ¶
func CleanupContainerRuntimeConfig(ctx context.Context, mcClient *machineconfigclient.Clientset, ctrcfgName, mcpName string) error
CleanupContainerRuntimeConfig deletes a ContainerRuntimeConfig. If mcpName is non-empty, waits for that MCP to stabilize.
func CleanupCustomMCP ¶
func CleanupCustomMCP(ctx context.Context, config *CustomMCPConfig) error
CleanupCustomMCP removes the node label, deletes the custom MCP, and waits for the worker MCP to stabilize.
func CleanupKubeletConfig ¶
func CleanupKubeletConfig(ctx context.Context, mcClient *machineconfigclient.Clientset, kcName, mcpName string) error
CleanupKubeletConfig deletes a KubeletConfig. If mcpName is non-empty, waits for that MCP to stabilize.
func CreateContainerRuntimeConfig ¶
func CreateContainerRuntimeConfig(ctx context.Context, mcClient *machineconfigclient.Clientset, ctrcfg *machineconfigv1.ContainerRuntimeConfig) (*machineconfigv1.ContainerRuntimeConfig, error)
CreateContainerRuntimeConfig creates a ContainerRuntimeConfig resource.
func CreateKubeletConfig ¶
func CreateKubeletConfig(ctx context.Context, mcClient *machineconfigclient.Clientset, kubeletConfig *machineconfigv1.KubeletConfig) (*machineconfigv1.KubeletConfig, error)
CreateKubeletConfig creates a KubeletConfig resource.
func CreateOrUpdateKubeletConfig ¶
func CreateOrUpdateKubeletConfig(ctx context.Context, mcClient *machineconfigclient.Clientset, kubeletConfig *machineconfigv1.KubeletConfig) (*machineconfigv1.KubeletConfig, error)
CreateOrUpdateKubeletConfig creates a KubeletConfig or updates it if it already exists.
func ExecOnNodeWithChroot ¶
func ExecOnNodeWithNsenter ¶
func GetFirstReadyWorkerNode ¶
GetFirstReadyWorkerNode returns the name of the first Ready worker node in the cluster.
func GetNotReadyNodes ¶
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 IsAdditionalStorageConfigEnabled ¶
IsAdditionalStorageConfigEnabled checks whether the AdditionalStorageConfig feature gate is enabled on the cluster and the platform is supported. Returns false with a reason string if the test should be skipped.
func SkipOnMicroShift ¶
SkipOnMicroShift skips the current test if the cluster is MicroShift.
func WaitForMCP ¶
func WaitForMCP(ctx context.Context, mcClient *machineconfigclient.Clientset, poolName string, timeout time.Duration, opts ...func(*waitMCPOptions)) error
WaitForMCP waits for a MachineConfigPool to be ready (not updating, updated, and all machines ready). By default it returns an error immediately if the MCP becomes degraded.
func WaitForMCPUpdating ¶
func WaitForMCPUpdating(ctx context.Context, mcClient *machineconfigclient.Clientset, mcpName string, timeout time.Duration) error
WaitForMCPUpdating waits for an MCP to enter the "Updating" state.
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 ¶
type CustomMCPConfig ¶
type CustomMCPConfig struct {
Name string
NodeName string
MCClient *machineconfigclient.Clientset
KubeClient *exutil.CLI
}
CustomMCPConfig holds state needed to clean up a custom MCP created by CreateCustomMCPForNode.
func CreateCustomMCPForNode ¶
func CreateCustomMCPForNode(ctx context.Context, oc *exutil.CLI, mcClient *machineconfigclient.Clientset, mcpName, nodeName string) (*CustomMCPConfig, error)
CreateCustomMCPForNode labels a node and creates a custom MCP targeting it.
Source Files
¶
- additional_storage_api.go
- additional_storage_e2e.go
- crio_goroutinedump.go
- criocredentialprovider.go
- dra.go
- image_volume.go
- kubelet_secret_pulled_images.go
- kubeletconfig_features.go
- kubeletconfig_tls.go
- nested_container.go
- node_kc_cc_helpers.go
- node_mcp_helpers.go
- node_sizing.go
- node_swap.go
- node_swap_cnv.go
- node_utils.go
- runc_upgrade_cases.go
- system_compressible.go
- zstd_chunked.go