clientbuilder

package
v0.21.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2020 License: Apache-2.0 Imports: 19 Imported by: 30

Documentation

Index

Constants

View Source
const (
	// SecretTypeField is copied from pkg/apis/cores/field_constants.go
	SecretTypeField = "type"
)

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
}

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)

type SAControllerClientBuilder

type SAControllerClientBuilder 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

	// AuthenticationClient is used to check API tokens to make sure they are valid before
	// building a controller client from them
	AuthenticationClient v1authentication.AuthenticationV1Interface

	// 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
}

SAControllerClientBuilder is a ControllerClientBuilder that returns clients identifying as service accounts

func (SAControllerClientBuilder) Client

Client returns clientset.Interface built from ClientBuilder

func (SAControllerClientBuilder) ClientOrDie

ClientOrDie will return clientset.Interface built from ClientBuilder. If it gets an error getting the client, it will log the error and kill the process it's running in.

func (SAControllerClientBuilder) Config

Config returns a complete clientConfig for constructing clients. This is separate in anticipation of composition which means that not all clientsets are known here

func (SAControllerClientBuilder) ConfigOrDie

func (b SAControllerClientBuilder) ConfigOrDie(name string) *restclient.Config

ConfigOrDie returns clientConfig for constructing clients. If it gets an error, it will log the error and kill the process it's running in.

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.

Jump to

Keyboard shortcuts

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