ConfigFor returns a copy of the provided config with the appropriate dynamic client defaults set.
(inConfig *rest.Config)
| 40 | // ConfigFor returns a copy of the provided config with the |
| 41 | // appropriate dynamic client defaults set. |
| 42 | func 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. |
no test coverage detected