Documentation ¶
Index ¶
- Constants
- func ConvertRestConfigToAPIConfig(restConfig *rest.Config) *clientcmdapi.Config
- func GetBearerToken(req *http.Request) string
- func GetKarmadaClientFromRequest(request *http.Request) (karmadaclientset.Interface, error)
- func GetKarmadaConfig() (*rest.Config, *clientcmdapi.Config, error)
- func GetKubeConfig() (*rest.Config, *clientcmdapi.Config, error)
- func GetMemberConfig() (*rest.Config, error)
- func HasAuthorizationHeader(req *http.Request) bool
- func InClusterClient() kubeclient.Interface
- func InClusterClientForKarmadaApiServer() kubeclient.Interface
- func InClusterClientForMemberCluster(clusterName string) kubeclient.Interface
- func InClusterKarmadaClient() karmadaclientset.Interface
- func InitKarmadaConfig(options ...Option)
- func InitKubeConfig(options ...Option)
- func KubeClientSetFromKubeConfig(kubeconfig string) (*kubeclient.Clientset, error)
- func LoadApiConfig(kubeconfig string, currentContext string) (*clientcmdapi.Config, error)
- func LoadRestConfig(kubeconfig string, context string) (*rest.Config, error)
- func LoadeRestConfigFromKubeConfig(kubeconfig string) (*rest.Config, error)
- func SetAuthorizationHeader(req *http.Request, token string)
- type Option
- type ResourceVerber
Constants ¶
View Source
const ( // DefaultQPS is the default globalClient QPS configuration. High enough QPS to fit all expected use cases. // QPS=0 is not set here, because globalClient code is overriding it. DefaultQPS = 1e6 // DefaultBurst is the default globalClient burst configuration. High enough Burst to fit all expected use cases. // Burst=0 is not set here, because globalClient code is overriding it. DefaultBurst = 1e6 // DefaultUserAgent is the default http header for user-agent DefaultUserAgent = "dashboard" // DefaultCmdConfigName is the default cluster/context/auth name to be set in clientcmd config DefaultCmdConfigName = "kubernetes" // ImpersonateUserHeader is the header name to identify username to act as. ImpersonateUserHeader = "Impersonate-User" // ImpersonateGroupHeader is the header name to identify group name to act as. // Can be provided multiple times to set multiple groups. ImpersonateGroupHeader = "Impersonate-Group" // ImpersonateUserExtraHeader is the header name used to associate extra fields with the user. // It is optional, and it requires ImpersonateUserHeader to be set. ImpersonateUserExtraHeader = "Impersonate-Extra-" )
Variables ¶
This section is empty.
Functions ¶
func ConvertRestConfigToAPIConfig ¶
func ConvertRestConfigToAPIConfig(restConfig *rest.Config) *clientcmdapi.Config
func GetBearerToken ¶
func GetKarmadaClientFromRequest ¶
func GetKarmadaClientFromRequest(request *http.Request) (karmadaclientset.Interface, error)
func GetKarmadaConfig ¶
func GetKarmadaConfig() (*rest.Config, *clientcmdapi.Config, error)
func GetKubeConfig ¶
func GetKubeConfig() (*rest.Config, *clientcmdapi.Config, error)
func GetMemberConfig ¶
func HasAuthorizationHeader ¶
func InClusterClient ¶
func InClusterClient() kubeclient.Interface
func InClusterClientForKarmadaApiServer ¶
func InClusterClientForKarmadaApiServer() kubeclient.Interface
func InClusterClientForMemberCluster ¶
func InClusterClientForMemberCluster(clusterName string) kubeclient.Interface
func InClusterKarmadaClient ¶
func InClusterKarmadaClient() karmadaclientset.Interface
func InitKarmadaConfig ¶
func InitKarmadaConfig(options ...Option)
func InitKubeConfig ¶
func InitKubeConfig(options ...Option)
func KubeClientSetFromKubeConfig ¶
func KubeClientSetFromKubeConfig(kubeconfig string) (*kubeclient.Clientset, error)
func LoadApiConfig ¶
func LoadApiConfig(kubeconfig string, currentContext string) (*clientcmdapi.Config, error)
LoadApiConfig creates a clientcmdapi.Config using the passed kubeconfig. If currentContext is empty, current context in kubeconfig will be used.
func LoadRestConfig ¶
LoadRestConfig creates a rest.Config using the passed kubeconfig. If context is empty, current context in kubeconfig will be used.
func SetAuthorizationHeader ¶
Types ¶
type Option ¶
type Option func(*configBuilder)
func WithKubeContext ¶
func WithKubeconfig ¶
func WithUserAgent ¶
type ResourceVerber ¶
type ResourceVerber interface { Update(object *unstructured.Unstructured) error Get(kind string, namespace string, name string) (runtime.Object, error) Delete(kind string, namespace string, name string, deleteNow bool) error Create(object *unstructured.Unstructured) (*unstructured.Unstructured, error) }
ResourceVerber is responsible for performing generic CRUD operations on all supported resources.
func VerberClient ¶
func VerberClient(request *http.Request) (ResourceVerber, error)
Click to show internal directories.
Click to hide internal directories.