Skip to content

Commit

Permalink
oci: Skip symlinks found in upstream artifacts
Browse files Browse the repository at this point in the history
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]>
(cherry picked from commit cdb412e)
  • Loading branch information
stefanprodan authored and github-actions[bot] committed Oct 9, 2023
1 parent 516666a commit bf5b907
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/controller/ocirepository_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,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,
Expand Down

0 comments on commit bf5b907

Please sign in to comment.