oci/archive/oci_transport.go
func createUntarTempDir(ref ociArchiveReference) (tempDirOCIRef, error) {
	tempDirRef, err := createOCIRef(ref.image)
	if err != nil {
		return tempDirOCIRef{}, errors.Wrap(err, "error creating oci reference")
	}
	src := ref.resolvedFile
	dst := tempDirRef.tempDirectory
	// TODO: This can take quite some time, and should ideally be cancellable using a context.Context.
	if err := archive.UntarPath(src, dst); err != nil {
		if err := tempDirRef.deleteTempDir(); err != nil {
			return tempDirOCIRef{}, errors.Wrapf(err, "error deleting temp directory %q", tempDirRef.tempDirectory)
		}
		return tempDirOCIRef{}, errors.Wrapf(err, "error untarring file %q", tempDirRef.tempDirectory)
	}
	return tempDirRef, nil
}
func createUntarTempDir(ref ociArchiveReference) (tempDirOCIRef, error) {
	tempDirRef, err := createOCIRef(ref.image)
	if err != nil {
		return tempDirOCIRef{}, errors.Wrap(err, "error creating oci reference")
	}
	src := ref.resolvedFile
	dst := tempDirRef.tempDirectory
	// TODO: This can take quite some time, and should ideally be cancellable using a context.Context.
	if err := archive.UntarPath(src, dst); err != nil {
		if err := tempDirRef.deleteTempDir(); err != nil {
			return tempDirOCIRef{}, errors.Wrapf(err, "error deleting temp directory %q", tempDirRef.tempDirectory)
		}
		return tempDirOCIRef{}, errors.Wrapf(err, "error untarring file %q", tempDirRef.tempDirectory)
	}
	return tempDirRef, nil
}
// creates the temporary directory and copies the tarred content to it