File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
pkg/image/containerdregistry Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ import (
66 "context"
77 "encoding/json"
88 "fmt"
9+ "io"
10+ "io/ioutil"
11+ "os"
12+
913 "github.com/containerd/containerd/archive"
1014 "github.com/containerd/containerd/archive/compression"
1115 "github.com/containerd/containerd/errdefs"
@@ -15,9 +19,6 @@ import (
1519 "github.com/containerd/containerd/remotes"
1620 ocispec "github.com/opencontainers/image-spec/specs-go/v1"
1721 "github.com/sirupsen/logrus"
18- "io"
19- "io/ioutil"
20- "os"
2122
2223 "github.com/operator-framework/operator-registry/pkg/image"
2324)
@@ -195,5 +196,11 @@ func adjustPerms(h *tar.Header) (bool, error) {
195196 h .Uid = os .Getuid ()
196197 h .Gid = os .Getgid ()
197198
199+ // Make all unpacked files owner-writable
200+ // This prevents errors when unpacking a layer that contains a read-only folder (if permissions are preserved,
201+ // file contents cannot be unpacked into the unpacked read-only folder).
202+ // This also means that "unpacked" layers cannot be "repacked" without potential information loss
203+ h .Mode |= 0200
204+
198205 return true , nil
199206}
You can’t perform that action at this time.
0 commit comments