helper

package
v0.0.0-...-7c36f52 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2023 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

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 NewHelper

func NewHelper(client client.Client) *Helper

func (*Helper) DeleteConfigAuditReportOwnedBy

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

func (*Helper) DeploymentIsReady

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

func (*Helper) GetActiveReplicaSetForDeployment

func (h *Helper) GetActiveReplicaSetForDeployment(namespace, name string) (*appsv1.ReplicaSet, error)

func (*Helper) HasActiveReplicaSet

func (h *Helper) HasActiveReplicaSet(namespace, name string) func() (bool, error)

func (*Helper) HasCISKubeBenchReportOwnedBy

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

func (*Helper) HasConfigAuditReportOwnedBy

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

func (*Helper) HasVulnerabilityReportOwnedBy

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

func (*Helper) UpdateDeploymentImage

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

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:"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

func (c *PrivateRegistryConfig) Parse() error

type SecretBuilder

type SecretBuilder struct {
	// contains filtered or unexported fields
}

func NewDockerRegistrySecret

func NewDockerRegistrySecret() *SecretBuilder

func (*SecretBuilder) Build

func (b *SecretBuilder) Build() (*corev1.Secret, error)

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 NewServiceAccount

func NewServiceAccount() *ServiceAccountBuilder

func (*ServiceAccountBuilder) Build

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 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