Skip to content

Fix for empty platform#2513

Merged
dmcgowan merged 2 commits intocontainerd:masterfrom
dmcgowan:set-default-platform-withplatform
Aug 1, 2018
Merged

Fix for empty platform#2513
dmcgowan merged 2 commits intocontainerd:masterfrom
dmcgowan:set-default-platform-withplatform

Conversation

@dmcgowan
Copy link
Copy Markdown
Member

@dmcgowan dmcgowan commented Jul 31, 2018

The default platform had previously been provided using the empty string. This change ensures that the platforms field is always filled in correctly and empty string is properly interpreted.
Also replace manual image struct creation with the image constructor which is there to do just that.

Fixes image objects returned by the client using an empty platform because the platform was empty on the image struct.
Also fixes an unintentional break in client backwards compatibility used by some tests. These uses can also be updated to remove WithPlatform or explicitly set the default.

The default platform had previously been provided using the
empty string. This change ensures that the platforms
field is always filled in correctly and empty string is
properly interpreted.

Signed-off-by: Derek McGowan <[email protected]>
@Random-Liu
Copy link
Copy Markdown
Member

Don't we need platform in GetImage?https://github.com/containerd/containerd/blob/master/client.go#L454

I think that is where the thing is broken.

Replace manual image struct creation with the image
constructor which is there to do just that.

Signed-off-by: Derek McGowan <[email protected]>
@dmcgowan dmcgowan changed the title Ensure specifying an empty platform is treated as default Fix for empty platform Jul 31, 2018
@codecov-io
Copy link
Copy Markdown

codecov-io commented Jul 31, 2018

Codecov Report

Merging #2513 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2513   +/-   ##
=======================================
  Coverage   45.07%   45.07%           
=======================================
  Files          93       93           
  Lines        9780     9780           
=======================================
  Hits         4408     4408           
  Misses       4654     4654           
  Partials      718      718
Flag Coverage Δ
#linux 49.1% <ø> (ø) ⬆️
#windows 41.58% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 875b92c...d64d8a0. Read the comment docs.

@Random-Liu
Copy link
Copy Markdown
Member

LGTM

@dmcgowan dmcgowan added this to the 1.2 milestone Jul 31, 2018
@stevvooe
Copy link
Copy Markdown
Member

stevvooe commented Aug 1, 2018

LGTM

@dmcgowan
Copy link
Copy Markdown
Member Author

dmcgowan commented Aug 1, 2018

The busybox image is currently broken on hub, will update appveyor build and merge after it is fixed

@dmcgowan
Copy link
Copy Markdown
Member Author

dmcgowan commented Aug 1, 2018

Actually, going to merge it now. The master build already broke because of this, I will kick off the master build once the image is fixed upstream.

@dmcgowan dmcgowan merged commit efb04a3 into containerd:master Aug 1, 2018
@crosbymichael
Copy link
Copy Markdown
Member

LGTM

@dmcgowan dmcgowan deleted the set-default-platform-withplatform branch September 10, 2019 17:47
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.

5 participants