runner

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Runner = &CmdRunner{}

Functions

func RandStringRunes

func RandStringRunes() string

Types

type CLI

type CLI struct {
	KubeConfig string
	Namespace  string
	Cmd        string
	// contains filtered or unexported fields
}

func NewCLI

func NewCLI(cfg Config, defaultNamespace string) *CLI

func NewHelm

func NewHelm(namespace, kubeconfig, suitName string) *CLI

func NewKubectl

func NewKubectl(namespace, kubeconfig, suitName string) *CLI

func NewNhctl

func NewNhctl(namespace, kubeconfig, suitName string) *CLI

func (*CLI) Command

func (c *CLI) Command(ctx context.Context, command string, arg ...string) *exec.Cmd

func (*CLI) CommandWithNamespace

func (c *CLI) CommandWithNamespace(ctx context.Context, command string, namespace string, arg ...string) *exec.Cmd

func (*CLI) CommandWithoutNs

func (c *CLI) CommandWithoutNs(ctx context.Context, command string, arg ...string) *exec.Cmd

func (CLI) Run

func (c CLI) Run(ctx context.Context, command string, arg ...string) (string, string, error)

func (CLI) RunClusterScope

func (c CLI) RunClusterScope(ctx context.Context, command string, arg ...string) (string, string, error)

func (CLI) RunWithRollingOut

func (c CLI) RunWithRollingOut(ctx context.Context, command string, arg ...string) (string, string, error)

func (CLI) SuitName

func (c CLI) SuitName() string

type Client

type Client interface {
	GetNhctl() *CLI
	GetKubectl() *CLI
	GetHelm() *CLI
	GetClientset() *kubernetes.Clientset

	NameSpace() string
	RandomNsCli(suitName string) Client
	SuiteName() string
}

func NewClient

func NewClient(kubeconfig, namespace, suitName string) Client

type ClientImpl

type ClientImpl struct {
	Nhctl     *CLI
	Kubectl   *CLI
	Helm      *CLI
	Clientset *kubernetes.Clientset
	// contains filtered or unexported fields
}

func (*ClientImpl) GetClientset

func (i *ClientImpl) GetClientset() *kubernetes.Clientset

func (*ClientImpl) GetHelm

func (i *ClientImpl) GetHelm() *CLI

func (*ClientImpl) GetKubectl

func (i *ClientImpl) GetKubectl() *CLI

func (*ClientImpl) GetNhctl

func (i *ClientImpl) GetNhctl() *CLI

func (*ClientImpl) NameSpace

func (i *ClientImpl) NameSpace() string

func (*ClientImpl) RandomNsCli

func (i *ClientImpl) RandomNsCli(suitName string) Client

func (*ClientImpl) SuiteName

func (i *ClientImpl) SuiteName() string

type CmdRunner

type CmdRunner struct{}

func (*CmdRunner) CheckResult

func (r *CmdRunner) CheckResult(cmd *exec.Cmd, stdout string, stderr string, err error) error

func (*CmdRunner) Run

func (r *CmdRunner) Run(suitName string, cmd *exec.Cmd) (string, string, error)

func (*CmdRunner) RunSimple

func (r *CmdRunner) RunSimple(suitName string, cmd *exec.Cmd, ignoreStdErr bool, stdoutConsumer func(string) error) error

func (*CmdRunner) RunWithCheckResult

func (r *CmdRunner) RunWithCheckResult(suitName string, cmd *exec.Cmd) error

func (*CmdRunner) RunWithRollingOutWithChecker

func (r *CmdRunner) RunWithRollingOutWithChecker(suitName string, cmd *exec.Cmd, checker func(log string) bool) (string, string, error)

type Conf

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

func (Conf) GetCmd

func (c Conf) GetCmd() string

func (*Conf) GetKubeConfig

func (c *Conf) GetKubeConfig() string

func (*Conf) GetNamespace

func (c *Conf) GetNamespace() string

func (Conf) SuitName

func (c Conf) SuitName() string

type Config

type Config interface {
	GetKubeConfig() string
	GetNamespace() string
	GetCmd() string
	SuitName() string
}

Jump to

Keyboard shortcuts

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