-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add platform to manifest descriptor in metadata. #2993
Conversation
Doesn't this revert #1985 ? |
@tonistiigi As far as I can tell, there is no effect except that the descriptor returned includes the platform. |
@@ -57,6 +57,13 @@ func (ic *ImageWriter) Commit(ctx context.Context, inp exporter.Source, sessionI | |||
return nil, errors.Errorf("unable to export multiple refs, missing platforms mapping") | |||
} | |||
|
|||
var p exptypes.Platforms | |||
if ok { | |||
if err := json.Unmarshal(platformsBytes, &p); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem to be backward compatible. The case is when new daemon(exporter) is used with an old frontend that doesn't set this key(because it is not exporting a manifest list).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would a length check here satisfy this concern? It's already not doing this unmarshal if the metadata is missing entirely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to include that, also tested against some already released docker/dockerfile versions as the frontend, seems to be ok.
@@ -517,17 +517,22 @@ func Build(ctx context.Context, c client.Client) (*client.Result, error) { | |||
return errors.Wrapf(err, "failed to marshal build info") | |||
} | |||
|
|||
p := platforms.DefaultSpec() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not new code but these need Normalize()
calls as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
This just make it simpler to determine the output image's platform. Today we inject this into the metadata after the build (when we can) which causes some headache in our build pipelines. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
7f9466b
to
5d3648d
Compare
This just make it simpler to determine the output image's platform.
Today we inject this into the metadata after the build (when we can)
which causes some headache in our build pipelines.