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) HasCISKubeBenchReportOwnedBy(node corev1.Node) 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 ¶ added in v0.10.2
func (b *DeploymentBuilder) WithRandomName(prefix string) *DeploymentBuilder
type Helper ¶ added in v0.10.2
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 ¶ added in v0.10.2
func (*Helper) DeploymentIsReady ¶ added in v0.13.0
func (*Helper) GetActiveReplicaSetForDeployment ¶ added in v0.10.2
func (h *Helper) GetActiveReplicaSetForDeployment(namespace, name string) (*appsv1.ReplicaSet, error)
func (*Helper) HasActiveReplicaSet ¶ added in v0.10.2
func (*Helper) HasCISKubeBenchReportOwnedBy ¶ added in v0.10.2
func (*Helper) HasConfigAuditReportOwnedBy ¶ added in v0.10.2
func (*Helper) HasVulnerabilityReportOwnedBy ¶ added in v0.10.2
func (*Helper) UpdateDeploymentImage ¶ added in v0.10.2
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 ¶ added in v0.10.2
func (b *PodBuilder) WithRandomName(prefix string) *PodBuilder
func (*PodBuilder) WithServiceAccountName ¶ added in v0.13.2
func (b *PodBuilder) WithServiceAccountName(name string) *PodBuilder
type PrivateRegistryConfig ¶ added in v0.13.2
type PrivateRegistryConfig struct { Server string `env:"STARBOARD_TEST_REGISTRY_SERVER"` Username string `env:"STARBOARD_TEST_REGISTRY_USERNAME"` Password string `env:"STARBOARD_TEST_REGISTRY_PASSWORD"` ImageRef string `env:"STARBOARD_TEST_REGISTRY_PRIVATE_IMAGE_REF"` }
func (*PrivateRegistryConfig) Parse ¶ added in v0.13.2
func (c *PrivateRegistryConfig) Parse() error
type SecretBuilder ¶ added in v0.13.2
type SecretBuilder struct {
// contains filtered or unexported fields
}
func NewDockerRegistrySecret ¶ added in v0.13.2
func NewDockerRegistrySecret() *SecretBuilder
func (*SecretBuilder) Build ¶ added in v0.13.2
func (b *SecretBuilder) Build() (*corev1.Secret, error)
func (*SecretBuilder) WithNamespace ¶ added in v0.13.2
func (b *SecretBuilder) WithNamespace(namespace string) *SecretBuilder
func (*SecretBuilder) WithPassword ¶ added in v0.13.2
func (b *SecretBuilder) WithPassword(password string) *SecretBuilder
func (*SecretBuilder) WithRandomName ¶ added in v0.13.2
func (b *SecretBuilder) WithRandomName(name string) *SecretBuilder
func (*SecretBuilder) WithServer ¶ added in v0.13.2
func (b *SecretBuilder) WithServer(server string) *SecretBuilder
func (*SecretBuilder) WithUsername ¶ added in v0.13.2
func (b *SecretBuilder) WithUsername(username string) *SecretBuilder
type ServiceAccountBuilder ¶ added in v0.13.2
type ServiceAccountBuilder struct {
// contains filtered or unexported fields
}
func NewServiceAccount ¶ added in v0.13.2
func NewServiceAccount() *ServiceAccountBuilder
func (*ServiceAccountBuilder) Build ¶ added in v0.13.2
func (b *ServiceAccountBuilder) Build() *corev1.ServiceAccount
func (*ServiceAccountBuilder) WithImagePullSecret ¶ added in v0.13.2
func (b *ServiceAccountBuilder) WithImagePullSecret(name string) *ServiceAccountBuilder
func (*ServiceAccountBuilder) WithNamespace ¶ added in v0.13.2
func (b *ServiceAccountBuilder) WithNamespace(namespace string) *ServiceAccountBuilder
func (*ServiceAccountBuilder) WithRandomName ¶ added in v0.13.2
func (b *ServiceAccountBuilder) WithRandomName(prefix string) *ServiceAccountBuilder
type VulnerabilityReportBuilder ¶
type VulnerabilityReportBuilder struct {
// contains filtered or unexported fields
}
func NewVulnerabilityReport ¶
func NewVulnerabilityReport() *VulnerabilityReportBuilder
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.