execute

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2021 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Execute

type Execute struct {
	// DryRun prevents making changes to the target cluster.
	DryRun bool

	// NoDelete prevents prune from deleting resources.
	NoDelete bool

	// Environ are the environment variables on Tool invocation.
	Environ []string

	// Kubectl knows how to invoke 'kubectl'
	Kubectl Kubectler

	// Out is the stream to send steps to in a format that is 'kubectl apply -f -' consumable.
	// Setting Out prevents any other processing (like 'wait') to take place.
	Out io.Writer

	Log logr.Logger
}

Execute executes Action, Apply, Wait steps.

func (*Execute) Action

func (x *Execute) Action(id int, name string, doc []byte, portForward string, passedValues *yamlx.Values) error

Action performs an action on the target cluster.

func (*Execute) Apply

func (x *Execute) Apply(id int, name string, labels map[string]string, b []byte) ([]KindNamespaceName, error)

Apply applies the yaml's in b to the target cluster.

func (*Execute) Prune added in v0.4.0

func (x *Execute) Prune(id int, deployed []KindNamespaceName, store Store) error

func (*Execute) Wait

func (x *Execute) Wait(id int, flags string) error

Wait waits for target cluster conditions specified by flags to become true.

type KindNamespaceName added in v0.4.0

type KindNamespaceName struct {
	GVK       metav1.GroupVersionKind
	Namespace string
	Name      string
}

KindNamespaceName TODO Use core/v1/ObjectReference and remove this type. https://www.k8sref.io/docs/common-definitions/objectreference-/

func NewKindNamespaceName added in v0.4.0

func NewKindNamespaceName(obj *unstructured.Unstructured) KindNamespaceName

NewKindNamespaceName returns a KindNamespaceName from any kubernetes object.

func (KindNamespaceName) String added in v0.4.0

func (k KindNamespaceName) String() string

String makes the receiver implement Stringer.

type Kubectl

type Kubectl struct {
	// Environ are the environment variables on kubectl invocation.
	Environ []string
	// Kubectl binary name and global arguments.
	KubeCtl, KubeConfig, KubeContext string

	Log logr.Logger
}

Kubectl can run kubectl cli.

func (Kubectl) Run

func (k Kubectl) Run(ctx context.Context, stdin string, args ...string) (string, string, error)

Run kubectl.

type Kubectler

type Kubectler interface {
	Run(ctx context.Context, stdin string, args ...string) (string, string, error)
}

Kubectler provides methods to invoke kubectl.

type Store added in v0.4.0

type Store struct {
	// Namespace were data is stored.
	Namespace string
	// Name of ConfigMap were data is stored.
	Name string
	// Xtra key/values to store.
	X map[string]string
}

Store config.

Jump to

Keyboard shortcuts

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