Skip to content

Commit

Permalink
[content-service] Fix backup restoration
Browse files Browse the repository at this point in the history
  • Loading branch information
aledbf committed May 3, 2022
1 parent 655281b commit deb0766
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions components/content-service/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ require (
google.golang.org/protobuf v1.28.0
)

require github.com/containers/storage v1.39.0
require (
github.com/containers/storage v1.39.0
github.com/opencontainers/runc v1.1.0
)

require (
cloud.google.com/go v0.83.0 // indirect
Expand All @@ -52,7 +55,6 @@ require (
github.com/moby/sys/mountinfo v0.6.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/opencontainers/runc v1.1.0 // indirect
github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
Expand Down
5 changes: 4 additions & 1 deletion components/content-service/pkg/archive/tar.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

"github.com/containers/storage/pkg/archive"
"github.com/containers/storage/pkg/idtools"
"github.com/opencontainers/runc/libcontainer/userns"
"github.com/opentracing/opentracing-go"

"github.com/gitpod-io/gitpod/common-go/log"
Expand Down Expand Up @@ -77,10 +78,12 @@ func ExtractTarbal(ctx context.Context, src io.Reader, dst string, opts ...TarOp
}
}

err = archive.Untar(src, dst, &archive.TarOptions{
err = archive.UntarUncompressed(src, dst, &archive.TarOptions{
UIDMaps: uidMaps,
GIDMaps: gidMaps,
Compression: archive.Uncompressed,
CopyPass: true,
InUserNS: userns.RunningInUserNS(),
})

log.WithField("duration", time.Since(start).Milliseconds()).Debug("untar complete")
Expand Down

0 comments on commit deb0766

Please sign in to comment.