kubetest

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClientFromKubeconfig added in v0.13.0

func NewClientFromKubeconfig(path string) (kubernetes.Interface, error)

func PodsAreGone added in v0.9.0

func PodsAreGone(client kubernetes.Interface, labels string) func(*ScenarioContext) error

PodsAreGone waits for pods being gone for the given labels. Returns a func directly (not Setup or Conditions) as it can be used in Given and When steps

func PodsAreReady

func PodsAreReady(client kubernetes.Interface, replicas int, labels string) func(*ScenarioContext) error

PodsAreReady waits for a number if replicas matching the given labels to be ready. Returns a func directly (not Setup or Conditions) as it can be used in Given and When steps

func ServiceIsReady

func ServiceIsReady(client kubernetes.Interface, service string) func(*ScenarioContext) error

ServiceIsReady waits for given service to exist and have at least 1 endpoint. Returns a func directly (not Setup or Conditions) as it can be used in Given and When steps

Types

type Action added in v0.13.0

type Action func(ctx *ScenarioContext) error

func Actions added in v0.13.0

func Actions(ss ...Action) Action

func ClientFails added in v0.13.0

func ClientFails(client kubernetes.Interface, command string, opts *RunOptions) Action

func ClientSucceeds added in v0.13.0

func ClientSucceeds(client kubernetes.Interface, command string, opts *RunOptions) Action

func CreatedManifests

func CreatedManifests(client kubernetes.Interface, paths ...string) Action

func RunFails

func RunFails(client kubernetes.Interface, image string, name string, command []string, opts *RunOptions) Action

func RunSucceeds

func RunSucceeds(client kubernetes.Interface, image string, name string, command []string, opts *RunOptions) Action

type CleanUp added in v0.13.0

type CleanUp func() error

type RunOptions

type RunOptions struct {
	ServiceAccount     string
	TokenAudience      string
	ClientCertificates bool
}

type Scenario

type Scenario struct {
	KubeClient kubernetes.Interface

	Name        string
	Description string

	Given Action
	When  Action
	Then  Action
}

func (Scenario) Run

func (s Scenario) Run(t *testing.T) bool

type ScenarioContext

type ScenarioContext struct {
	Namespace string
	CleanUp   []CleanUp
}

func (*ScenarioContext) AddCleanUp added in v0.13.0

func (ctx *ScenarioContext) AddCleanUp(f CleanUp)

type TestSuite

type TestSuite func(t *testing.T)

Jump to

Keyboard shortcuts

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