Documentation ¶
Index ¶
- Constants
- func FakeContainerID() container.ID
- func FakeContainerIDAtIndex(index int) container.ID
- func FakeContainerIDSet(size int) map[container.ID]bool
- type PodBuilder
- func (b PodBuilder) Build() *v1.Pod
- func (b PodBuilder) WithContainerID(cID container.ID) PodBuilder
- func (b PodBuilder) WithContainerIDAtIndex(cID container.ID, index int) PodBuilder
- func (b PodBuilder) WithCreationTime(creationTime time.Time) PodBuilder
- func (b PodBuilder) WithDeployID(deployID model.DeployID) PodBuilder
- func (b PodBuilder) WithImage(image string) PodBuilder
- func (b PodBuilder) WithImageAtIndex(image string, index int) PodBuilder
- func (b PodBuilder) WithPhase(phase string) PodBuilder
- func (b PodBuilder) WithPodID(podID string) PodBuilder
Constants ¶
View Source
const FakeDeployID = model.DeployID(1234567890)
Variables ¶
This section is empty.
Functions ¶
func FakeContainerID ¶
func FakeContainerIDAtIndex ¶ added in v0.10.0
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 (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
Click to show internal directories.
Click to hide internal directories.