resources

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestContext

type TestContext struct {
	*resources.Resources
	*conditions.Condition
	// contains filtered or unexported fields
}

TestContext holds test-specific context. It can be extended on a per-test basis to hold additional information related to the test. Wraps resources.Resources and conditions.Condition.

func NewTestContext

func NewTestContext(ctx context.Context, cfg *envconf.Config) (*TestContext, error)

NewTestContext creates a new test context that can be used to create and interact with kubernetes resources from inside a test.

func (*TestContext) ExecInPod

func (tc *TestContext) ExecInPod(ctx context.Context, pod *corev1.Pod, cmd []string) (output string, err error)

ExecInPod returns the result of an exec in the pod. Wraps resources.Resources.ExecInPod to not manually manage stdout and stderr.

func (*TestContext) Get

func (tc *TestContext) Get(ctx context.Context, name string, obj k8s.Object) error

Get returns the object with the given name in the test context's namespace. Wraps resources.Resources.Get. To get resources in a different namespace, call tc.Resources.Get directly.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳