code: func TarResourceRebase(sourcePath, rebaseName string) (content io.ReadCloser, err error) {
  	sourcePath = normalizePath(sourcePath)
  	if _, err = os.Lstat(sourcePath); err != nil {
  		// Catches the case where the source does not exist or is not a
  		// directory if asserted to be a directory, as this also causes an
  		// error.
  		return
  	}
  
  	// Separate the source path between its directory and
  	// the entry in that directory which we are archiving.
  	sourceDir, sourceBase := SplitPathDirEntry(sourcePath)
  	opts := TarResourceRebaseOpts(sourceBase, rebaseName)
  
  	logrus.Debugf("copying %q from %q", sourceBase, sourceDir)
  	return TarWithOptions(sourceDir, opts)
  }
docs: // TarResourceRebase is like TarResource but renames the first path element of
  // items in the resulting tar archive to match the given rebaseName if not "".