discoverytesting

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 26, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

New returns a new cmdtesting.FakeCachedDiscoveryClient with a small set of API groups and resources. It includes some of the core group and the autoscaling group, with their respective resources.

func NewProcedural

func NewProcedural(groups, versionsPerGroup, resourcesPerVersion int) *cmdtesting.FakeCachedDiscoveryClient

NewProcedural creates a new cmdtesting.FakeCachedDiscoveryClient with a procedural generation of API groups, versions, and resources. The groups will be named "group0", "group1", etc., and each group will have a specified number of versions. Each group will have versions named "v1", "v2", etc., with the highest version number of being set as the preferred version. Each group version will have a specified number of resources, named "resource0", "resource1", etc.. Each resource will be namespaced, have the verbs "get", "list", and "watch", and belong to the "all" category. No subresources will be included. Only the resources from the preferred version of each group will be included in the preferred resources list.

Types

type FakeCachedDiscoveryClientBuilder

type FakeCachedDiscoveryClientBuilder struct {
	// Groups contains the API groups to be returned by the discovery client.
	Groups []*metav1.APIGroup
	// Resources contains the API resources to be returned by the discovery client.
	Resources []*metav1.APIResourceList
	// PreferredResources contains the preferred API resources to be returned by the discovery client.
	PreferredResources []*metav1.APIResourceList
}

FakeCachedDiscoveryClientBuilder is a builder for a discovery client.

func NewFakeCachedDiscoveryClientBuilder

func NewFakeCachedDiscoveryClientBuilder() *FakeCachedDiscoveryClientBuilder

NewFakeCachedDiscoveryClientBuilder creates a new FakeCachedDiscoveryClientBuilder.

func (*FakeCachedDiscoveryClientBuilder) CachedDiscoveryInterface

CachedDiscoveryInterface returns the discovery client built by this builder.

Jump to

Keyboard shortcuts

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