Skip to content

[0.11 backport] Update uses of Image platform fields in OCI image-spec#3828

Merged
jedevc merged 1 commit intomoby:v0.11from
thaJeztah:0.11_backport_image_spec_no_literal
May 19, 2023
Merged

[0.11 backport] Update uses of Image platform fields in OCI image-spec#3828
jedevc merged 1 commit intomoby:v0.11from
thaJeztah:0.11_backport_image_spec_no_literal

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

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)

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>
@thaJeztah
Copy link
Copy Markdown
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>
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>
@thaJeztah
Copy link
Copy Markdown
Member Author

@tonistiigi @AkihiroSuda ptal 🤗

@thaJeztah thaJeztah requested review from jedevc and tonistiigi May 11, 2023 21:03
@jedevc jedevc merged commit bfc58e6 into moby:v0.11 May 19, 2023
@thaJeztah thaJeztah deleted the 0.11_backport_image_spec_no_literal branch May 19, 2023 14:23
@crazy-max crazy-max added this to the v0.11.7 milestone Jul 20, 2023
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.

3 participants