clientbuilder

package
v0.21.6 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2021 License: Apache-2.0 Imports: 20 Imported by: 30

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ControllerClientBuilder

type ControllerClientBuilder interface {
	Config(name string) (*restclient.Config, error)
	ConfigOrDie(name string) *restclient.Config
	Client(name string) (clientset.Interface, error)
	ClientOrDie(name string) clientset.Interface
	DiscoveryClient(name string) (discovery.DiscoveryInterface, error)
	DiscoveryClientOrDie(name string) discovery.DiscoveryInterface
}

ControllerClientBuilder allows you to get clients and configs for controllers Please note a copy also exists in staging/src/k8s.io/cloud-provider/cloud.go TODO: Extract this into a separate controller utilities repo (issues/68947)

func NewDynamicClientBuilder added in v0.21.0

func NewDynamicClientBuilder(clientConfig *restclient.Config, coreClient v1core.CoreV1Interface, ns string) ControllerClientBuilder

NewDynamicClientBuilder returns client builder which uses TokenRequest feature and refresh service account token periodically

func NewTestDynamicClientBuilder added in v0.21.0

func NewTestDynamicClientBuilder(clientConfig *restclient.Config, coreClient v1core.CoreV1Interface, ns string, expirationSeconds int64, leewayPercent int) ControllerClientBuilder

this function only for test purpose, don't call it

type DynamicControllerClientBuilder added in v0.21.0

type DynamicControllerClientBuilder struct {
	// ClientConfig is a skeleton config to clone and use as the basis for each controller client
	ClientConfig *restclient.Config

	// CoreClient is used to provision service accounts if needed and watch for their associated tokens
	// to construct a controller client
	CoreClient v1core.CoreV1Interface

	// Namespace is the namespace used to host the service accounts that will back the
	// controllers.  It must be highly privileged namespace which normal users cannot inspect.
	Namespace string
	// contains filtered or unexported fields
}

func (*DynamicControllerClientBuilder) Client added in v0.21.0

func (*DynamicControllerClientBuilder) ClientOrDie added in v0.21.0

func (*DynamicControllerClientBuilder) Config added in v0.21.0

func (*DynamicControllerClientBuilder) ConfigOrDie added in v0.21.0

func (*DynamicControllerClientBuilder) DiscoveryClient added in v0.21.0

func (*DynamicControllerClientBuilder) DiscoveryClientOrDie added in v0.21.0

func (t *DynamicControllerClientBuilder) DiscoveryClientOrDie(name string) discovery.DiscoveryInterface

type SimpleControllerClientBuilder

type SimpleControllerClientBuilder struct {
	// ClientConfig is a skeleton config to clone and use as the basis for each controller client
	ClientConfig *restclient.Config
}

SimpleControllerClientBuilder returns a fixed client with different user agents

func (SimpleControllerClientBuilder) Client

Client returns a clientset.Interface built from the ClientBuilder

func (SimpleControllerClientBuilder) ClientOrDie

ClientOrDie returns a clientset.interface built from the ClientBuilder with no error. If it gets an error getting the client, it will log the error and kill the process it's running in.

func (SimpleControllerClientBuilder) Config

Config returns a client config for a fixed client

func (SimpleControllerClientBuilder) ConfigOrDie

ConfigOrDie returns a client config if no error from previous config func. If it gets an error getting the client, it will log the error and kill the process it's running in.

func (SimpleControllerClientBuilder) DiscoveryClient added in v0.21.0

DiscoveryClientOrDie returns a discovery.DiscoveryInterface built from the ClientBuilder Discovery is special because it will artificially pump the burst quite high to handle the many discovery requests.

func (SimpleControllerClientBuilder) DiscoveryClientOrDie added in v0.21.0

DiscoveryClientOrDie returns a discovery.DiscoveryInterface built from the ClientBuilder with no error. Discovery is special because it will artificially pump the burst quite high to handle the many discovery requests. If it gets an error getting the client, it will log the error and kill the process it's running in.

Jump to

Keyboard shortcuts

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