Skip to content

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 <rafael.gieschke@rz.uni-freiburg.de>
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