Skip to content

Commit bf5b907

Browse files
stefanprodangithub-actions[bot]
authored andcommitted
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 <stefan.prodan@gmail.com> (cherry picked from commit cdb412e)
1 parent 516666a commit bf5b907

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/controller/ocirepository_controller.go

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

0 commit comments

Comments
 (0)