fake

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: Apache-2.0 Imports: 23 Imported by: 2

Documentation

Overview

Copyright 2019 Red Hat, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

This package has the automatically generated fake clientset.

Index

Constants

This section is empty.

Variables

View Source
var AddToScheme = localSchemeBuilder.AddToScheme

AddToScheme adds all types of this clientset into the given scheme. This allows composition of clientsets, like in:

import (
  "k8s.io/client-go/kubernetes"
  clientsetscheme "k8s.io/client-go/kubernetes/scheme"
  aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
)

kclientset, _ := kubernetes.NewForConfig(c)
_ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)

After this, RawExtensions in Kubernetes types will serialize kube-aggregator types correctly.

Functions

This section is empty.

Types

type Clientset

type Clientset struct {
	testing.Fake
	// contains filtered or unexported fields
}

Clientset implements clientset.Interface. Meant to be embedded into a struct to get a default implementation. This makes faking out just the method you want to test easier.

func NewSimpleClientset

func NewSimpleClientset(objects ...runtime.Object) *Clientset

NewSimpleClientset returns a clientset that will respond with the provided objects. It's backed by a very simple object tracker that processes creates, updates and deletions as-is, without applying any validations and/or defaults. It shouldn't be considered a replacement for a real clientset and is mostly useful in simple unit tests.

func (*Clientset) Discovery

func (c *Clientset) Discovery() discovery.DiscoveryInterface

func (*Clientset) OperatorsV1

func (c *Clientset) OperatorsV1() operatorsv1.OperatorsV1Interface

OperatorsV1 retrieves the OperatorsV1Client

func (*Clientset) OperatorsV1alpha1

OperatorsV1alpha1 retrieves the OperatorsV1alpha1Client

func (*Clientset) OperatorsV1alpha2

OperatorsV1alpha2 retrieves the OperatorsV1alpha2Client

func (*Clientset) OperatorsV2 added in v0.18.3

func (c *Clientset) OperatorsV2() operatorsv2.OperatorsV2Interface

OperatorsV2 retrieves the OperatorsV2Client

func (*Clientset) Tracker

func (c *Clientset) Tracker() testing.ObjectTracker

type ClientsetDecorator

type ClientsetDecorator interface {
	// PrependReactor adds a reactor to the beginning of the chain.
	PrependReactor(verb, resource string, reaction testing.ReactionFunc)
}

ClientsetDecorator defines decorator methods for a Clientset.

type ReactionForwardingClientsetDecorator

type ReactionForwardingClientsetDecorator struct {
	Clientset
	ReactionChain []testing.Reactor // shadow embedded ReactionChain
	// contains filtered or unexported fields
}

ReactionForwardingClientsetDecorator wraps a Clientset and "forwards" Action object mutations from all successful non-handling Reactors along the chain to the first handling Reactor. This is is a stopgap until we can upgrade to client-go v11.0, where the behavior is the default (see https://github.com/kubernetes/client-go/blob/6ee68ca5fd8355d024d02f9db0b3b667e8357a0f/testing/fake.go#L130).

func NewReactionForwardingClientsetDecorator

func NewReactionForwardingClientsetDecorator(objects []runtime.Object, options ...clientfake.Option) *ReactionForwardingClientsetDecorator

NewReactionForwardingClientsetDecorator returns the ReactionForwardingClientsetDecorator wrapped Clientset result of calling NewSimpleClientset with the given objects.

func (*ReactionForwardingClientsetDecorator) PrependReactor

func (c *ReactionForwardingClientsetDecorator) PrependReactor(verb, resource string, reaction testing.ReactionFunc)

PrependReactor adds a reactor to the beginning of the chain.

Jump to

Keyboard shortcuts

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