k8s

package
v1.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFakeDiscoveryClient

func NewFakeDiscoveryClient(err error) discovery.DiscoveryInterface

NewFakeDiscoveryClient creates a new DiscoveryClient.

Types

type ClientMethod

type ClientMethod string

ClientMethod is a name of the method on client.Client for which an error is recorded.

const (
	// ClientMethodList is the name of the List method on client.Client.
	ClientMethodList ClientMethod = "List"
)

type ErrorsForGVK

type ErrorsForGVK struct {
	GVK          schema.GroupVersionKind
	DeleteAllErr *apierrors.StatusError
	ListErr      *apierrors.StatusError
}

ErrorsForGVK contains the recorded errors for a specific GroupVersionKind.

type FakeClientBuilder

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

FakeClientBuilder builds a client.Client which will also react to the configured errors.

func NewFakeClientBuilder

func NewFakeClientBuilder(existingObjects ...client.Object) *FakeClientBuilder

NewFakeClientBuilder creates a new instance of FakeClientBuilder.

func (*FakeClientBuilder) Build

func (b *FakeClientBuilder) Build() client.Client

Build creates a new instance of client.Client which will react to the configured errors.

func (*FakeClientBuilder) RecordErrorForObjectsWithGVK

func (b *FakeClientBuilder) RecordErrorForObjectsWithGVK(method ClientMethod, namespace string, gvk schema.GroupVersionKind, err *apierrors.StatusError) *FakeClientBuilder

RecordErrorForObjectsWithGVK records an error for a specific client.Client method and objects in a given namespace of a given GroupVersionKind.

func (*FakeClientBuilder) WithScheme

func (b *FakeClientBuilder) WithScheme(scheme *runtime.Scheme) *FakeClientBuilder

WithScheme sets the scheme for the client.

Jump to

Keyboard shortcuts

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