package clientbuilder
import "k8s.io/controller-manager/pkg/clientbuilder"
Index ¶
- type ControllerClientBuilder
- func NewDynamicClientBuilder(clientConfig *restclient.Config, coreClient v1core.CoreV1Interface, ns string) ControllerClientBuilder
- func NewTestDynamicClientBuilder(clientConfig *restclient.Config, coreClient v1core.CoreV1Interface, ns string, expirationSeconds int64, leewayPercent int) 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
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 ¶
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 ¶
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 ¶
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 ¶
func (t *DynamicControllerClientBuilder) Client(name string) (clientset.Interface, error)
func (*DynamicControllerClientBuilder) ClientOrDie ¶
func (t *DynamicControllerClientBuilder) ClientOrDie(name string) clientset.Interface
func (*DynamicControllerClientBuilder) Config ¶
func (t *DynamicControllerClientBuilder) Config(saName string) (*restclient.Config, error)
func (*DynamicControllerClientBuilder) ConfigOrDie ¶
func (t *DynamicControllerClientBuilder) ConfigOrDie(name string) *restclient.Config
func (*DynamicControllerClientBuilder) DiscoveryClient ¶
func (t *DynamicControllerClientBuilder) DiscoveryClient(name string) (discovery.DiscoveryInterface, error)
func (*DynamicControllerClientBuilder) DiscoveryClientOrDie ¶
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 ¶
func (b SimpleControllerClientBuilder) DiscoveryClient(name string) (discovery.DiscoveryInterface, error)
DiscoveryClient 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 ¶
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.
Source Files ¶
client_builder.go client_builder_dynamic.go
- Version
- v0.32.2 (latest)
- Published
- Feb 13, 2025
- Platform
- linux/amd64
- Imports
- 20 packages
- Last checked
- 2 months ago –
Tools for package owners.