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>
This commit is contained in:
Stefan Prodan 2023-09-29 13:27:19 +03:00
parent 837d8077ec
commit cdb412e7af
No known key found for this signature in database
GPG Key ID: 3299AEB0E4085BAF
1 changed files with 1 additions and 1 deletions

View File

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