utils

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchCommandOutput

func FetchCommandOutput(command string) string

FetchCommandOutput run command and returns the combined stderr and stdout output.

func FetchSeperatedCommandOutput

func FetchSeperatedCommandOutput(command string) (p *exec.Proc, stdout, stderr bytes.Buffer)

FetchSeperatedCommandOutput run command and returns the command by splitting the stdout and stderr into different buffers and returns the Process with the buffer that can be ready from to extract the data set on the respective buffers

func FindOrInstallGoBasedProvider

func FindOrInstallGoBasedProvider(pPath, provider, module, version string) (string, error)

FindOrInstallGoBasedProvider check if the provider specified by the pPath executable exists or not. If it exists, it returns the path with no error and if not, it uses the `go install` capabilities to install the provider and setup the required binaries to perform the tests. In case if the install is done by this helper, it will return the value for installed binary as provider which can then be set in the invoker to make sure the right path is used for the binaries while invoking rest of the workfow after this helper is triggered.

func PerformNodeLifecycleOperation

func PerformNodeLifecycleOperation(ctx context.Context, action types.NodeOperation, node *types.Node, args ...string) error

PerformNodeLifecycleOperation performs a node operation on a cluster. These operations can range from Add/Remove/Start/Stop. This helper is re-used in both node lifecycle handler used as types.StepFunc or env.Func

func RunCommand

func RunCommand(command string) *exec.Proc

RunCommand run command and returns an *exec.Proc with information about the executed process.

func RunCommandWithCustomWriter

func RunCommandWithCustomWriter(command string, stdout, stderr io.Writer) *exec.Proc

RunCommandWithCustomWriter run command and returns an *exec.Proc with information about the executed process. This helps map the STDOUT/STDERR to custom writer to extract data from the output.

func RunCommandWithSeperatedOutput

func RunCommandWithSeperatedOutput(command string, stdout, stderr io.Writer) error

RunCommandWithSeperatedOutput run command and returns the results to the provided stdout and stderr io.Writer.

Types

This section is empty.

Jump to

Keyboard shortcuts

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