Documentation ¶
Index ¶
- 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) DeploymentUID() types.UID
- func (b PodBuilder) ManifestName() model.ManifestName
- func (b PodBuilder) ObjectTreeEntities() []k8s.K8sEntity
- func (b PodBuilder) PodID() k8s.PodID
- func (b PodBuilder) RestartCount() int
- func (b PodBuilder) WithContainerID(cID container.ID) PodBuilder
- func (b PodBuilder) WithContainerIDAtIndex(cID container.ID, index int) PodBuilder
- func (b PodBuilder) WithContainerReady(ready bool) PodBuilder
- func (b PodBuilder) WithContainerReadyAtIndex(ready bool, index int) PodBuilder
- func (b PodBuilder) WithCreationTime(creationTime time.Time) PodBuilder
- func (b PodBuilder) WithDeletionTime(deletionTime time.Time) PodBuilder
- func (b PodBuilder) WithDeploymentUID(deploymentUID types.UID) PodBuilder
- func (b PodBuilder) WithImage(image string) PodBuilder
- func (b PodBuilder) WithImageAtIndex(image string, index int) PodBuilder
- func (b PodBuilder) WithNoTemplateSpecHash() PodBuilder
- func (b PodBuilder) WithPhase(phase string) PodBuilder
- func (b PodBuilder) WithPodID(podID string) PodBuilder
- func (b PodBuilder) WithPodLabel(key, val string) PodBuilder
- func (b PodBuilder) WithResourceVersion(rv string) PodBuilder
- func (b PodBuilder) WithRestartCount(restartCount int) PodBuilder
- func (b PodBuilder) WithTemplateSpecHash(s k8s.PodTemplateSpecHash) PodBuilder
- func (b PodBuilder) WithUnknownOwner() PodBuilder
Constants ¶
This section is empty.
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) DeploymentUID ¶ added in v0.10.5
func (b PodBuilder) DeploymentUID() types.UID
func (PodBuilder) ManifestName ¶ added in v0.10.5
func (b PodBuilder) ManifestName() model.ManifestName
func (PodBuilder) ObjectTreeEntities ¶ added in v0.10.5
func (b PodBuilder) ObjectTreeEntities() []k8s.K8sEntity
Simulates a Pod -> ReplicaSet -> Deployment ref tree
func (PodBuilder) PodID ¶ added in v0.10.5
func (b PodBuilder) PodID() k8s.PodID
func (PodBuilder) RestartCount ¶ added in v0.10.5
func (b PodBuilder) RestartCount() int
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) WithContainerReady ¶ added in v0.10.15
func (b PodBuilder) WithContainerReady(ready bool) PodBuilder
func (PodBuilder) WithContainerReadyAtIndex ¶ added in v0.10.15
func (b PodBuilder) WithContainerReadyAtIndex(ready bool, index int) PodBuilder
func (PodBuilder) WithCreationTime ¶
func (b PodBuilder) WithCreationTime(creationTime time.Time) PodBuilder
func (PodBuilder) WithDeletionTime ¶ added in v0.10.5
func (b PodBuilder) WithDeletionTime(deletionTime time.Time) PodBuilder
func (PodBuilder) WithDeploymentUID ¶ added in v0.10.5
func (b PodBuilder) WithDeploymentUID(deploymentUID types.UID) 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) WithNoTemplateSpecHash ¶ added in v0.10.16
func (b PodBuilder) WithNoTemplateSpecHash() PodBuilder
func (PodBuilder) WithPhase ¶
func (b PodBuilder) WithPhase(phase string) PodBuilder
func (PodBuilder) WithPodID ¶
func (b PodBuilder) WithPodID(podID string) PodBuilder
func (PodBuilder) WithPodLabel ¶ added in v0.10.5
func (b PodBuilder) WithPodLabel(key, val string) PodBuilder
func (PodBuilder) WithResourceVersion ¶ added in v0.10.19
func (b PodBuilder) WithResourceVersion(rv string) PodBuilder
func (PodBuilder) WithRestartCount ¶ added in v0.10.5
func (b PodBuilder) WithRestartCount(restartCount int) PodBuilder
func (PodBuilder) WithTemplateSpecHash ¶ added in v0.10.16
func (b PodBuilder) WithTemplateSpecHash(s k8s.PodTemplateSpecHash) PodBuilder
func (PodBuilder) WithUnknownOwner ¶ added in v0.17.7
func (b PodBuilder) WithUnknownOwner() PodBuilder
Remove the owner reference. Useful for testing pod watching when the owner chain is broken (as in some CRDs).