Skip to content

Commit

Permalink
Merge pull request #20822 from mtrmac/chown-cleanup
Browse files Browse the repository at this point in the history
Fix transferring data using tar
  • Loading branch information
openshift-merge-bot[bot] authored Nov 29, 2023
2 parents 6d9d8f0 + 4314b1c commit d6fefe0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions pkg/api/handlers/libpod/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
"github.com/containers/podman/v4/pkg/domain/infra/abi"
domainUtils "github.com/containers/podman/v4/pkg/domain/utils"
"github.com/containers/podman/v4/pkg/errorhandling"
"github.com/containers/podman/v4/pkg/rootless"
"github.com/containers/podman/v4/pkg/util"
utils2 "github.com/containers/podman/v4/utils"
"github.com/containers/storage"
Expand Down Expand Up @@ -330,10 +329,7 @@ func ExportImages(w http.ResponseWriter, r *http.Request) {
}

tarOptions := &archive.TarOptions{
ChownOpts: &idtools.IDPair{
UID: rootless.GetRootlessUID(),
GID: rootless.GetRootlessGID(),
},
ChownOpts: &idtools.IDPair{UID: 0, GID: 0},
}
tar, err := chrootarchive.Tar(output, tarOptions, output)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/domain/infra/tunnel/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ func (ir *ImageEngine) Save(ctx context.Context, nameOrID string, tags []string,
return err
}

return archive.Untar(f, opts.Output, nil)
return archive.Untar(f, opts.Output, &archive.TarOptions{NoLchown: true})
}

func (ir *ImageEngine) Search(ctx context.Context, term string, opts entities.ImageSearchOptions) ([]entities.ImageSearchReport, error) {
Expand Down

0 comments on commit d6fefe0

Please sign in to comment.