cluster

package
v0.0.0-...-6402844 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connected

func Connected(clusterObj APIClientGetter) (bool, error)

Connected checks that the OCP cluster of the provided client is connected.

func Disconnected

func Disconnected(clusterObj APIClientGetter) (bool, error)

Disconnected checks that the OCP cluster of the provided client is disconnected.

func ExecCmd

func ExecCmd(apiClient *clients.Settings, nodeSelector string, shellCmd string) error

ExecCmd runc cmd on all nodes that match nodeSelector.

func ExecCmdWithRetries

func ExecCmdWithRetries(client *clients.Settings, retries uint,
	interval time.Duration, nodeSelector, command string) error

ExecCmdWithRetries executes a command on the provided client on each node matching nodeSelector, retrying on internal errors "retries" times with a "interval" duration between retries, and ignores the stdout.

func ExecCmdWithStdout

func ExecCmdWithStdout(
	apiClient *clients.Settings, shellCmd string, options ...metav1.ListOptions) (map[string]string, error)

ExecCmdWithStdout runs cmd on all selected nodes and returns their stdout.

func ExecCmdWithStdoutWithRetries

func ExecCmdWithStdoutWithRetries(
	client *clients.Settings, retries uint, interval time.Duration,
	command string, options ...metav1.ListOptions) (map[string]string, error)

ExecCmdWithStdoutWithRetries executes a command on the provided client, retrying on internal errors "retries" times with a "interval" duration between retries, and returns the stdout for each node.

func ExecCommandOnSNOWithRetries

func ExecCommandOnSNOWithRetries(client *clients.Settings, retries uint,
	interval time.Duration, command string) (string, error)

ExecCommandOnSNOWithRetries executes a command on the provided single node client, retrying on internal errors "retries" times waits with a "interval" duration between retries, and returns the stdout.

func GetOCPClusterName

func GetOCPClusterName(clusterObj APIClientGetter) (string, error)

GetOCPClusterName retrieves the OCP cluster name from an arbitrary cluster.

func GetOCPClusterVersion

func GetOCPClusterVersion(clusterObj APIClientGetter) (*clusterversion.Builder, error)

GetOCPClusterVersion leverages APIClientGetter to retrieve the OCP clusterversion from an arbitrary cluster.

func GetOCPNetworkConfig

func GetOCPNetworkConfig(clusterObj APIClientGetter) (*network.ConfigBuilder, error)

GetOCPNetworkConfig leverages APIClientGetter to retrieve the OCP cluster network from an arbitrary cluster.

func GetOCPNetworkOperatorConfig

func GetOCPNetworkOperatorConfig(clusterObj APIClientGetter) (*network.OperatorBuilder, error)

GetOCPNetworkOperatorConfig leverages APIClientGetter to retrieve the OCP cluster network from an arbitrary cluster.

func GetOCPProxy

func GetOCPProxy(clusterObj APIClientGetter) (*proxy.Builder, error)

GetOCPProxy leverages APIClientGetter to retrieve the OCP cluster proxy from an arbitrary cluster.

func GetOCPPullSecret

func GetOCPPullSecret(clusterObj APIClientGetter) (*secret.Builder, error)

GetOCPPullSecret leverages APIClientGetter to retrieve the OCP pull-secret from an arbitrary cluster.

func PullTestImageOnNodes

func PullTestImageOnNodes(apiClient *clients.Settings, nodeSelector, image string, pullTimeout int) error

PullTestImageOnNodes pulls given image on range of relevant nodes based on nodeSelector.

func SoftRebootSNO

func SoftRebootSNO(apiClient *clients.Settings, retries uint, interval time.Duration) error

SoftRebootSNO executes systemctl reboot on a node.

func WaitForRecover

func WaitForRecover(client *clients.Settings, namespaces []string, timeout time.Duration) error

WaitForRecover waits up to timeout for all pods in namespaces on a provided node to recover.

func WaitForUnreachable

func WaitForUnreachable(client *clients.Settings, timeout time.Duration) error

WaitForUnreachable waits up to timeout for the cluster to become unavailable by attempting to list nodes in the cluster.

Types

type APIClientGetter

type APIClientGetter interface {
	GetAPIClient() (*clients.Settings, error)
}

APIClientGetter is an interface that returns an APIClient from a struct.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL