Documentation ¶
Index ¶
- Constants
- func ExecAndLogCommand(name string, args ...string) (bytes.Buffer, bytes.Buffer, error)
- func ExecCmdInPod(pod *corev1.Pod, cmd ...string) (string, error)
- func ExecCmdInPodNamespace(podNamespace, podName string, cmd ...string) (string, error)
- func GetClusterControlPlaneTopology(cs *framework.ClientSet) (configv1.TopologyMode, error)
- func GetClusterNodes(cs *framework.ClientSet) (int, error)
- func GetCurrentDirPath() (string, error)
- func GetDefaultWorkerProfile(node *corev1.Node) string
- func GetMachineConfigDaemonForNode(cs *framework.ClientSet, node *corev1.Node) (*corev1.Pod, error)
- func GetNodeTuningOperatorPod(cs *framework.ClientSet) (*corev1.Pod, error)
- func GetNodesByRole(cs *framework.ClientSet, role string) ([]corev1.Node, error)
- func GetTunedForNode(cs *framework.ClientSet, node *corev1.Node) (*corev1.Pod, error)
- func GetUpdatedMachineCountForPool(cs *framework.ClientSet, pool string) (int32, error)
- func LoadTuned(path string) (*tunedv1.Tuned, error)
- func Logf(format string, args ...interface{}) (n int, err error)
- func WaitForClusterOperatorConditionReason(cs *framework.ClientSet, interval, duration time.Duration, ...) error
- func WaitForClusterOperatorConditionStatus(cs *framework.ClientSet, interval, duration time.Duration, ...) error
- func WaitForCmdInPod(interval, duration time.Duration, pod *corev1.Pod, cmd ...string) (string, error)
- func WaitForCmdOutputInPod(interval, duration time.Duration, pod *corev1.Pod, valExp string, trim bool, ...) (string, error)
- func WaitForPoolMachineCount(cs *framework.ClientSet, pool string, count int32) error
- func WaitForPoolUpdatedMachineCount(cs *framework.ClientSet, pool string, count int32) error
- func WaitForProfileConditionStatus(cs *framework.ClientSet, interval, duration time.Duration, profile string, ...) error
- func WaitForSysctlInPod(interval, duration time.Duration, pod *corev1.Pod, sysctlVar string) (string, error)
- func WaitForSysctlValueInPod(interval, duration time.Duration, pod *corev1.Pod, sysctlVar string, ...) (string, error)
- type VerificationData
Constants ¶
const ( // The default master profile. See: assets/tuned/manifests/default-cr-tuned.yaml DefaultMasterProfile = "openshift-control-plane" // The default worker profile. See: assets/tuned/manifests/default-cr-tuned.yaml DefaultWorkerProfile = "openshift-node" )
const ( VerificationCommandAnnotation = "verificationCommand" VerificationOutputAnnotation = "verificationOutput" )
Variables ¶
This section is empty.
Functions ¶
func ExecAndLogCommand ¶
ExecAndLogCommand executes command 'name' with arguments 'args' and logs the output. Returns captured standard output, standard error and the error returned.
func ExecCmdInPod ¶
ExecCmdInPod executes command with arguments 'cmd' in Pod 'pod'.
func ExecCmdInPodNamespace ¶
ExecCmdInPodNamespace executes command with arguments 'cmd' in Pod 'podNamespace/podName'.
func GetClusterControlPlaneTopology ¶
func GetClusterControlPlaneTopology(cs *framework.ClientSet) (configv1.TopologyMode, error)
GetClusterControlPlaneTopology returns infrastructures/cluster objects's ControlPlaneTopology status field and an error if any. It is HighlyAvailable on regular clusters, SingleReplica on SNO and External on HyperShift.
func GetClusterNodes ¶
GetClusterNodes returns the number of cluster nodes and an error if any.
func GetCurrentDirPath ¶
func GetDefaultWorkerProfile ¶
GetDefaultWorkerProfile returns name of the default out-of-the-box TuneD profile for a node. See: assets/tuned/manifests/default-cr-tuned.yaml
func GetMachineConfigDaemonForNode ¶
GetMachineConfigDaemonForNode returns the machine-config-daemon pod that runs on the specified node
func GetNodeTuningOperatorPod ¶
GetNodeTuningOperator returns the node tuning operator Pod. If more than one operator Pod is running will return the first Pod found.
func GetNodesByRole ¶
GetNodesByRole returns a list of nodes that match a given role.
func GetTunedForNode ¶
GetTunedForNode returns a Pod that runs on a given node.
func GetUpdatedMachineCountForPool ¶
GetUpdatedMachineCountForPool returns the UpdatedMachineCount for MCP 'pool'.
func Logf ¶
Logf formats using the default formats for its operands and writes to ginkgo.GinkgoWriter and a newline is appended. It returns the number of bytes written and any write error encountered.
func WaitForClusterOperatorConditionReason ¶
func WaitForClusterOperatorConditionReason(cs *framework.ClientSet, interval, duration time.Duration, conditionType configv1.ClusterStatusConditionType, conditionReason string) error
WaitForClusterOperatorConditionReason blocks until the NTO ClusterOperator condition 'conditionType' Reason is equal to the value of 'conditionReason'. The execution interval to check the value is 'interval' and retries last for at most the duration 'duration'.
func WaitForClusterOperatorConditionStatus ¶
func WaitForClusterOperatorConditionStatus(cs *framework.ClientSet, interval, duration time.Duration, conditionType configv1.ClusterStatusConditionType, conditionStatus configv1.ConditionStatus) error
WaitForClusterOperatorConditionStatus blocks until the NTO ClusterOperator condition 'conditionType' Status is equal to the value of 'conditionStatus'. The execution interval to check the value is 'interval' and retries last for at most the duration 'duration'.
func WaitForCmdInPod ¶
func WaitForCmdInPod(interval, duration time.Duration, pod *corev1.Pod, cmd ...string) (string, error)
WaitForCmdInPod runs command with arguments 'cmd' in Pod 'pod' at an interval 'interval' and retries for at most the duration 'duration'. The function returns the retrieved value of standard output of the command at its first successful ('error' == nil) execution and an error set in case the command did not run successfully by the time duration 'duration' elapsed.
func WaitForCmdOutputInPod ¶
func WaitForCmdOutputInPod(interval, duration time.Duration, pod *corev1.Pod, valExp string, trim bool, cmd ...string) (string, error)
WaitForCmdOutputInPod runs command with arguments 'cmd' in Pod 'pod' at an interval 'interval' and retries for at most the duration 'duration' expecting standard output of the command with leading and trailing whitespace optionally ('trim') trimmed to match 'valExp'. The function returns the retrieved value and an error in case the values did not match by the time duration 'duration' elapsed.
func WaitForPoolMachineCount ¶
WaitForPoolMachineCount polls a pool until its machineCount equals to 'count'.
func WaitForPoolUpdatedMachineCount ¶
WaitForPoolUpdatedMachineCount polls a pool until its UpdatedMachineCount equals to 'count'.
func WaitForProfileConditionStatus ¶
func WaitForProfileConditionStatus(cs *framework.ClientSet, interval, duration time.Duration, profile string, profileExpect string, conditionType tunedv1.ProfileConditionType, conditionStatus corev1.ConditionStatus) error
WaitForProfileConditionStatus blocks until Profile with name `profile` is reporting its `conditionType` with the value of 'conditionStatus', for the TuneD profile `profileExpect`. The execution interval to check the value is 'interval' and retries last for at most the duration 'duration'.
func WaitForSysctlInPod ¶
func WaitForSysctlInPod(interval, duration time.Duration, pod *corev1.Pod, sysctlVar string) (string, error)
WaitForSysctlInPod waits for a successful ('error' == nil) output of the "sysctl -n 'sysctlVar'" command inside Pod 'pod'. The execution interval is 'interval' and retries last for at most the duration 'duration'. Returns the sysctl value retrieved with leading and trailing whitespace removed and an error during the command execution.
func WaitForSysctlValueInPod ¶
func WaitForSysctlValueInPod(interval, duration time.Duration, pod *corev1.Pod, sysctlVar string, valExp string) (string, error)
WaitForSysctlValueInPod blocks until the sysctl value for 'sysctlVar' from inside Pod 'pod' is equal to 'valExp'. The execution interval to check the value is 'interval' and retries last for at most the duration 'duration'. Returns the sysctl value retrieved and an error during the last command execution.
Types ¶
type VerificationData ¶
type VerificationData struct { OutputCurrent string OutputExpected string CommandArgs []string TargetTunedPod *corev1.Pod }