Skip to content

Commit cdb412e

Browse files
committed
oci: Skip symlinks found in upstream artifacts
Do not error out when upstream artifacts contain symlinks in the content layer, instead skip all symlinks during decompression. Signed-off-by: Stefan Prodan <[email protected]>
1 parent 837d807 commit cdb412e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/controller/ocirepository_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ func (r *OCIRepositoryReconciler) reconcileSource(ctx context.Context, sp *patch
488488
// Persist layer content to storage using the specified operation
489489
switch obj.GetLayerOperation() {
490490
case ociv1.OCILayerExtract:
491-
if err = tar.Untar(blob, dir, tar.WithMaxUntarSize(-1)); err != nil {
491+
if err = tar.Untar(blob, dir, tar.WithMaxUntarSize(-1), tar.WithSkipSymlinks()); err != nil {
492492
e := serror.NewGeneric(
493493
fmt.Errorf("failed to extract layer contents from artifact: %w", err),
494494
ociv1.OCILayerOperationFailedReason,

0 commit comments

Comments
 (0)