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

Function ConfigFor

dynamic/simple.go:42–51  ·  view source on GitHub ↗

ConfigFor returns a copy of the provided config with the appropriate dynamic client defaults set.

(inConfig *rest.Config)

Source from the content-addressed store, hash-verified

40// ConfigFor returns a copy of the provided config with the
41// appropriate dynamic client defaults set.
42func ConfigFor(inConfig *rest.Config) *rest.Config {
43 config := rest.CopyConfig(inConfig)
44 config.AcceptContentTypes = "application/json"
45 config.ContentType = "application/json"
46 config.NegotiatedSerializer = basicNegotiatedSerializer{} // this gets used for discovery and error handling types
47 if config.UserAgent == "" {
48 config.UserAgent = rest.DefaultKubernetesUserAgent()
49 }
50 return config
51}
52
53// NewForConfigOrDie creates a new Interface for the given config and
54// panics if there is an error in the config.

Callers 1

NewForConfigFunction · 0.85

Calls 2

CopyConfigFunction · 0.92

Tested by

no test coverage detected