MCPcopy
hub / github.com/kubernetes/client-go / NewClientConfigFromBytes

Function NewClientConfigFromBytes

tools/clientcmd/client_config.go:103–110  ·  view source on GitHub ↗

NewClientConfigFromBytes takes your kubeconfig and gives you back a ClientConfig

(configBytes []byte)

Source from the content-addressed store, hash-verified

101
102// NewClientConfigFromBytes takes your kubeconfig and gives you back a ClientConfig
103func NewClientConfigFromBytes(configBytes []byte) (ClientConfig, error) {
104 config, err := Load(configBytes)
105 if err != nil {
106 return nil, err
107 }
108
109 return &DirectClientConfig{*config, "", &ConfigOverrides{}, nil, nil, promptedCredentials{}}, nil
110}
111
112// RESTConfigFromKubeConfig is a convenience method to give back a restconfig from your kubeconfig bytes.
113// For programmatic access, this is what you want 80% of the time

Callers 1

RESTConfigFromKubeConfigFunction · 0.85

Calls 1

LoadFunction · 0.85

Tested by

no test coverage detected