Skip to content

Commit

Permalink
Fix to ensure tar sequence is ignored using --skip-pruning (#760)
Browse files Browse the repository at this point in the history
  • Loading branch information
lmzuccarelli committed Dec 18, 2023
1 parent 1025ffb commit 82781f2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions pkg/cli/mirror/mirror.go
Original file line number Diff line number Diff line change
Expand Up @@ -681,8 +681,10 @@ func (o *MirrorOptions) mirrorToMirrorWrapper(ctx context.Context, cfg v1alpha2.

var curr v1alpha2.Metadata
berr := targetBackend.ReadMetadata(ctx, &curr, config.MetadataBasePath)
if err := o.checkSequence(meta, curr, berr); err != nil {
return err
if !o.SkipPruning {
if err := o.checkSequence(meta, curr, berr); err != nil {
return err
}
}

// Change the destination to registry
Expand Down
6 changes: 4 additions & 2 deletions pkg/cli/mirror/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,10 @@ func (o *MirrorOptions) handleMetadata(ctx context.Context, tmpdir string, files

// Read in current metadata, if present
berr := backend.ReadMetadata(ctx, &curr, config.MetadataBasePath)
if err := o.checkSequence(incoming, curr, berr); err != nil {
return backend, incoming, curr, err
if !o.SkipPruning {
if err := o.checkSequence(incoming, curr, berr); err != nil {
return backend, incoming, curr, err
}
}
return backend, incoming, curr, nil
}
Expand Down

0 comments on commit 82781f2

Please sign in to comment.