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

nydusify: fix unnecessary manifest index when copy one platform image #1479

Merged
merged 1 commit into from
Nov 10, 2023

Conversation

imeoer
Copy link
Collaborator

@imeoer imeoer commented Nov 10, 2023

When use the command to copy the image with specified one platform:

nydusify copy --platform linux/amd64 --source nginx --target localhost:5000/nginx

We found the target image is a manifest index format like:

{
  "schemaVersion": 2,
  "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
  "manifests": [
    {
      "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
      "digest": "sha256:d2e65182b5fd330470eca9b8e23e8a1a0d87cc9b820eb1fb3f034bf8248d37ee",
      "size": 1778,
      "platform": {
        "architecture": "amd64",
        "os": "linux"
      }
    }
  ]
}

This can be a bit strange, in fact just the manifest is enough, the patch improves this.

Relevant Issue (if applicable)

If there are Issues related to this PullRequest, please list it.

Details

Please describe the details of PullRequest.

Types of changes

What types of changes does your PullRequest introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation Update (if none of the other choices apply)

Checklist

Go over all the following points, and put an x in all the boxes that apply.

  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

When use the command to copy the image with specified one platform:

```
nydusify copy --platform linux/amd64 --source nginx --target localhost:5000/nginx
```

We found the target image is a manifest index format like:

```
{
  "schemaVersion": 2,
  "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
  "manifests": [
    {
      "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
      "digest": "sha256:d2e65182b5fd330470eca9b8e23e8a1a0d87cc9b820eb1fb3f034bf8248d37ee",
      "size": 1778,
      "platform": {
        "architecture": "amd64",
        "os": "linux"
      }
    }
  ]
}
```

This can be a bit strange, in fact just the manifest is enough, the patch improves this.

Signed-off-by: Yan Song <[email protected]>
@imeoer imeoer requested a review from a team as a code owner November 10, 2023 06:55
@imeoer imeoer requested review from jiangliu, changweige and hsiangkao and removed request for a team November 10, 2023 06:55
Copy link

codecov bot commented Nov 10, 2023

Codecov Report

Merging #1479 (6a34896) into master (c9fbce8) will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1479      +/-   ##
==========================================
- Coverage   62.50%   62.49%   -0.02%     
==========================================
  Files         123      123              
  Lines       43148    43148              
  Branches    43148    43148              
==========================================
- Hits        26971    26966       -5     
- Misses      14870    14874       +4     
- Partials     1307     1308       +1     

see 2 files with indirect coverage changes

Copy link
Member

@adamqqqplay adamqqqplay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your fix!

@imeoer imeoer merged commit 767adcf into dragonflyoss:master Nov 10, 2023
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants