environment

package
v0.0.212-g962085d Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2020 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyCRDs

func ApplyCRDs(kubeConfig *rest.Config) error

ApplyCRDs applies the CRDs to the cluster

Types

type Environment

type Environment struct {
	*utils.Environment
	Machine
	testing.Catalog
}

Environment test env with helpers to create structs and k8s resources

func NewEnvironment

func NewEnvironment(kubeConfig *rest.Config) *Environment

NewEnvironment returns a new test environment

func (*Environment) SetupClientsets

func (e *Environment) SetupClientsets() error

SetupClientsets initializes kube clientsets

func (*Environment) SetupNamespace

func (e *Environment) SetupNamespace() error

SetupNamespace creates the namespace and the clientsets and prepares the teardowm

func (*Environment) SetupServiceAccount

func (e *Environment) SetupServiceAccount() error

SetupServiceAccount creates a service account for the pod

func (*Environment) StartOperator

func (e *Environment) StartOperator() error

StartOperator starts the quarks job operator

type Machine

type Machine struct {
	machine.Machine

	VersionedClientset *versioned.Clientset
}

Machine produces and destroys resources for tests

func (*Machine) CollectJobs

func (m *Machine) CollectJobs(namespace string, labels string, n int) ([]batchv1.Job, error)

CollectJobs waits for n jobs with specified labels. It fails after the timeout.

func (*Machine) CreateQuarksJob

func (m *Machine) CreateQuarksJob(namespace string, job qjv1a1.QuarksJob) (*qjv1a1.QuarksJob, machine.TearDownFunc, error)

CreateQuarksJob creates an QuarksJob

func (*Machine) GetQuarksJob

func (m *Machine) GetQuarksJob(namespace string, name string) (*qjv1a1.QuarksJob, error)

GetQuarksJob gets an QuarksJob custom resource

func (*Machine) JobExists

func (m *Machine) JobExists(namespace string, name string) (bool, error)

JobExists returns true if job with that name exists

func (*Machine) QuarksJobExists

func (m *Machine) QuarksJobExists(namespace string, name string) (bool, error)

QuarksJobExists returns true if quarks job with that name exists

func (*Machine) UpdateQuarksJob

func (m *Machine) UpdateQuarksJob(namespace string, qJob qjv1a1.QuarksJob) error

UpdateQuarksJob updates an quarks job

func (*Machine) WaitForJobDeletion

func (m *Machine) WaitForJobDeletion(namespace string, name string) error

WaitForJobDeletion blocks until the batchv1.Job is deleted

func (*Machine) WaitForJobExists

func (m *Machine) WaitForJobExists(namespace string, labels string) (bool, error)

WaitForJobExists polls until a short timeout is reached or a job is found It returns true only if a job is found

func (*Machine) WaitForQuarksJobDeletion

func (m *Machine) WaitForQuarksJobDeletion(namespace string, name string) error

WaitForQuarksJobDeletion blocks until the quarks job is deleted

Jump to

Keyboard shortcuts

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