plugin/kubernetes: check err in getClientConfig (#1230)
Check the error returned by clientConfig.ClientConfig() before trying to set cc.ContentType. Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
This commit is contained in:
parent
9edfd11386
commit
f4f1736329
1 changed files with 3 additions and 0 deletions
|
@ -222,6 +222,9 @@ func (k *Kubernetes) getClientConfig() (*rest.Config, error) {
|
|||
clientConfig := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(loadingRules, overrides)
|
||||
|
||||
cc, err := clientConfig.ClientConfig()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cc.ContentType = "application/vnd.kubernetes.protobuf"
|
||||
return cc, err
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue