Skip to content

Instantly share code, notes, and snippets.

@ihcsim
Last active February 4, 2020 06:12
Show Gist options
  • Select an option

  • Save ihcsim/f77fafd59c2f0325aa030269bb79c4db to your computer and use it in GitHub Desktop.

Select an option

Save ihcsim/f77fafd59c2f0325aa030269bb79c4db to your computer and use it in GitHub Desktop.
// Connect returns a handler for the pod exec proxy
func (r *ExecREST) Connect(ctx context.Context, name string, opts runtime.Object, responder rest.Responder) (http.Handler, error) {
execOpts, ok := opts.(*api.PodExecOptions)
if !ok {
return nil, fmt.Errorf("invalid options object: %#v", opts)
}
location, transport, err := pod.ExecLocation(r.Store, r.KubeletConn, ctx, name, execOpts)
if err != nil {
return nil, err
}
return newThrottledUpgradeAwareProxyHandler(location, transport, false, true, true, responder), nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment