utils

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VerifyDirectoryModeUidGidInPod

func VerifyDirectoryModeUidGidInPod(f *e2eframework.Framework, directory, expectedMode, expectedUid, expectedGid string, pod *corev1.Pod)

VerifyDirectoryModeUidGidInPod verifies expected mode, UID, and GID of the target directory This implementation is similar to [`VerifyFilePathGidInPod`](https://github.com/kubernetes/kubernetes/blob/v1.21.0/test/e2e/storage/utils/utils.go#L709).

Types

type FSExec

type FSExec struct {
	Resource *storageframework.VolumeResource // Export for easy inspection.
	// contains filtered or unexported fields
}

FSExec makes it easy to execute commands on a node that has a BeeGFS file system mounted. FSExec handles creating a volume resource, creating a pod to mount it, and tracking the node that has it mounted. This frees the caller to worry only about what command to execute.

func NewFSExec

func NewFSExec(cfg *storageframework.PerTestConfig, driver *driver.BeegfsDriver, sizeRange e2evolume.SizeRange) FSExec

NewFSExec initializes an FSExec.

func (*FSExec) Cleanup

func (e *FSExec) Cleanup() error

Cleanup removes the resources used by FSExec from the cluster.

func (*FSExec) IssueCommandWithBeegfsPaths

func (e *FSExec) IssueCommandWithBeegfsPaths(cmdFmtString string, beegfsPaths ...string) (string, error)

IssueCommandWithBeegfsPaths takes a format string (like the ones passed to fmt.Printf, fmt.Sprintf, etc.) and any number of BeeGFS relative paths. It converts the relative paths to absolute paths on the host that will execute a command.

func (*FSExec) IssueCommandWithResult

func (e *FSExec) IssueCommandWithResult(cmd string) (string, error)

IssueCommandWithResult works exactly like hostExec.IssueCommandWithResult, except that it identifies the correct node (the one with our BeeGFS file system mounted) on which to execute the passed command automatically.

Jump to

Keyboard shortcuts

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