Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var APIServerConfig = NewSingleton[*server.Config](nil)
APIServerConfig the global server.Config for APIServer to use
View Source
var DynamicClient = NewSingletonE[dynamic.Interface](func() (dynamic.Interface, error) { return dynamic.NewForConfig(KubeConfig.Get()) })
DynamicClient .
View Source
var GenericAPIServer = NewSingleton[*builder.GenericAPIServer](nil)
GenericAPIServer .
View Source
var KubeClient = NewSingletonE[client.Client](func() (client.Client, error) { return client.New(KubeConfig.Get(), client.Options{ Scheme: scheme.Scheme, Mapper: RESTMapper.Get(), }) })
KubeClient .
View Source
var KubeConfig = NewSingleton[*rest.Config](func() *rest.Config { cfg := config.GetConfigOrDie() cfg.UserAgent = UserAgent.Get() return cfg })
KubeConfig .
View Source
var RESTMapper = NewSingletonE[meta.RESTMapper](func() (meta.RESTMapper, error) { return apiutil.NewDiscoveryRESTMapper(KubeConfig.Get()) })
RESTMapper .
View Source
var StaticClient = NewSingletonE[kubernetes.Interface](func() (kubernetes.Interface, error) { return kubernetes.NewForConfig(KubeConfig.Get()) })
StaticClient .
View Source
var UserAgent = NewSingleton[string](nil)
UserAgent .
Functions ¶
func InitGenericAPIServer ¶
func InitGenericAPIServer(server *builder.GenericAPIServer) *builder.GenericAPIServer
InitGenericAPIServer load the global unique GenericAPIServer
func InitServerConfig ¶
func InitServerConfig(config *server.RecommendedConfig) *server.RecommendedConfig
InitServerConfig initialize APIServerConfig
func ReloadClients ¶
func ReloadClients()
ReloadClients should be called when KubeConfig is called to update related clients
Types ¶
type Singleton ¶
type Singleton[T any] struct { // contains filtered or unexported fields }
Singleton global unique data struct
func NewSingleton ¶
NewSingleton create a new singleton with loader
func NewSingletonE ¶
NewSingletonE create a new singleton with error-returned loader
Click to show internal directories.
Click to hide internal directories.