Documentation
¶
Index ¶
- func AllMachineSetTest(oc *exutil.CLI, fixture string)
- func ApplyMachineConfigurationFixture(oc *exutil.CLI, fixture string)
- func CheckMCNConditionStatus(mcn *mcfgv1.MachineConfigNode, conditionType mcfgv1.StateProgress, ...) bool
- func CleanupCreatedNode(oc *exutil.CLI, machineSetName string, desiredReplicaValue int, ...) error
- func CleanupCustomMCP(oc *exutil.CLI, clientSet *machineconfigclient.Clientset, customMCPName string, ...) error
- func CleanupProvisionedMachine(oc *exutil.CLI, machineClient *machineclient.Clientset, machineSetName string, ...) error
- func ConfirmUpdatedMCNStatus(clientSet *machineconfigclient.Clientset, mcnName string) bool
- func DegradeOnOwnerRefTest(oc *exutil.CLI, fixture string)
- func EnsureConfigMapStampTest(oc *exutil.CLI, fixture string)
- func ExecCmdOnNode(oc *exutil.CLI, node corev1.Node, subArgs ...string) string
- func ExecCmdOnNodeWithError(oc *exutil.CLI, node corev1.Node, subArgs ...string) (string, error)
- func FindClusterOperatorStatusCondition(conditions []osconfigv1.ClusterOperatorStatusCondition, ...) *osconfigv1.ClusterOperatorStatusCondition
- func GCPISTest(oc *exutil.CLI, kubeClient *kubernetes.Clientset, ...)
- func GetAllNodes(oc *exutil.CLI) ([]corev1.Node, error)
- func GetDegradedNode(oc *exutil.CLI, mcpName string) (corev1.Node, error)
- func GetMCNCondition(mcn *mcfgv1.MachineConfigNode, conditionType mcfgv1.StateProgress) *metav1.Condition
- func GetMachinesByPhase(machineClient *machineclient.Clientset, machineSetName string, ...) (machinev1beta1.Machine, error)
- func GetNewReadyNodeInMachine(oc *exutil.CLI, machineName string) (corev1.Node, error)
- func GetNodeInMachine(oc *exutil.CLI, machineName string) (corev1.Node, error)
- func GetNodesByRole(oc *exutil.CLI, role string) ([]corev1.Node, error)
- func GetRandomNode(oc *exutil.CLI, role string) corev1.Node
- func GetRolesToTest(oc *exutil.CLI, machineConfigClient *machineconfigclient.Clientset) []string
- func GetUpdatingNode(oc *exutil.CLI, mcpName, originalConfigVersion string) corev1.Node
- func IsClusterOperatorConditionFalse(conditions []osconfigv1.ClusterOperatorStatusCondition, ...) bool
- func IsClusterOperatorConditionPresentAndEqual(conditions []osconfigv1.ClusterOperatorStatusCondition, ...) bool
- func IsClusterOperatorConditionTrue(conditions []osconfigv1.ClusterOperatorStatusCondition, ...) bool
- func IsDisconnected(oc *exutil.CLI, nodeName string) bool
- func IsMachineConfigPoolConditionTrue(conditions []mcfgv1.MachineConfigPoolCondition, ...) bool
- func IsMachineConfigurationConditionFalse(conditions []metav1.Condition, conditionType string) bool
- func IsMetal(oc *exutil.CLI) bool
- func IsNodeReady(node corev1.Node) bool
- func IsSingleNode(oc *exutil.CLI) bool
- func IsTwoNode(oc *exutil.CLI) bool
- func IsTwoNodeArbiter(oc *exutil.CLI) bool
- func NoneMachineSetTest(oc *exutil.CLI, fixture string)
- func PartialMachineSetTest(oc *exutil.CLI, fixture string)
- func RecoverFromDegraded(oc *exutil.CLI, mcpName string) error
- func ScaleMachineSet(oc *exutil.CLI, machineSetName string, replicaValue string) error
- func ScaleMachineSetDown(oc *exutil.CLI, machineSet machinev1beta1.MachineSet, desiredReplicaValue int, ...) error
- func SimplePISTest(oc *exutil.CLI, kubeClient *kubernetes.Clientset, ...)
- func SkipWhenFeatureGateEnabled(configClient configv1client.Interface, featureGate osconfigv1.FeatureGateName)
- func UpdateDeleteMachineAnnotation(oc *exutil.CLI, machineSetName string) error
- func UploadTovCentreTest(oc *exutil.CLI, fixture string)
- func ValidateMCNConditionOnNodeDegrade(oc *exutil.CLI, fixture string, isSno bool)
- func ValidateMCNConditionTransitionsOnRebootlessUpdate(oc *exutil.CLI, clientSet *machineconfigclient.Clientset, ...)
- func ValidateMCNConditionTransitionsOnRebootlessUpdateMaster(oc *exutil.CLI, clientSet *machineconfigclient.Clientset, ...)
- func ValidateMCNForNodeInPool(oc *exutil.CLI, clientSet *machineconfigclient.Clientset, node corev1.Node, ...) error
- func ValidateMCNOnNodeCreationAndDeletion(oc *exutil.CLI)
- func ValidateMCNPropertiesByMCPs(oc *exutil.CLI)
- func ValidateMCNPropertiesCustomMCP(oc *exutil.CLI, fixture string)
- func ValidateMCNScopeHappyPathTest(oc *exutil.CLI)
- func ValidateMCNScopeImpersonationPathTest(oc *exutil.CLI)
- func ValidateMCNScopeSadPathTest(oc *exutil.CLI)
- func WaitForBootImageControllerToComplete(oc *exutil.CLI)
- func WaitForConfigAndPoolComplete(oc *exutil.CLI, pool, mcName string) string
- func WaitForMCNConditionStatus(clientSet *machineconfigclient.Clientset, mcnName string, ...) (bool, error)
- func WaitForMCNToBeDeleted(clientSet *machineconfigclient.Clientset, mcnName string) error
- func WaitForMCPConditionStatus(oc *exutil.CLI, mcpName string, ...) error
- func WaitForMCPToBeReady(oc *exutil.CLI, machineConfigClient *machineconfigclient.Clientset, ...)
- func WaitForMachineConfigurationStatusUpdate(oc *exutil.CLI)
- func WaitForMachineInState(machineClient *machineclient.Clientset, machineName string, ...) error
- func WaitForMachineToBeDeleted(machineClient *machineclient.Clientset, machineName string) error
- func WaitForNodeCurrentConfig(oc *exutil.CLI, nodeName string, config string)
- func WaitForNodeToBeDeleted(oc *exutil.CLI, nodeName string) error
- func WaitForOneMasterNodeToBeReady(oc *exutil.CLI) error
- func WaitForPoolComplete(oc *exutil.CLI, pool, target string) error
- func WaitForRenderedConfig(oc *exutil.CLI, pool, mcName string) (string, error)
- func WaitForRenderedConfigs(oc *exutil.CLI, pool string, mcNames ...string) (string, error)
- func WaitForValidMCNProperties(clientSet *machineconfigclient.Clientset, node corev1.Node) error
- func WorkersCanBeScaled(oc *exutil.CLI, machineClient *machineclient.Clientset) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllMachineSetTest ¶
func ApplyMachineConfigurationFixture ¶
Applies a boot image fixture and waits for the MCO to reconcile the status
func CheckMCNConditionStatus ¶
func CheckMCNConditionStatus(mcn *mcfgv1.MachineConfigNode, conditionType mcfgv1.StateProgress, status metav1.ConditionStatus) bool
`CheckMCNConditionStatus` checks that an MCN condition matches the desired status (ex. confirm "Updated" is "False")
func CleanupCreatedNode ¶
func CleanupCreatedNode(oc *exutil.CLI, machineSetName string, desiredReplicaValue int, nodeName string, cleanupCompleted bool) error
`CleanupCreatedNode` scales down the replica count for a given MachineSet and checks whether the created Node provided is deleted.
func CleanupCustomMCP ¶
func CleanupCustomMCP(oc *exutil.CLI, clientSet *machineconfigclient.Clientset, customMCPName string, nodeName string, mcName *string) error
`CleanupCustomMCP` cleans up a custom MCP through the following steps:
- Remove the custom MCP role label from the node
- Wait for the custom MCP to be updated with no ready machines
- Optionally, if a MC has been provided, delete it; if none has been provided, skip to step 4
- Wait for the node to have a current config version equal to the config version of the worker MCP
- Remove the custom MCP
func CleanupProvisionedMachine ¶
func CleanupProvisionedMachine(oc *exutil.CLI, machineClient *machineclient.Clientset, machineSetName string, desiredReplicaValue int, machineName string, cleanupCompleted bool) error
`CleanupProvisionedMachine` scales down the replica count for a given MachineSet and checks whether the provisioned Machine provided is deleted.
func ConfirmUpdatedMCNStatus ¶
func ConfirmUpdatedMCNStatus(clientSet *machineconfigclient.Clientset, mcnName string) bool
`ConfirmUpdatedMCNStatus` confirms that an MCN is in a fully updated state, which requires:
- "Updated" = True
- All other conditions = False
func DegradeOnOwnerRefTest ¶
func ExecCmdOnNode ¶
ExecCmdOnNode finds a node's mcd, and oc rsh's into it to execute a command on the node all commands should use /rootfs as root
func ExecCmdOnNodeWithError ¶
ExecCmdOnNodeWithError behaves like ExecCmdOnNode, with the exception that any errors are returned to the caller for inspection. This allows one to execute a command that is expected to fail; e.g., stat /nonexistant/file.
func FindClusterOperatorStatusCondition ¶
func FindClusterOperatorStatusCondition(conditions []osconfigv1.ClusterOperatorStatusCondition, conditionType osconfigv1.ClusterStatusConditionType) *osconfigv1.ClusterOperatorStatusCondition
FindClusterOperatorStatusCondition finds the conditionType in conditions.
func GCPISTest ¶
func GCPISTest(oc *exutil.CLI, kubeClient *kubernetes.Clientset, clientSet *mcClient.Clientset, success bool, nodeName, customGcKCFixture, gcImage, pisName string, isMetalDisconnected bool)
`GCPISTest` completes the body of a PIS test including the garbage collection step
func GetAllNodes ¶
`GetAllNodes` gets all nodes from a cluster
func GetDegradedNode ¶
`GetDegradedNode` gets a degraded node from a specified MCP
func GetMCNCondition ¶
func GetMCNCondition(mcn *mcfgv1.MachineConfigNode, conditionType mcfgv1.StateProgress) *metav1.Condition
`GetMCNCondition` returns the queried condition or nil if the condition does not exist
func GetMachinesByPhase ¶
func GetMachinesByPhase(machineClient *machineclient.Clientset, machineSetName string, desiredPhase string) (machinev1beta1.Machine, error)
`GetMachinesByPhase` get machine by phase e.g. Running, Provisioning, Provisioned, Deleting etc.
func GetNewReadyNodeInMachine ¶
`GetNewReadyNodeInMachine` waits up to 4 minutes for the newly provisioned node in a desired machine node to be ready
func GetNodeInMachine ¶
`GetNodeInMachine` gets the node associated with a machine
func GetNodesByRole ¶
`GetNodesByRole` gets all nodes labeled with the desired role
func GetRandomNode ¶
`GetRandomNode` gets a random node from with a given role and checks whether the node is ready. If no nodes are ready, it will wait for up to 5 minutes for a node to become available.
func GetRolesToTest ¶
func GetRolesToTest(oc *exutil.CLI, machineConfigClient *machineconfigclient.Clientset) []string
`GetRolesToTest` gets the MCPs in a cluster with nodes associated to it. This allows a more robust way to determine the roles to use when selecting nodes and testing their MCP associations in an MCN.
func GetUpdatingNode ¶
`GetUpdatingNode` returns the updating node, determined by the node targetting a new desired config, when the corresponding MCP starts updating
func IsClusterOperatorConditionFalse ¶
func IsClusterOperatorConditionFalse(conditions []osconfigv1.ClusterOperatorStatusCondition, conditionType osconfigv1.ClusterStatusConditionType) bool
IsClusterOperatorConditionFalse returns true when the conditionType is present and set to `configv1.ConditionFalse`
func IsClusterOperatorConditionPresentAndEqual ¶
func IsClusterOperatorConditionPresentAndEqual(conditions []osconfigv1.ClusterOperatorStatusCondition, conditionType osconfigv1.ClusterStatusConditionType, status osconfigv1.ConditionStatus) bool
IsClusterOperatorConditionPresentAndEqual returns true when conditionType is present and equal to status.
func IsClusterOperatorConditionTrue ¶
func IsClusterOperatorConditionTrue(conditions []osconfigv1.ClusterOperatorStatusCondition, conditionType osconfigv1.ClusterStatusConditionType) bool
IsClusterOperatorConditionTrue returns true when the conditionType is present and set to `configv1.ConditionTrue`
func IsDisconnected ¶
`IsDisconnected` returns true if the cluster is a Disconnected cluster and false otherwise
func IsMachineConfigPoolConditionTrue ¶
func IsMachineConfigPoolConditionTrue(conditions []mcfgv1.MachineConfigPoolCondition, conditionType mcfgv1.MachineConfigPoolConditionType) bool
IsMachineConfigPoolConditionTrue returns true when the conditionType is present and set to `ConditionTrue`
func IsMachineConfigurationConditionFalse ¶
IsMachineConfigurationConditionFalse returns false when the conditionType is present and set to `ConditionFalse`
func IsMetal ¶
`IsMetal` returns true if the cluster is hosted on a Metal Platform and false otherwise
func IsNodeReady ¶
`isNodeReady` determines if a given node is ready
func IsSingleNode ¶
`IsSingleNode` returns true if the cluster is using single-node topology and false otherwise
func IsTwoNode ¶
`IsTwoNode` returns true if the cluster is using two-node topology and false otherwise
func IsTwoNodeArbiter ¶
`IsTwoNodeArbiter` returns true if the cluster is using two-node arbiter topology and false otherwise
func NoneMachineSetTest ¶
func PartialMachineSetTest ¶
func RecoverFromDegraded ¶
`RecoverFromDegraded` gets the degraded node in the desired MCP, forces the node to recover by updating its desired config to be its current config, and waits for the MCP to return to an Update=True state
func ScaleMachineSet ¶
`ScaleMachineSet` scales the provided MachineSet by updating the replica to be the provided value
func ScaleMachineSetDown ¶
func ScaleMachineSetDown(oc *exutil.CLI, machineSet machinev1beta1.MachineSet, desiredReplicaValue int, cleanupCompleted bool) error
`ScaleMachineSetDown` will determine whether a MachineSet needs to be scaled and, if so, will scale it. A MachineSet needs to be scaled if its desired replica value does not match its current replica value.
func SimplePISTest ¶
func SimplePISTest(oc *exutil.CLI, kubeClient *kubernetes.Clientset, clientSet *mcClient.Clientset, success bool, pisName string, isMetalDisconnected bool)
`GCPISTest` completes the body of a PIS test, validating that the conditions are met for cases where the PIS was expected to be successful and cases where the PIS applied was invalid
func SkipWhenFeatureGateEnabled ¶
func SkipWhenFeatureGateEnabled(configClient configv1client.Interface, featureGate osconfigv1.FeatureGateName)
`SkipWhenFeatureGateEnabled` skips a test if the desired feature gate provided as a parameter is enabled in the test cluster.
func UpdateDeleteMachineAnnotation ¶
`UpdateDeleteMachineAnnotation` updates the provided MachineSet's `deletePolicy` to be true. This will ensure the create machine is the one deleted on cleanup.
func UploadTovCentreTest ¶
func ValidateMCNConditionOnNodeDegrade ¶
`ValidateMCNConditionOnNodeDegrade` checks that Conditions properly update on a node failure (MCP degrade)
func ValidateMCNConditionTransitionsOnRebootlessUpdate ¶
func ValidateMCNConditionTransitionsOnRebootlessUpdate(oc *exutil.CLI, clientSet *machineconfigclient.Clientset, nodeDisruptionFixture string, nodeDisruptionEmptyFixture string, mcFixture string, mcpFixture string)
`ValidateMCNConditionTransitionsOnRebootlessUpdate` checks that the `Conditions` in an MCN properly update on a node update in a custom MCP. The steps of this function are:
- Apply a node disruption policy
- Create a custom MCP with one node
- Apply a MC
- Validate the MCN conditions transition as expected throughout the update
- Clean up the test resources
func ValidateMCNConditionTransitionsOnRebootlessUpdateMaster ¶
func ValidateMCNConditionTransitionsOnRebootlessUpdateMaster(oc *exutil.CLI, clientSet *machineconfigclient.Clientset, nodeDisruptionFixture string, nodeDisruptionEmptyFixture string, mcFixture string)
`ValidateMCNConditionTransitionsOnRebootlessUpdateMaster` checks that the `Conditions` in an MCN properly update on a node update in the master MCP. The steps of this function are:
- Apply a node disruption policy
- Apply a MC
- Get the updating node
- Validate the MCN conditions transition as expected throughout the update
- Clean up the test resources
func ValidateMCNForNodeInPool ¶
func ValidateMCNForNodeInPool(oc *exutil.CLI, clientSet *machineconfigclient.Clientset, node corev1.Node, poolName string) error
`ValidateMCNForNodeInPool` validates the MCN of a node in a given pool. It does the following:
- Get node from desired pool
- Get the MCN for the node
- Validate the MCN against the node properties - Check that `mcn.Spec.Pool.Name` matches provided `poolName` - Check that `mcn.Name` matches the node name - Check that `mcn.Spec.ConfigVersion.Desired` matches the node desired config version - Check that `nmcn.Status.ConfigVersion.Current` matches the node current config version - Check that `mcn.Status.ConfigVersion.Desired` matches the node desired config version
func ValidateMCNOnNodeCreationAndDeletion ¶
`ValidateMCNProperties` checks that MCNs with correct properties are created on node creation and deleted on node deletion
func ValidateMCNPropertiesByMCPs ¶
`ValidateMCNPropertiesByMCPs` checks that MCN properties match the corresponding node properties for a random node in each MCP in the cluster with nodes.
func ValidateMCNPropertiesCustomMCP ¶
`ValidateMCNPropertiesCustomMCP` checks that MCN properties match the corresponding node properties
func ValidateMCNScopeHappyPathTest ¶
`ValidateMCNScopeHappyPathTest` checks that MCN updates from the associated MCD are allowed
func ValidateMCNScopeImpersonationPathTest ¶
`ValidateMCNScopeImpersonationPathTest` checks that MCN updates by impersonation of the MCD SA are blocked
func ValidateMCNScopeSadPathTest ¶
`ValidateMCNScopeSadPathTest` checks that MCN updates from a MCD that is not the associated one are blocked. This test skips on SNO clusters.
func WaitForBootImageControllerToComplete ¶
WaitForBootImageControllerToComplete waits until the boot image controller is no longer progressing
func WaitForConfigAndPoolComplete ¶
WaitForConfigAndPoolComplete is a helper function that gets a renderedConfig and waits for its pool to complete. The return value is the final rendered config.
func WaitForMCNConditionStatus ¶
func WaitForMCNConditionStatus(clientSet *machineconfigclient.Clientset, mcnName string, conditionType mcfgv1.StateProgress, status metav1.ConditionStatus, timeout time.Duration, interval time.Duration) (bool, error)
`WaitForMCNConditionStatus` waits up to a specified timeout for the desired MCN condition to match the desired status (ex. wait until "Updated" is "False"). If the desired condition is "Unknown," the function will also return true if the condition is "True," which ensures that we do not fail when an update progresses quickly through the intermediary "Unknown" phase.
func WaitForMCNToBeDeleted ¶
func WaitForMCNToBeDeleted(clientSet *machineconfigclient.Clientset, mcnName string) error
`WaitForMCNToBeDeleted` up waits to 4 minutes for a MCN to be deleted (no longer exist)
func WaitForMCPConditionStatus ¶
func WaitForMCPConditionStatus(oc *exutil.CLI, mcpName string, conditionType mcfgv1.MachineConfigPoolConditionType, status corev1.ConditionStatus, timeout time.Duration, interval time.Duration) error
`WaitForMCPConditionStatus` waits up to the desired timeout for the desired MCP condition to match the desired status (ex. wait until "Updating" is "True")
func WaitForMCPToBeReady ¶
func WaitForMCPToBeReady(oc *exutil.CLI, machineConfigClient *machineconfigclient.Clientset, poolName string, readyMachineCount int32)
`WaitForMCPToBeReady` waits up to 5 minutes for a pool to be in an updated state with a specified number of ready machines
func WaitForMachineConfigurationStatusUpdate ¶
WaitForMachineConfigurationStatus waits until the MCO syncs the operator status to the latest spec
func WaitForMachineInState ¶
func WaitForMachineInState(machineClient *machineclient.Clientset, machineName string, desiredPhase string) error
`WaitForMachineInState` waits up to 7 minutes for the desired machine to be in the desired state
func WaitForMachineToBeDeleted ¶
func WaitForMachineToBeDeleted(machineClient *machineclient.Clientset, machineName string) error
`WaitForMachineToBeDeleted` waits up to 10 minutes for a machine to be deleted (no longer exist)
func WaitForNodeCurrentConfig ¶
`WaitForNodeCurrentConfig` waits up to 5 minutes for a input node to have a current config equal to the `config` parameter
func WaitForNodeToBeDeleted ¶
`WaitForNodeToBeDeleted` waits up to 10 minutes for a node to be deleted (no longer exist)
func WaitForOneMasterNodeToBeReady ¶
WaitForOneMasterNodeToBeReady waits until atleast one master node has completed an update
func WaitForPoolComplete ¶
WaitForPoolComplete polls a pool until it has completed an update to target
func WaitForRenderedConfig ¶
WaitForRenderedConfig polls a MachineConfigPool until it has included the given mcName in its config, and returns the new rendered config name.
func WaitForRenderedConfigs ¶
WaitForRenderedConfigs polls a MachineConfigPool until it has included the given mcNames in its config, and returns the new rendered config name.
func WaitForValidMCNProperties ¶
func WaitForValidMCNProperties(clientSet *machineconfigclient.Clientset, node corev1.Node) error
`WaitForValidMCNProperties` waits for the MCN of a node to be valid. To be valid, the following must be true:
- MCN with name equivalent to node name exists (waits up to 20 sec)
- Pool name in MCN spec matches node MCP association (waits up to 1 min)
- Desired config version of node matches desired config version in MCN spec (waits up to 1 min)
- Current config version of node matches current config version in MCN status (waits up to 2 min)
- Desired config version of node matches desired config version in MCN status (waits up to 1 min)
func WorkersCanBeScaled ¶
`WorkersCanBeScaled` checks whether the worker nodes in a cluster can be scaled. Cases where scaling worker nodes is NOT possible include:
- Baremetal platform
- MachineAPI is disabled
- Error getting list of MachineSets / no MachineSets exist
- All MachineSets have 0 worker nodes
Types ¶
This section is empty.