code: func ServeAttach(w http.ResponseWriter, req *http.Request, attacher Attacher, podName string, uid types.UID, container string, streamOpts *Options, idleTimeout, streamCreationTimeout time.Duration, supportedProtocols []string) {
  	ctx, ok := createStreams(req, w, streamOpts, supportedProtocols, idleTimeout, streamCreationTimeout)
  	if !ok {
  		// error is handled by createStreams
  		return
  	}
  	defer ctx.conn.Close()
  
  	err := attacher.AttachContainer(podName, uid, container, ctx.stdinStream, ctx.stdoutStream, ctx.stderrStream, ctx.tty, ctx.resizeChan)
  	if err != nil {
  		err = fmt.Errorf("error attaching to container: %v", err)
  		runtime.HandleError(err)
  		ctx.writeStatus(apierrors.NewInternalError(err))
  	} else {
  		ctx.writeStatus(&apierrors.StatusError{ErrStatus: metav1.Status{
  			Status: metav1.StatusSuccess,
  		}})
  	}
  }
docs: // ServeAttach handles requests to attach to a container. After creating/receiving the required
  // streams, it delegates the actual attaching to attacher.