code: func logOpts(restClientGetter genericclioptions.RESTClientGetter, pod *corev1.Pod, opts *attach.AttachOptions) error {
  	ctrName, err := opts.GetContainerName(pod)
  	if err != nil {
  		return err
  	}
  
  	requests, err := polymorphichelpers.LogsForObjectFn(restClientGetter, pod, &corev1.PodLogOptions{Container: ctrName}, opts.GetPodTimeout, false)
  	if err != nil {
  		return err
  	}
  	for _, request := range requests {
  		if err := logs.DefaultConsumeRequest(request, opts.Out); err != nil {
  			return err
  		}
  	}
  
  	return nil
  }
docs: // logOpts logs output from opts to the pods log.