builder

package
v0.0.0-...-51b2d08 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildBuilder

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

BuildBuilder is a builder for appsv1.DeploymentConfig objects to be usebonly in unit tests.

func NewBuild

func NewBuild() *BuildBuilder

NewDeployment returns a new BuildBuilder to builbappsv1.DeploymentConfig objects. It is meant to be usebonly in unit tests.

func (*BuildBuilder) Build

func (b *BuildBuilder) Build() ocpv1.Build

func (*BuildBuilder) WithDockerImage

func (b *BuildBuilder) WithDockerImage(image string) *BuildBuilder

func (*BuildBuilder) WithName

func (b *BuildBuilder) WithName(name string) *BuildBuilder

func (*BuildBuilder) WithNamespace

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

type ClusterRoleBindingBuilder

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

ClusterRoleBindingBuilder is a builder for v1.ClusterRoleBinding objects to be used only in unit tests.

func NewClusterRoleBinding

func NewClusterRoleBinding() *ClusterRoleBindingBuilder

NewClusterRoleBinding returns a new ClusterRoleBindingBuilder to build v1.ClusterRoleBinding objects. It is meant to be used only in unit tests.

func (*ClusterRoleBindingBuilder) Build

func (*ClusterRoleBindingBuilder) WithName

func (*ClusterRoleBindingBuilder) WithRoleRef

func (c *ClusterRoleBindingBuilder) WithRoleRef(apiGroup string, kind string, name string) *ClusterRoleBindingBuilder

func (*ClusterRoleBindingBuilder) WithSubjects

func (c *ClusterRoleBindingBuilder) WithSubjects(subjects ...v1.Subject) *ClusterRoleBindingBuilder

type ContainerBuilder

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

ContainerBuilder is a builder for v1.Container objects to be used only in unit tests.

func NewContainer

func NewContainer() *ContainerBuilder

NewContainer returns a new ContainerBuilder to build v1.Container objects. It is meant to be used only in unit tests.

func (*ContainerBuilder) Build

func (c *ContainerBuilder) Build() v1.Container

func (*ContainerBuilder) WithImage

func (c *ContainerBuilder) WithImage(image string) *ContainerBuilder

func (*ContainerBuilder) WithSecurityContext

func (c *ContainerBuilder) WithSecurityContext(securityContext *v1.SecurityContext) *ContainerBuilder

func (*ContainerBuilder) WithVolumeMounts

func (c *ContainerBuilder) WithVolumeMounts(volumeMounts ...v1.VolumeMount) *ContainerBuilder

type DaemonSetBuilder

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

DaemonSetBuilder is a builder for appsv1.DaemonSet objects to be used only in unit tests.

func NewDaemonSet

func NewDaemonSet() *DaemonSetBuilder

NewDaemonSet returns a new DaemonSetBuilder to build appsv1.DaemonSet objects. It is meant to be used only in unit tests.

func (*DaemonSetBuilder) Build

func (d *DaemonSetBuilder) Build() appsv1.DaemonSet

func (*DaemonSetBuilder) WithName

func (d *DaemonSetBuilder) WithName(name string) *DaemonSetBuilder

func (*DaemonSetBuilder) WithNamespace

func (d *DaemonSetBuilder) WithNamespace(namespace string) *DaemonSetBuilder

func (*DaemonSetBuilder) WithPodSpec

func (d *DaemonSetBuilder) WithPodSpec(ps corev1.PodSpec) *DaemonSetBuilder

func (*DaemonSetBuilder) WithSelectorAndPodLabels

func (d *DaemonSetBuilder) WithSelectorAndPodLabels(entries map[string]string) *DaemonSetBuilder

type DeploymentBuilder

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

DeploymentBuilder is a builder for appsv1.Deployment objects to be used only in unit tests.

func NewDeployment

func NewDeployment() *DeploymentBuilder

NewDeployment returns a new DeploymentBuilder to build appsv1.Deployment objects. It is meant to be used only in unit tests.

func (*DeploymentBuilder) Build

func (d *DeploymentBuilder) Build() appsv1.Deployment

func (*DeploymentBuilder) WithName

func (d *DeploymentBuilder) WithName(name string) *DeploymentBuilder

func (*DeploymentBuilder) WithNamespace

func (d *DeploymentBuilder) WithNamespace(namespace string) *DeploymentBuilder

func (*DeploymentBuilder) WithPodSpec

func (d *DeploymentBuilder) WithPodSpec(ps corev1.PodSpec) *DeploymentBuilder

func (*DeploymentBuilder) WithReplicas

func (d *DeploymentBuilder) WithReplicas(num *int32) *DeploymentBuilder

func (*DeploymentBuilder) WithSelectorAndPodLabels

func (d *DeploymentBuilder) WithSelectorAndPodLabels(entries map[string]string) *DeploymentBuilder

type DeploymentConfigBuilder

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

DeploymentConfigBuilder is a builder for ocpv1.DeploymentConfig objects to be usedc only in unit tests.

func NewDeploymentConfig

func NewDeploymentConfig() *DeploymentConfigBuilder

NewDeployment returns a new DeploymentConfigBuilder to buildc ocpv1.DeploymentConfig objects. It is meant to be usedc only in unit tests.

func (*DeploymentConfigBuilder) Build

func (*DeploymentConfigBuilder) WithName

func (*DeploymentConfigBuilder) WithNamespace

func (dc *DeploymentConfigBuilder) WithNamespace(namespace string) *DeploymentConfigBuilder

func (*DeploymentConfigBuilder) WithPodSpec

func (*DeploymentConfigBuilder) WithReplicas

func (dc *DeploymentConfigBuilder) WithReplicas(num int32) *DeploymentConfigBuilder

func (*DeploymentConfigBuilder) WithSelectorAndPodLabels

func (dc *DeploymentConfigBuilder) WithSelectorAndPodLabels(entries map[string]string) *DeploymentConfigBuilder

type Jobbuilder

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

Jobbuilder is a builder for batchv1.Job objects to be used only in unit tests.

func NewJob

func NewJob() *Jobbuilder

NewJob returns a new Jobbuilder to build batchv1.Job objects. It is meant to be used only in unit tests.

func (*Jobbuilder) Build

func (j *Jobbuilder) Build() batchv1.Job

func (*Jobbuilder) WithName

func (j *Jobbuilder) WithName(name string) *Jobbuilder

func (*Jobbuilder) WithNamespace

func (j *Jobbuilder) WithNamespace(namespace string) *Jobbuilder

func (*Jobbuilder) WithPodLabels

func (j *Jobbuilder) WithPodLabels(entries map[string]string) *Jobbuilder

func (*Jobbuilder) WithPodSpec

func (j *Jobbuilder) WithPodSpec(ps corev1.PodSpec) *Jobbuilder

type NodeSelectorRequirementBuilder

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

NodeSelectorRequirementBuilder is a builder for v1.NodeSelectorRequirement objects to be used only in unit tests.

func NewNodeSelectorRequirement

func NewNodeSelectorRequirement() *NodeSelectorRequirementBuilder

NewNodeSelectorRequirement returns a new NodeSelectorRequirementBuilder to build v1.NodeSelectorRequirement objects. It is meant to be used only in unit tests.

func (*NodeSelectorRequirementBuilder) Build

func (*NodeSelectorRequirementBuilder) WithKeyAndValues

type NodeSelectorTermBuilder

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

NodeSelectorTermBuilder is a builder for v1.NodeSelectorTerm objects to be used only in unit tests.

func NewNodeSelectorTerm

func NewNodeSelectorTerm() *NodeSelectorTermBuilder

NewNodeSelectorTerm returns a new NodeSelectorTermBuilder to build v1.NodeSelectorTerm objects. It is meant to be used only in unit tests.

func (*NodeSelectorTermBuilder) Build

func (*NodeSelectorTermBuilder) WithMatchExpressions

func (n *NodeSelectorTermBuilder) WithMatchExpressions(values ...*v1.NodeSelectorRequirement) *NodeSelectorTermBuilder

func (*NodeSelectorTermBuilder) WithMatchFields

type PodBuilder

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

PodBuilder is a builder for v1.Pod objects to be used only in unit tests.

func NewPod

func NewPod() *PodBuilder

NewPod returns a new PodBuilder to build v1.Pod objects. It is meant to be used only in unit tests.

func (*PodBuilder) Build

func (p *PodBuilder) Build() v1.Pod

func (*PodBuilder) WithAffinity

func (p *PodBuilder) WithAffinity(initialAffinity *v1.Affinity) *PodBuilder

WithAffinity adds the affinity to the pod. If initialAffinity is not nil, it is used as the initial value of the pod's affinity. Otherwise, the pod's affinity is initialized to an empty affinity if it is nil.

func (*PodBuilder) WithContainersImages

func (p *PodBuilder) WithContainersImages(images ...string) *PodBuilder

func (*PodBuilder) WithGenerateName

func (p *PodBuilder) WithGenerateName(name string) *PodBuilder

func (*PodBuilder) WithImagePullSecrets

func (p *PodBuilder) WithImagePullSecrets(imagePullSecrets ...string) *PodBuilder

func (*PodBuilder) WithInitContainersImages

func (p *PodBuilder) WithInitContainersImages(images ...string) *PodBuilder

func (*PodBuilder) WithNamespace

func (p *PodBuilder) WithNamespace(namespace string) *PodBuilder

func (*PodBuilder) WithNodeAffinity

func (p *PodBuilder) WithNodeAffinity() *PodBuilder

func (*PodBuilder) WithNodeSelectorTermsMatchExpressions

func (p *PodBuilder) WithNodeSelectorTermsMatchExpressions(
	nodeSelectorTermsMatchExpressions ...[]v1.NodeSelectorRequirement) *PodBuilder

func (*PodBuilder) WithNodeSelectors

func (p *PodBuilder) WithNodeSelectors(kv ...string) *PodBuilder

func (*PodBuilder) WithRequiredDuringSchedulingIgnoredDuringExecution

func (p *PodBuilder) WithRequiredDuringSchedulingIgnoredDuringExecution() *PodBuilder

func (*PodBuilder) WithSchedulingGates

func (p *PodBuilder) WithSchedulingGates(schedulingGates ...string) *PodBuilder

type PodSpecBuilder

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

PodSpecBuilder is a builder for v1.PodSpec objects to be used only in unit tests.

func NewPodSpec

func NewPodSpec() *PodSpecBuilder

NewPodSpec returns a new PodSpecBuilder to build v1.PodSpec objects. It is meant to be used only in unit tests.

func (*PodSpecBuilder) Build

func (ps *PodSpecBuilder) Build() v1.PodSpec

func (*PodSpecBuilder) WithAffinity

func (ps *PodSpecBuilder) WithAffinity(initialAffinity *v1.Affinity) *PodSpecBuilder

WithAffinity adds the affinity to the pod. If initialAffinity is not nil, it is used as the initial value of the pod's affinity. Otherwise, the pod's affinity is initialized to an empty affinity if it is nil.

func (*PodSpecBuilder) WithContainers

func (ps *PodSpecBuilder) WithContainers(containers ...v1.Container) *PodSpecBuilder

func (*PodSpecBuilder) WithContainersImages

func (ps *PodSpecBuilder) WithContainersImages(images ...string) *PodSpecBuilder

func (*PodSpecBuilder) WithImagePullSecrets

func (ps *PodSpecBuilder) WithImagePullSecrets(imagePullSecrets ...string) *PodSpecBuilder

func (*PodSpecBuilder) WithInitContainersImages

func (ps *PodSpecBuilder) WithInitContainersImages(images ...string) *PodSpecBuilder

func (*PodSpecBuilder) WithNodeAffinity

func (ps *PodSpecBuilder) WithNodeAffinity() *PodSpecBuilder

func (*PodSpecBuilder) WithNodeSelectorTerms

func (ps *PodSpecBuilder) WithNodeSelectorTerms(nodeSelectorTerms ...v1.NodeSelectorTerm) *PodSpecBuilder

func (*PodSpecBuilder) WithNodeSelectors

func (ps *PodSpecBuilder) WithNodeSelectors(entries map[string]string) *PodSpecBuilder

func (*PodSpecBuilder) WithRequiredDuringSchedulingIgnoredDuringExecution

func (ps *PodSpecBuilder) WithRequiredDuringSchedulingIgnoredDuringExecution() *PodSpecBuilder

func (*PodSpecBuilder) WithRestartPolicy

func (ps *PodSpecBuilder) WithRestartPolicy(restartPolicy v1.RestartPolicy) *PodSpecBuilder

func (*PodSpecBuilder) WithSchedulingGates

func (ps *PodSpecBuilder) WithSchedulingGates(schedulingGates ...string) *PodSpecBuilder

func (*PodSpecBuilder) WithServiceAccountName

func (ps *PodSpecBuilder) WithServiceAccountName(serviceAccountName string) *PodSpecBuilder

func (*PodSpecBuilder) WithVolumes

func (ps *PodSpecBuilder) WithVolumes(volumes ...v1.Volume) *PodSpecBuilder

type SecurityContextBuilder

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

SecurityContextBuilder is a builder for v1.SecurityContext objects to be used only in unit tests.

func NewSecurityContext

func NewSecurityContext() *SecurityContextBuilder

NewSecurityContext returns a new SecurityContextBuilder to build v1.SecurityContext objects. It is meant to be used only in unit tests.

func (*SecurityContextBuilder) Build

func (*SecurityContextBuilder) WithPrivileged

func (s *SecurityContextBuilder) WithPrivileged(privileged *bool) *SecurityContextBuilder

func (*SecurityContextBuilder) WithRunAsGroup

func (s *SecurityContextBuilder) WithRunAsGroup(group *int64) *SecurityContextBuilder

func (*SecurityContextBuilder) WithRunAsUSer

func (s *SecurityContextBuilder) WithRunAsUSer(user *int64) *SecurityContextBuilder

func (*SecurityContextBuilder) WithSeccompProfileType

func (s *SecurityContextBuilder) WithSeccompProfileType(seccompProfileType v1.SeccompProfileType) *SecurityContextBuilder

type StatefulSetBuilder

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

StatefulSetBuilder is a builder for appsv1.StatefulSet objects to be used only in unit tests.

func NewStatefulSet

func NewStatefulSet() *StatefulSetBuilder

NewStatefulSet returns a new StatefulSetBuilder to build appsv1.StatefulSet objects. It is meant to be used only in unit tests.

func (*StatefulSetBuilder) Build

func (*StatefulSetBuilder) WithName

func (s *StatefulSetBuilder) WithName(name string) *StatefulSetBuilder

func (*StatefulSetBuilder) WithNamespace

func (s *StatefulSetBuilder) WithNamespace(namespace string) *StatefulSetBuilder

func (*StatefulSetBuilder) WithPodSpec

func (*StatefulSetBuilder) WithReplicas

func (s *StatefulSetBuilder) WithReplicas(num *int32) *StatefulSetBuilder

func (*StatefulSetBuilder) WithSelectorAndPodLabels

func (s *StatefulSetBuilder) WithSelectorAndPodLabels(entries map[string]string) *StatefulSetBuilder

type SubjectBuilder

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

DeploymentBuilder is a builder for v1.Subject objects to be used only in unit tests.

func NewSubject

func NewSubject() *SubjectBuilder

NewSubject returns a new DeploymentBuilder to build v1.Subject objects. It is meant to be used only in unit tests.

func (*SubjectBuilder) Build

func (s *SubjectBuilder) Build() v1.Subject

func (*SubjectBuilder) WithKind

func (s *SubjectBuilder) WithKind(kind string) *SubjectBuilder

func (*SubjectBuilder) WithName

func (s *SubjectBuilder) WithName(name string) *SubjectBuilder

func (*SubjectBuilder) WithNamespace

func (s *SubjectBuilder) WithNamespace(namespace string) *SubjectBuilder

type VolumeBuilder

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

VolumeBuilder is a builder for v1.Volume objects to be used only in unit tests.

func NewVolume

func NewVolume() *VolumeBuilder

NewVolume returns a new VolumeBuilder to build v1.Volume objects. It is meant to be used only in unit tests.

func (*VolumeBuilder) Build

func (v *VolumeBuilder) Build() v1.Volume

func (*VolumeBuilder) WithName

func (v *VolumeBuilder) WithName(name string) *VolumeBuilder

func (*VolumeBuilder) WithVolumeSourceHostPath

func (v *VolumeBuilder) WithVolumeSourceHostPath(path string, pathType *v1.HostPathType) *VolumeBuilder

type VolumeMountBuilder

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

VolumeMountBuilder is a builder for v1.VolumeMount objects to be used only in unit tests.

func NewVolumeMount

func NewVolumeMount() *VolumeMountBuilder

NewVolumeMount returns a new VolumeMountBuilder to build v1.VolumeMount objects. It is meant to be used only in unit tests.

func (*VolumeMountBuilder) Build

func (v *VolumeMountBuilder) Build() v1.VolumeMount

func (*VolumeMountBuilder) WithMountPath

func (v *VolumeMountBuilder) WithMountPath(path string) *VolumeMountBuilder

func (*VolumeMountBuilder) WithName

func (v *VolumeMountBuilder) WithName(name string) *VolumeMountBuilder

Jump to

Keyboard shortcuts

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