podbuilder

package
v0.10.4 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const FakeDeployID = model.DeployID(1234567890)

Variables

This section is empty.

Functions

func FakeContainerID

func FakeContainerID() container.ID

func FakeContainerIDAtIndex added in v0.10.0

func FakeContainerIDAtIndex(index int) container.ID

func FakeContainerIDSet added in v0.10.0

func FakeContainerIDSet(size int) map[container.ID]bool

Types

type PodBuilder

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

Builds Pod objects for testing

The pod model should be internally well-formed (e.g., the containers in the PodSpec object should match the containers in the PodStatus object).

The pod model should also be consistent with the Manifest (e.g., if the Manifest specifies a Deployment with labels in a PodTemplateSpec, then any Pods should also have those labels).

The PodBuilder is responsible for making sure we create well-formed Pods for testing. Tests should never modify the pod directly, but instead use the PodBuilder methods to ensure that the pod is consistent.

func New

func New(t testing.TB, manifest model.Manifest) PodBuilder

func (PodBuilder) Build

func (b PodBuilder) Build() *v1.Pod

func (PodBuilder) WithContainerID

func (b PodBuilder) WithContainerID(cID container.ID) PodBuilder

func (PodBuilder) WithContainerIDAtIndex added in v0.10.0

func (b PodBuilder) WithContainerIDAtIndex(cID container.ID, index int) PodBuilder

func (PodBuilder) WithCreationTime

func (b PodBuilder) WithCreationTime(creationTime time.Time) PodBuilder

func (PodBuilder) WithDeployID

func (b PodBuilder) WithDeployID(deployID model.DeployID) PodBuilder

func (PodBuilder) WithImage

func (b PodBuilder) WithImage(image string) PodBuilder

func (PodBuilder) WithImageAtIndex added in v0.10.0

func (b PodBuilder) WithImageAtIndex(image string, index int) PodBuilder

func (PodBuilder) WithPhase

func (b PodBuilder) WithPhase(phase string) PodBuilder

func (PodBuilder) WithPodID

func (b PodBuilder) WithPodID(podID string) PodBuilder

Jump to

Keyboard shortcuts

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