Documentation ¶
Overview ¶
The helper package provides builders to instantiate Kubernetes objects used in integration tests.
Index ¶
- type DeploymentBuilder
- func (b *DeploymentBuilder) Build() *appsv1.Deployment
- func (b *DeploymentBuilder) WithContainer(name, image string) *DeploymentBuilder
- func (b *DeploymentBuilder) WithName(name string) *DeploymentBuilder
- func (b *DeploymentBuilder) WithNamespace(namespace string) *DeploymentBuilder
- func (b *DeploymentBuilder) WithRandomName(prefix string) *DeploymentBuilder
- type Helper
- func (h *Helper) DeleteConfigAuditReportOwnedBy(obj client.Object) error
- func (h *Helper) DeploymentIsReady(deploy client.ObjectKey) func() (bool, error)
- func (h *Helper) GetActiveReplicaSetForDeployment(namespace, name string) (*appsv1.ReplicaSet, error)
- func (h *Helper) HasActiveReplicaSet(namespace, name string) func() (bool, error)
- func (h *Helper) HasConfigAuditReportOwnedBy(obj client.Object) func() (bool, error)
- func (h *Helper) HasVulnerabilityReportOwnedBy(obj client.Object) func() (bool, error)
- func (h *Helper) UpdateDeploymentImage(namespace, name string) error
- type PodBuilder
- func (b *PodBuilder) Build() *corev1.Pod
- func (b *PodBuilder) WithContainer(name, image string) *PodBuilder
- func (b *PodBuilder) WithImagePullSecret(name string) *PodBuilder
- func (b *PodBuilder) WithName(name string) *PodBuilder
- func (b *PodBuilder) WithNamespace(namespace string) *PodBuilder
- func (b *PodBuilder) WithRandomName(prefix string) *PodBuilder
- func (b *PodBuilder) WithServiceAccountName(name string) *PodBuilder
- type PrivateRegistryConfig
- type SecretBuilder
- func (b *SecretBuilder) Build() (*corev1.Secret, error)
- func (b *SecretBuilder) WithNamespace(namespace string) *SecretBuilder
- func (b *SecretBuilder) WithPassword(password string) *SecretBuilder
- func (b *SecretBuilder) WithRandomName(name string) *SecretBuilder
- func (b *SecretBuilder) WithServer(server string) *SecretBuilder
- func (b *SecretBuilder) WithUsername(username string) *SecretBuilder
- type ServiceAccountBuilder
- func (b *ServiceAccountBuilder) Build() *corev1.ServiceAccount
- func (b *ServiceAccountBuilder) WithImagePullSecret(name string) *ServiceAccountBuilder
- func (b *ServiceAccountBuilder) WithNamespace(namespace string) *ServiceAccountBuilder
- func (b *ServiceAccountBuilder) WithRandomName(prefix string) *ServiceAccountBuilder
- type VulnerabilityReportBuilder
- func (b *VulnerabilityReportBuilder) Build() *v1alpha1.VulnerabilityReport
- func (b *VulnerabilityReportBuilder) WithName(name string) *VulnerabilityReportBuilder
- func (b *VulnerabilityReportBuilder) WithNamespace(namespace string) *VulnerabilityReportBuilder
- func (b *VulnerabilityReportBuilder) WithOwnerKind(kind kube.Kind) *VulnerabilityReportBuilder
- func (b *VulnerabilityReportBuilder) WithOwnerName(name string) *VulnerabilityReportBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeploymentBuilder ¶
type DeploymentBuilder struct {
// contains filtered or unexported fields
}
func NewDeployment ¶
func NewDeployment() *DeploymentBuilder
func (*DeploymentBuilder) Build ¶
func (b *DeploymentBuilder) Build() *appsv1.Deployment
func (*DeploymentBuilder) WithContainer ¶
func (b *DeploymentBuilder) WithContainer(name, image string) *DeploymentBuilder
func (*DeploymentBuilder) WithName ¶
func (b *DeploymentBuilder) WithName(name string) *DeploymentBuilder
func (*DeploymentBuilder) WithNamespace ¶
func (b *DeploymentBuilder) WithNamespace(namespace string) *DeploymentBuilder
func (*DeploymentBuilder) WithRandomName ¶
func (b *DeploymentBuilder) WithRandomName(prefix string) *DeploymentBuilder
type Helper ¶
type Helper struct {
// contains filtered or unexported fields
}
Helper is a mix of asserts and helpers, but we can fix that later.
func (*Helper) DeleteConfigAuditReportOwnedBy ¶
func (*Helper) DeploymentIsReady ¶
func (*Helper) GetActiveReplicaSetForDeployment ¶
func (h *Helper) GetActiveReplicaSetForDeployment(namespace, name string) (*appsv1.ReplicaSet, error)
func (*Helper) HasActiveReplicaSet ¶
func (*Helper) HasConfigAuditReportOwnedBy ¶
func (*Helper) HasVulnerabilityReportOwnedBy ¶
func (*Helper) UpdateDeploymentImage ¶
nolint:staticcheck
type PodBuilder ¶
type PodBuilder struct {
// contains filtered or unexported fields
}
func NewPod ¶
func NewPod() *PodBuilder
func (*PodBuilder) Build ¶
func (b *PodBuilder) Build() *corev1.Pod
func (*PodBuilder) WithContainer ¶
func (b *PodBuilder) WithContainer(name, image string) *PodBuilder
func (*PodBuilder) WithImagePullSecret ¶
func (b *PodBuilder) WithImagePullSecret(name string) *PodBuilder
func (*PodBuilder) WithName ¶
func (b *PodBuilder) WithName(name string) *PodBuilder
func (*PodBuilder) WithNamespace ¶
func (b *PodBuilder) WithNamespace(namespace string) *PodBuilder
func (*PodBuilder) WithRandomName ¶
func (b *PodBuilder) WithRandomName(prefix string) *PodBuilder
func (*PodBuilder) WithServiceAccountName ¶
func (b *PodBuilder) WithServiceAccountName(name string) *PodBuilder
type PrivateRegistryConfig ¶
type PrivateRegistryConfig struct { Server string `env:"TUNNEL_OPERATOR_TEST_REGISTRY_SERVER"` Username string `env:"TUNNEL_OPERATOR_TEST_REGISTRY_USERNAME"` Password string `env:"TUNNEL_OPERATOR_TEST_REGISTRY_PASSWORD"` ImageRef string `env:"TUNNEL_OPERATOR_TEST_REGISTRY_PRIVATE_IMAGE_REF"` }
func (*PrivateRegistryConfig) Parse ¶
func (c *PrivateRegistryConfig) Parse() error
type SecretBuilder ¶
type SecretBuilder struct {
// contains filtered or unexported fields
}
func (*SecretBuilder) WithNamespace ¶
func (b *SecretBuilder) WithNamespace(namespace string) *SecretBuilder
func (*SecretBuilder) WithPassword ¶
func (b *SecretBuilder) WithPassword(password string) *SecretBuilder
func (*SecretBuilder) WithRandomName ¶
func (b *SecretBuilder) WithRandomName(name string) *SecretBuilder
func (*SecretBuilder) WithServer ¶
func (b *SecretBuilder) WithServer(server string) *SecretBuilder
func (*SecretBuilder) WithUsername ¶
func (b *SecretBuilder) WithUsername(username string) *SecretBuilder
type ServiceAccountBuilder ¶
type ServiceAccountBuilder struct {
// contains filtered or unexported fields
}
func (*ServiceAccountBuilder) Build ¶
func (b *ServiceAccountBuilder) Build() *corev1.ServiceAccount
func (*ServiceAccountBuilder) WithImagePullSecret ¶
func (b *ServiceAccountBuilder) WithImagePullSecret(name string) *ServiceAccountBuilder
func (*ServiceAccountBuilder) WithNamespace ¶
func (b *ServiceAccountBuilder) WithNamespace(namespace string) *ServiceAccountBuilder
func (*ServiceAccountBuilder) WithRandomName ¶
func (b *ServiceAccountBuilder) WithRandomName(prefix string) *ServiceAccountBuilder
type VulnerabilityReportBuilder ¶
type VulnerabilityReportBuilder struct {
// contains filtered or unexported fields
}
func (*VulnerabilityReportBuilder) Build ¶
func (b *VulnerabilityReportBuilder) Build() *v1alpha1.VulnerabilityReport
func (*VulnerabilityReportBuilder) WithName ¶
func (b *VulnerabilityReportBuilder) WithName(name string) *VulnerabilityReportBuilder
func (*VulnerabilityReportBuilder) WithNamespace ¶
func (b *VulnerabilityReportBuilder) WithNamespace(namespace string) *VulnerabilityReportBuilder
func (*VulnerabilityReportBuilder) WithOwnerKind ¶
func (b *VulnerabilityReportBuilder) WithOwnerKind(kind kube.Kind) *VulnerabilityReportBuilder
func (*VulnerabilityReportBuilder) WithOwnerName ¶
func (b *VulnerabilityReportBuilder) WithOwnerName(name string) *VulnerabilityReportBuilder
Click to show internal directories.
Click to hide internal directories.