v0.1.0 Latest Latest

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

Go to latest
Published: Feb 17, 2020 License: Apache-2.0 Imports: 22 Imported by: 0




This section is empty.


This section is empty.


func ClusterRole

func ClusterRole(name string) *v1beta1.ClusterRole

ClusterRole creates a fake ClusterRole with defined name

func GenerateNameReactor

func GenerateNameReactor(randomLength int64) testing.ReactionFunc

GenerateNameReactor returns a new ReactionFunc simulating resource name generation via `metadata.generateName` as performed by a K8s API Server. If `metadata.name` is NOT set and `metadata.generateName` is set to a non-empty string, this reactor sets `metadata.name` to the value of `metadata.generateName` with a random alphanumeric suffix of the given length appended. Note that the returned reactor does not guarantee uniqueness - it might generate a name that is already used in the fake clientset.

func Namespace

func Namespace(name string) *v1.Namespace

Namespace creates a fake namespace with defined name.

func NamespaceWithAnnotations

func NamespaceWithAnnotations(name string, annotations map[string]string) *v1.Namespace

NamespaceWithAnnotations creates a fake namespace with defined name and annotations.

func NewCreationTimestampReactor

func NewCreationTimestampReactor() testing.ReactionFunc

NewCreationTimestampReactor returns a new ReactorFunc setting the creation time

func NewErrorReactor

func NewErrorReactor(expectedErr error) testing.ReactionFunc

NewErrorReactor returns a new ReactorFunc returning an error

func ObjectKey

func ObjectKey(name string, namespace string) string

ObjectKey returns a fake key string with a given name and namespace

func ObjectMeta

func ObjectMeta(name string, namespace string) metav1.ObjectMeta

ObjectMeta returns a fake ObjectMeta with a given name and namespace

func PipelineRun

func PipelineRun(name string, namespace string, spec api.PipelineSpec) *api.PipelineRun

PipelineRun creates a new pipeline run object.

func SecretOpaque

func SecretOpaque(name string, namespace string) *v1.Secret

SecretOpaque creates a fake secret with defined name and type Opaque

func SecretWithType

func SecretWithType(name string, namespace string, secretType v1.SecretType) *v1.Secret

SecretWithType creates a fake secret with defined name

func ServiceAccount

func ServiceAccount(name string, namespace string) *v1.ServiceAccount

ServiceAccount dummy

func Tenant

func Tenant(tenantID, namespace string) *api.Tenant

Tenant creates a new fake tenant object.


type ClientFactory

type ClientFactory struct {
	// contains filtered or unexported fields

ClientFactory is a factory for fake clients.

func NewClientFactory

func NewClientFactory(objects ...runtime.Object) *ClientFactory

NewClientFactory creates a new ClientFactory

func (*ClientFactory) CheckTimeOrder

func (f *ClientFactory) CheckTimeOrder(start metav1.Time, end metav1.Time) bool

CheckTimeOrder checks if the duration between start and end is at least one sleep duration long.

func (*ClientFactory) CoreV1

func (f *ClientFactory) CoreV1() corev1.CoreV1Interface

CoreV1 returns fake CoreV1 clients

func (*ClientFactory) KubernetesClientset

func (f *ClientFactory) KubernetesClientset() *kubernetes.Clientset

KubernetesClientset returns the Kubernetes fake clientset.

func (*ClientFactory) RbacV1beta1

RbacV1beta1 returns fake RbacV1beta1 clients

func (*ClientFactory) Sleep

func (f *ClientFactory) Sleep(message string)

Sleep sleeps and logs the start and the end of the sleep.

func (*ClientFactory) StewardClientset

func (f *ClientFactory) StewardClientset() *steward.Clientset

StewardClientset returns the Steward fake clientset.

func (*ClientFactory) StewardInformerFactory

func (f *ClientFactory) StewardInformerFactory() stewardinformer.SharedInformerFactory

StewardInformerFactory returns the informer factory for Steward

func (*ClientFactory) StewardV1alpha1

StewardV1alpha1 returns Steward clients.

func (*ClientFactory) TektonClientset

func (f *ClientFactory) TektonClientset() *tektonclientfake.Clientset

TektonClientset returns the Tekton fake clientset.

func (*ClientFactory) TektonInformerFactory

func (f *ClientFactory) TektonInformerFactory() tektoninformers.SharedInformerFactory

TektonInformerFactory returns the Tekton informer factory

func (*ClientFactory) TektonV1alpha1

TektonV1alpha1 returns the Tekton v1alpha1 client

Jump to

Keyboard shortcuts

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