Merge pull request #105384 from seans3/command-headers-fix
Fixes kubectl command headers which hangs on kubectl run Kubernetes-commit: e380ce57143fe84f8d575636ab81a06f7f8b28aa
This commit is contained in:
commit
5920119027
|
|
@ -420,8 +420,12 @@ func addCmdHeaderHooks(cmds *cobra.Command, kubeConfigFlags *genericclioptions.C
|
||||||
// Wraps CommandHeaderRoundTripper around standard RoundTripper.
|
// Wraps CommandHeaderRoundTripper around standard RoundTripper.
|
||||||
kubeConfigFlags.WrapConfigFn = func(c *rest.Config) *rest.Config {
|
kubeConfigFlags.WrapConfigFn = func(c *rest.Config) *rest.Config {
|
||||||
c.Wrap(func(rt http.RoundTripper) http.RoundTripper {
|
c.Wrap(func(rt http.RoundTripper) http.RoundTripper {
|
||||||
crt.Delegate = rt
|
// Must be separate RoundTripper; not "crt" closure.
|
||||||
return crt
|
// Fixes: https://github.com/kubernetes/kubectl/issues/1098
|
||||||
|
return &genericclioptions.CommandHeaderRoundTripper{
|
||||||
|
Delegate: rt,
|
||||||
|
Headers: crt.Headers,
|
||||||
|
}
|
||||||
})
|
})
|
||||||
return c
|
return c
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue