Documentation ¶
Index ¶
- type ControllerClientBuilder
- type DynamicControllerClientBuilder
- func (t *DynamicControllerClientBuilder) Client(name string) (clientset.Interface, error)
- func (t *DynamicControllerClientBuilder) ClientOrDie(name string) clientset.Interface
- func (t *DynamicControllerClientBuilder) Config(saName string) (*restclient.Config, error)
- func (t *DynamicControllerClientBuilder) ConfigOrDie(name string) *restclient.Config
- func (t *DynamicControllerClientBuilder) DiscoveryClient(name string) (discovery.DiscoveryInterface, error)
- func (t *DynamicControllerClientBuilder) DiscoveryClientOrDie(name string) discovery.DiscoveryInterface
- type SimpleControllerClientBuilder
- func (b SimpleControllerClientBuilder) Client(name string) (clientset.Interface, error)
- func (b SimpleControllerClientBuilder) ClientOrDie(name string) clientset.Interface
- func (b SimpleControllerClientBuilder) Config(name string) (*restclient.Config, error)
- func (b SimpleControllerClientBuilder) ConfigOrDie(name string) *restclient.Config
- func (b SimpleControllerClientBuilder) DiscoveryClient(name string) (discovery.DiscoveryInterface, error)
- func (b SimpleControllerClientBuilder) DiscoveryClientOrDie(name string) discovery.DiscoveryInterface
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 (t *DynamicControllerClientBuilder) Client(name string) (clientset.Interface, error)
func (*DynamicControllerClientBuilder) ClientOrDie ¶ added in v0.21.0
func (t *DynamicControllerClientBuilder) ClientOrDie(name string) clientset.Interface
func (*DynamicControllerClientBuilder) Config ¶ added in v0.21.0
func (t *DynamicControllerClientBuilder) Config(saName string) (*restclient.Config, error)
func (*DynamicControllerClientBuilder) ConfigOrDie ¶ added in v0.21.0
func (t *DynamicControllerClientBuilder) ConfigOrDie(name string) *restclient.Config
func (*DynamicControllerClientBuilder) DiscoveryClient ¶ added in v0.21.0
func (t *DynamicControllerClientBuilder) DiscoveryClient(name string) (discovery.DiscoveryInterface, error)
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 ¶
func (b SimpleControllerClientBuilder) Client(name string) (clientset.Interface, error)
Client returns a clientset.Interface built from the ClientBuilder
func (SimpleControllerClientBuilder) ClientOrDie ¶
func (b SimpleControllerClientBuilder) ClientOrDie(name string) clientset.Interface
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 ¶
func (b SimpleControllerClientBuilder) Config(name string) (*restclient.Config, error)
Config returns a client config for a fixed client
func (SimpleControllerClientBuilder) ConfigOrDie ¶
func (b SimpleControllerClientBuilder) ConfigOrDie(name string) *restclient.Config
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
func (b SimpleControllerClientBuilder) DiscoveryClient(name string) (discovery.DiscoveryInterface, error)
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
func (b SimpleControllerClientBuilder) DiscoveryClientOrDie(name string) discovery.DiscoveryInterface
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.