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 (
6
6
"context"
7
7
"encoding/json"
8
8
"fmt"
9
+ "io"
10
+ "io/ioutil"
11
+ "os"
12
+
9
13
"github.com/containerd/containerd/archive"
10
14
"github.com/containerd/containerd/archive/compression"
11
15
"github.com/containerd/containerd/errdefs"
@@ -15,9 +19,6 @@ import (
15
19
"github.com/containerd/containerd/remotes"
16
20
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
17
21
"github.com/sirupsen/logrus"
18
- "io"
19
- "io/ioutil"
20
- "os"
21
22
22
23
"github.com/operator-framework/operator-registry/pkg/image"
23
24
)
@@ -195,5 +196,11 @@ func adjustPerms(h *tar.Header) (bool, error) {
195
196
h .Uid = os .Getuid ()
196
197
h .Gid = os .Getgid ()
197
198
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
+
198
205
return true , nil
199
206
}
You can’t perform that action at this time.
0 commit comments