Skip to content

Commit

Permalink
Fixes kubectl command headers which hangs on kubectl run
Browse files Browse the repository at this point in the history
  • Loading branch information
seans3 committed Oct 4, 2021
1 parent 39a3dc8 commit cd94fec
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions staging/src/k8s.io/kubectl/pkg/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,12 @@ func addCmdHeaderHooks(cmds *cobra.Command, kubeConfigFlags *genericclioptions.C
// Wraps CommandHeaderRoundTripper around standard RoundTripper.
kubeConfigFlags.WrapConfigFn = func(c *rest.Config) *rest.Config {
c.Wrap(func(rt http.RoundTripper) http.RoundTripper {
crt.Delegate = rt
return crt
// Must be separate RoundTripper; not "crt" closure.
// Fixes: https://github.com/kubernetes/kubectl/issues/1098
return &genericclioptions.CommandHeaderRoundTripper{
Delegate: rt,
Headers: crt.Headers,
}
})
return c
}
Expand Down

0 comments on commit cd94fec

Please sign in to comment.