[0.11 backport] Update uses of Image platform fields in OCI image-spec#3828
Merged
jedevc merged 1 commit intomoby:v0.11from May 19, 2023
Merged
Conversation
The OCI image spec is considering to change the Image struct and embedding the Platform type (see opencontainers/image-spec#959) in the go implementation. BuildKit currently uses some struct-literals to propagate the platform fields, which will break once those changes in the OCI spec are merged. Ideally (once that change arrives) we would update the code to set the Platform information as a whole, instead of assigning related fields individually, but in some cases in the code, image platform information is only partially set (for example, OSVersion and OSFeatures are not preserved in all cases). This may be on purpose, so needs to be reviewed. This patch keeps the current behavior (assigning only specific fields), but removes the use of struct-literals to make the code compatible with the upcoming changes in the image-spec module. Signed-off-by: Sebastiaan van Stijn <github@gone.nl> (cherry picked from commit 09afe32) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Member
Author
|
@tonistiigi @crazy-max ptal 🤗 |
thaJeztah
added a commit
to thaJeztah/docker
that referenced
this pull request
Apr 30, 2023
Using moby/buildkit#3828 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
thaJeztah
added a commit
to thaJeztah/docker
that referenced
this pull request
Apr 30, 2023
Using moby/buildkit#3828 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
thaJeztah
added a commit
to thaJeztah/docker
that referenced
this pull request
Apr 30, 2023
Using moby/buildkit#3828 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This was referenced May 2, 2023
thaJeztah
added a commit
to thaJeztah/docker
that referenced
this pull request
May 4, 2023
Using moby/buildkit#3828 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Member
Author
|
@tonistiigi @AkihiroSuda ptal 🤗 |
jedevc
approved these changes
May 19, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The OCI image spec is considering to change the Image struct and embedding the Platform type (see opencontainers/image-spec#959) in the go implementation. BuildKit currently uses some struct-literals to propagate the platform fields, which will break once those changes in the OCI spec are merged.
Ideally (once that change arrives) we would update the code to set the Platform information as a whole, instead of assigning related fields individually, but in some cases in the code, image platform information is only partially set (for example, OSVersion and OSFeatures are not preserved in all cases). This may be on purpose, so needs to be reviewed.
This patch keeps the current behavior (assigning only specific fields), but removes the use of struct-literals to make the code compatible with the upcoming changes in the image-spec module.
(cherry picked from commit 09afe32)