Skip to content

Commit dec301b

Browse files
camilamacedo86ci-robot
authored andcommitted
UPSTREAM: <carry>: [Default Catalog]: Create tmp dir to extract layers with right permissions to avoid issues scenarios
1 parent deeee0e commit dec301b

File tree

1 file changed

+7
-0
lines changed
  • openshift/default-catalog-consistency/pkg/extract

1 file changed

+7
-0
lines changed

openshift/default-catalog-consistency/pkg/extract/extract.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,13 @@ func UnpackImage(ctx context.Context, imageRef, name string, sysCtx *types.Syste
8888

8989
// Create and use a separate fs directory for unpacked layers
9090
fsDir := filepath.Join(tmpDir, "fs")
91+
92+
// Create the fs directory and set permissions
93+
// To avoid permissions issues scenarios
94+
if err := os.MkdirAll(fsDir, 0o755); err != nil {
95+
return nil, fmt.Errorf("make fs dir to unpack: %w", err)
96+
}
97+
9198
if err := extractLayers(ctx, ociDir, fsDir, digestTag); err != nil {
9299
return nil, fmt.Errorf("extract filesystem: %w", err)
93100
}

0 commit comments

Comments
 (0)