cmd

package
v2.36.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CRCExecutableInstalled    = "installed"
	CRCExecutableNotInstalled = "notInstalled"
)

Variables

This section is empty.

Functions

func CheckCRCExecutableState

func CheckCRCExecutableState(state string) error

func CheckCRCStatus

func CheckCRCStatus(state string) error

func DeleteCRC

func DeleteCRC() error

func Exec

func Exec(cmd *exec.Cmd, timeout <-chan time.Time) (string, string, error)

func RunPodmanExpectFail

func RunPodmanExpectFail(args ...string) (string, error)

RunPodmanExpectFail is a convenience wrapper over PodmanBuilder if err != nil: return stderr, nil if err == nil: return stdout, err

func RunPodmanExpectSuccess

func RunPodmanExpectSuccess(args ...string) (string, error)

RunPodmanExpectSuccess is a convenience wrapper over podman-remote

func SetConfigPropertyToValueSucceedsOrFails

func SetConfigPropertyToValueSucceedsOrFails(property string, value string, expected string) error

func UnsetConfigPropertySucceedsOrFails

func UnsetConfigPropertySucceedsOrFails(property string, expected string) error

func WaitForClusterInState

func WaitForClusterInState(state string) error

Types

type CodeExitError

type CodeExitError struct {
	Err  error
	Code int
}

CodeExitError is an implementation of ExitError consisting of an error object and an exit code (the upper bits of os.exec.ExitStatus).

func (CodeExitError) Error

func (e CodeExitError) Error() string

func (CodeExitError) ExitStatus

func (e CodeExitError) ExitStatus() int

func (CodeExitError) Exited

func (e CodeExitError) Exited() bool

func (CodeExitError) String

func (e CodeExitError) String() string

type Command

type Command struct {
	// contains filtered or unexported fields
}

func CRC

func CRC(command string) Command

func (Command) Execute

func (c Command) Execute() error

func (Command) ExecuteSingleWithExpectedExit

func (c Command) ExecuteSingleWithExpectedExit(expectedExit string) error

func (Command) ExecuteWithExpectedExit

func (c Command) ExecuteWithExpectedExit(expectedExit string) error

func (Command) ToString

func (c Command) ToString() string

func (Command) WithDisableNTP

func (c Command) WithDisableNTP() Command

func (Command) WithUpdateCheck

func (c Command) WithUpdateCheck() Command

type ExitError

type ExitError interface {
	String() string
	Error() string
	Exited() bool
	ExitStatus() int
}

ExitError is an interface that presents an API similar to os.ProcessState, which is what ExitError from os/exec is. This is designed to make testing a bit easier and probably loses some of the cross-platform properties of the underlying library.

type PodmanBuilder

type PodmanBuilder struct {
	// contains filtered or unexported fields
}

PodmanBuilder is used to build, customize, and execute a podman-remote command.

func NewPodmanCommand

func NewPodmanCommand(args ...string) *PodmanBuilder

NewPodmanCommand returns a PodmanBuilder for running CRC.

func (PodmanBuilder) Exec

func (b PodmanBuilder) Exec() (string, error)

Exec runs the executable.

func (PodmanBuilder) ExecOrDie

func (b PodmanBuilder) ExecOrDie() (string, error)

ExecOrDie runs the executable or dies if error occurs.

func (PodmanBuilder) ExecOrDieWithLogs

func (b PodmanBuilder) ExecOrDieWithLogs() (string, string, error)

ExecOrDieWithLogs runs the executable or dies if error occurs.

func (PodmanBuilder) ExecWithFullOutput

func (b PodmanBuilder) ExecWithFullOutput() (string, string, error)

ExecWithFullOutput runs the executable and returns the stdout and stderr.

func (PodmanBuilder) WithStdinData

func (b PodmanBuilder) WithStdinData(data string) *PodmanBuilder

WithStdinData sets the given data to stdin and returns itself.

func (PodmanBuilder) WithStdinReader

func (b PodmanBuilder) WithStdinReader(reader io.Reader) *PodmanBuilder

WithStdinReader sets the given reader and returns itself.

func (*PodmanBuilder) WithTimeout

func (b *PodmanBuilder) WithTimeout(t <-chan time.Time) *PodmanBuilder

WithTimeout sets the given timeout and returns itself.

Jump to

Keyboard shortcuts

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