Skip to content

Initial support for OCI multi-platform image#37346

Closed
arm64b wants to merge 1 commit intomoby:masterfrom
arm64b:Add-spec-platform-support
Closed

Initial support for OCI multi-platform image#37346
arm64b wants to merge 1 commit intomoby:masterfrom
arm64b:Add-spec-platform-support

Conversation

@arm64b
Copy link
Contributor

@arm64b arm64b commented Jun 26, 2018

Add the OCI spec compatible image support in client side.

Signed-off-by: Dennis Chen dennis.chen@arm.com

- What I did

- How I did it

- How to verify it

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

Add the OCI spec compatible image support in client side.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
@arm64b arm64b force-pushed the Add-spec-platform-support branch from 701c111 to de4231c Compare June 26, 2018 09:04
@arm64b
Copy link
Contributor Author

arm64b commented Jun 26, 2018

/cc @thaJeztah @johnstep, @dmcgowan @tianon, and @tonistiigi 😃

@arm64b
Copy link
Contributor Author

arm64b commented Jun 26, 2018

Will check the ci-failing tomorrow

@thaJeztah thaJeztah added status/2-code-review status/failing-ci Indicates that the PR in its current state fails the test suite and removed status/0-triage labels Jun 26, 2018
@thaJeztah
Copy link
Member

Thanks!

p := system.ParsePlatform(apiPlatform)
if err := system.ValidatePlatform(p); err != nil {
return nil, errdefs.InvalidParameter(errors.Errorf("invalid platform: %s", err))
if len(strings.TrimSpace(apiPlatform)) != 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is this (strings.TrimSpace()) coming from? It seems you are relaxing the spec here, allowing for non-empty strings containing some whitespace characters. Previous implementation (system.ParsePlatform()) did not do any special treatment of white space.

platform = system.ParsePlatform(apiPlatform)
if err = system.ValidatePlatform(platform); err != nil {
err = fmt.Errorf("invalid platform: %s", err)
if len(strings.TrimSpace(apiPlatform)) != 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

if err := system.ValidatePlatform(system.ParsePlatform(imageOS)); err != nil {
return fmt.Errorf("cannot load %s image on %s: %s", imageOS, runtime.GOOS, err)
}
// TODO(@arm64b): Leave this sanity check to the containerd code in the future
Copy link
Contributor

Choose a reason for hiding this comment

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

From the code it appears it's not longer a TODO item, so maybe just remove the comments about checking altogether?

@kolyshkin
Copy link
Contributor

CI failures are caused by

02:06:53 # github.com/docker/docker/client
02:06:53 client/image_build.go:33:22: invalid operation: options.Platform != "" (mismatched types v1.Platform and string)
02:06:53 client/image_build.go:37:32: cannot use options.Platform (type v1.Platform) as type string in argument to query.Set
02:06:53 client/image_build.go:133:22: invalid operation: options.Platform != "" (mismatched types v1.Platform and string)
02:06:53 client/image_build.go:134:48: cannot use options.Platform (type v1.Platform) as type string in argument to strings.ToLower

@arm64b
Copy link
Contributor Author

arm64b commented Jun 27, 2018

Hello @kolyshkin , thanks for the comments! I think we can close this PR since we have a replacement of PR #37350 by @tonistiigi 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/failing-ci Indicates that the PR in its current state fails the test suite status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants