mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 13:37:30 +00:00
Fixes kubectl command headers which hangs on kubectl run
This commit is contained in:
parent
6f47878926
commit
1d1a5499e7
@ -425,8 +425,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
Block a user