Skip to content
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

fix bug that cann't recognize ONBUILD in schemaV1 img #3053

Merged
merged 1 commit into from
Aug 26, 2022

Conversation

yyb196
Copy link
Contributor

@yyb196 yyb196 commented Aug 22, 2022

fix bug #3052

Original convertSchema1ConfigMeta fuction using
the wrong ocispec.Image type to unmarshal schemaV1
image config, Which miss OnBbuild field, the correct
Image type was defined in frontend/dockerfile/dockerfile2llb/image.go,
I move its definition to exporter/containerimage/image, then both
package util/imageutil and frontend/dockerfile could
use the correct Image type.

Signed-off-by: frank yang yyb196@gmail.com

@yyb196 yyb196 force-pushed the fix_schema1_onbuild branch 2 times, most recently from e356c83 to 2c7ed2c Compare August 22, 2022 09:33
@yyb196 yyb196 changed the title fix bug that cann't recognize ONBUILD in schemaV1 img [WIP]fix bug that cann't recognize ONBUILD in schemaV1 img Aug 22, 2022
@yyb196 yyb196 force-pushed the fix_schema1_onbuild branch 2 times, most recently from e924d18 to 9b74216 Compare August 23, 2022 03:23
@yyb196 yyb196 changed the title [WIP]fix bug that cann't recognize ONBUILD in schemaV1 img fix bug that cann't recognize ONBUILD in schemaV1 img Aug 23, 2022
@@ -30,6 +30,7 @@ import (
"github.com/moby/buildkit/util/apicaps"
binfotypes "github.com/moby/buildkit/util/buildinfo/types"
"github.com/moby/buildkit/util/gitutil"
"github.com/moby/buildkit/util/imageutil"
Copy link
Member

Choose a reason for hiding this comment

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

imageutil imports many containerd libraries and isn't ideal to be imported here. Move the image types to a separate package that is imported both by dockerfile and imageutil.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tonistiigi thanks for your review, I have move the Image definition to a new package under util/schema1, PTALA.

@@ -30,6 +30,7 @@ import (
"github.com/moby/buildkit/util/apicaps"
binfotypes "github.com/moby/buildkit/util/buildinfo/types"
"github.com/moby/buildkit/util/gitutil"
"github.com/moby/buildkit/util/schema1"
Copy link
Member

Choose a reason for hiding this comment

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

This isn't technically schema1. Schema1 is that V1Compatibility mess. Put it under exporter/containerimage/image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to your suggestion, move Image definition to package exporter/containerimage/image, PTALA.

fix bug moby#3052

Original `convertSchema1ConfigMeta` fuction using
the wrong `ocispec.Image` type to unmarshal schemaV1
image config, Which miss ONBUILD field, the correct
`Image` type was defined in `frontend/dockerfile/dockerfile2llb/image.go`,
I move its definition to `exporter/containerimage/image`,
then both package `util/imageutil` and `frontend/dockerfile`
could use the correct `Image` type.

Signed-off-by: frank yang <yyb196@gmail.com>
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.

None yet

2 participants