helper

package
v0.15.22 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

The helper package provides builders to instantiate Kubernetes objects used in integration tests.

Index

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 NewHelper added in v0.10.2

func NewHelper(client client.Client) *Helper

func (*Helper) DeleteConfigAuditReportOwnedBy added in v0.10.2

func (h *Helper) DeleteConfigAuditReportOwnedBy(obj client.Object) error

func (*Helper) DeploymentIsReady added in v0.13.0

func (h *Helper) DeploymentIsReady(deploy client.ObjectKey) func() (bool, error)

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 (h *Helper) HasActiveReplicaSet(namespace, name string) func() (bool, error)

func (*Helper) HasCISKubeBenchReportOwnedBy added in v0.10.2

func (h *Helper) HasCISKubeBenchReportOwnedBy(node corev1.Node) func() (bool, error)

func (*Helper) HasConfigAuditReportOwnedBy added in v0.10.2

func (h *Helper) HasConfigAuditReportOwnedBy(obj client.Object) func() (bool, error)

func (*Helper) HasVulnerabilityReportOwnedBy added in v0.10.2

func (h *Helper) HasVulnerabilityReportOwnedBy(obj client.Object) func() (bool, error)

func (*Helper) UpdateDeploymentImage added in v0.10.2

func (h *Helper) UpdateDeploymentImage(namespace, name string) error

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 (*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 (*VulnerabilityReportBuilder) WithName

func (*VulnerabilityReportBuilder) WithNamespace

func (b *VulnerabilityReportBuilder) WithNamespace(namespace string) *VulnerabilityReportBuilder

func (*VulnerabilityReportBuilder) WithOwnerKind

func (*VulnerabilityReportBuilder) WithOwnerName

Jump to

Keyboard shortcuts

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