Documentation ¶
Index ¶
- func CheckDeployments(deployments []string) error
- func GetEndpointsAddresses() (string, error)
- func GetPersistentVolume(name string) (*corev1.PersistentVolume, error)
- func GetPersistentVolumeClaim(namespace, name string) (*corev1.PersistentVolumeClaim, error)
- func GetPod(namespace, name string) (*corev1.Pod, error)
- func IsExistingServer() bool
- func IsRoot() bool
- func K3sCleanup(k3sTestLock int, dataDir string) error
- func K3sCmd(inputArgs ...string) (string, error)
- func K3sDefaultDeployments() error
- func K3sKillServer(server *K3sServer) error
- func K3sSaveLog(server *K3sServer, dump bool) error
- func K3sServerArgs() []string
- func K3sStopServer(server *K3sServer) error
- func K3sTestLock() (int, error)
- func ParseNodes() ([]corev1.Node, error)
- func ParsePods(namespace string, opts metav1.ListOptions) ([]corev1.Pod, error)
- func RunCommand(cmd string) (string, error)
- func SearchK3sLog(k3s *K3sServer, target string) (bool, error)
- func ServerArgsPresent(neededArgs []string) bool
- type K3sServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckDeployments ¶
CheckDeployments checks if the provided list of deployments are ready, otherwise returns an error
func GetEndpointsAddresses ¶
func GetPersistentVolume ¶
func GetPersistentVolume(name string) (*corev1.PersistentVolume, error)
func GetPersistentVolumeClaim ¶
func GetPersistentVolumeClaim(namespace, name string) (*corev1.PersistentVolumeClaim, error)
func IsExistingServer ¶
func IsExistingServer() bool
func K3sCleanup ¶
K3sCleanup unlocks the test-lock and attempts to cleanup networking and files leftover from an integration test. This is similar to the k3s-killall.sh script, but we dynamically generate that on install, so we don't have access to it during testing.
func K3sCmd ¶
K3sCmd launches the provided K3s command via exec. Command blocks until finished. Command output from both Stderr and Stdout is provided via string. Input can be a single string with space separated args, or multiple string args cmdEx1, err := K3sCmd("etcd-snapshot", "ls") cmdEx2, err := K3sCmd("kubectl get pods -A") cmdEx2, err := K3sCmd("kubectl", "get", "pods", "-A")
func K3sDefaultDeployments ¶
func K3sDefaultDeployments() error
K3sDefaultDeployments checks if the default deployments for K3s are ready, otherwise returns an error
func K3sKillServer ¶
K3sKillServer terminates the running K3s server and its children. Equivalent to k3s-killall.sh
func K3sSaveLog ¶
func K3sServerArgs ¶
func K3sServerArgs() []string
K3sServerArgs returns the list of arguments that the k3s server launched with
func K3sStopServer ¶
K3sStopServer gracefully stops the running K3s server and does not kill its children. Equivalent to stopping the K3s service
func K3sTestLock ¶
func ParseNodes ¶
func ServerArgsPresent ¶
ServerArgsPresent checks if the given arguments are found in the running k3s server
Types ¶
type K3sServer ¶
type K3sServer struct {
// contains filtered or unexported fields
}
func K3sStartServer ¶
K3sStartServer acquires an exclusive lock on a temporary file, then launches a k3s cluster with the provided arguments. Subsequent/parallel calls to this function will block until the original lock is cleared using K3sKillServer