Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix descriptor matching logic #210

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rafaelgieschke
Copy link

This fixes commit dab5ba5.

The for i := 0; i < len(descs); i++ loops inside findDescriptor skip one
entry of descs at each non-match because the array length is reduced by 1
but the index i is not reduced:

skopeo copy docker://ubuntu oci:dir:a
skopeo copy docker://ubuntu oci:dir:b
skopeo copy docker://ubuntu oci:dir:c
./oci-image-tool unpack --ref name=c dir dir2

index.json: descriptor retrieved by refs [name=c] is not unique

This fixes commit dab5ba5.

The `for i := 0; i < len(descs); i++` loops inside findDescriptor skip one
entry of descs at each non-match because the array length is reduced by 1
but the index i is not reduced:

```
skopeo copy docker://ubuntu oci:dir:a
skopeo copy docker://ubuntu oci:dir:b
skopeo copy docker://ubuntu oci:dir:c
./oci-image-tool unpack --ref name=c dir dir2

index.json: descriptor retrieved by refs [name=c] is not unique
```

Signed-off-by: Rafael Gieschke <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant