testutils

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package testutils contains shared functionality for unit tests which are not included in build artifacts

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConfigMap

func NewConfigMap(name string, namespace string) *coreV1.ConfigMap

NewConfigMap creates a basic ConfigMap instance having the provided namespace and name

func NewDeployment

func NewDeployment(name string, namespace string) *appsV1.Deployment

NewDeployment is a helper to build a new Deployment instance

func NewFakeDynamic

func NewFakeDynamic(objs ...runtime.Object) (*dynamicfake.FakeDynamicClient, error)

NewFakeDynamic creates a new instance of a fake dynamic client with a default scheme

func NewIngress

func NewIngress(name string, namespace string) *networkV1.Ingress

NewIngress is a helper to build a new Ingress instance

func NewJob

func NewJob(name string, namespace string) *batchv1.Job

NewJob is a helper to build a new Job instance

func NewJobWithStatus

func NewJobWithStatus(name string, namespace string, status string) *batchv1.Job

NewJobWithStatus creates a job with a given condition

func NewNamespace

func NewNamespace(name string) *coreV1.Namespace

NewNamespace is a helper to build a new Namespace instance

func NewNodes

func NewNodes(name string) *coreV1.Node

NewNodes is a helper to build a new Node instance

func NewPersistentVolume

func NewPersistentVolume(name string) *coreV1.PersistentVolume

NewPersistentVolume is a helper to build a new PersistentVolume instance

func NewPersistentVolumeClaim

func NewPersistentVolumeClaim(name string, namespace string) *coreV1.PersistentVolumeClaim

NewPersistentVolumeClaim is a helper to build a new PersistentVolumeClaim instance

func NewPod

func NewPod(name string, namespace string) *coreV1.Pod

NewPod is a helper to build a new Pod instance

func NewPodWithStatus

func NewPodWithStatus(name string, namespace string, phase string) *coreV1.Pod

NewPodWithStatus is a helper for building Pods with a given Status

func NewSecret

func NewSecret(name string, namespace string) *coreV1.Secret

NewSecret is a helper to build a new Secret instance

func NewService

func NewService(name string, namespace string) *coreV1.Service

NewService is a helper to build a new Service instance

func PodWithEphemeralContainerStatus

func PodWithEphemeralContainerStatus(name string, namespace string, container string, state string) *coreV1.Pod

PodWithEphemeralContainerStatus is a helper for building Pods with an ephemeral container having the given Status

Types

type FakeRESTMapper added in v0.0.5

type FakeRESTMapper struct {
	meta.RESTMapper
}

func (*FakeRESTMapper) RESTMapping added in v0.0.5

func (f *FakeRESTMapper) RESTMapping(gk schema.GroupKind, versions ...string) (*meta.RESTMapping, error)

Jump to

Keyboard shortcuts

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