-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Correct missing sizes for manifest schema 1 images #16325
Correct missing sizes for manifest schema 1 images #16325
Conversation
The code is covered by |
/retest |
@@ -102,7 +102,7 @@ func (h *manifestSchema1Handler) FillImageMetadata(ctx context.Context, image *i | |||
} | |||
image.DockerImageMetadata.Object = meta | |||
|
|||
return nil | |||
return encodeRawDockerImageMetadata(image, true) |
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.
above, imageMetadataFromManifest is called, which calls encodeRawDockerImageMetadata. Can't we merge the code above into imageMetadataFromManifest?
/retest |
Add test so this doesn't regress |
8c96906
to
063f110
Compare
@@ -53,56 +53,75 @@ type manifestSchema1Handler struct { | |||
var _ ManifestHandler = &manifestSchema1Handler{} | |||
|
|||
func (h *manifestSchema1Handler) FillImageMetadata(ctx context.Context, image *imageapiv1.Image) error { |
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.
As it's our internal type, I'd like to propose to split this function into 3 parts:
Layers(ctx context.Context) (layers []imageapi.ImageLayer, annotations map[string]string, error)
Signatures(ctx context.Context) ([][]byte, error)
Metadata(ctx context.Context, layers []imageapi.ImageLayer) (imageapi.DockerImage, err error)
The output of these functions should depend only on the input manifest. And we do not need to parse manifest data in this functions, because we already have h.manifest
(in this case we can remove DockerImageManifest in caller).
These functions can be reused in pkg/image/apis/image.ImageWithMetadata.
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.
Good idea, I'll rework.
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.
Reworked. I modified the declarations a bit. PTAL
sgtm
…On Mon, Sep 18, 2017 at 3:41 PM, Oleg Bulatov ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In pkg/dockerregistry/server/manifestschema1handler.go
<#16325 (comment)>:
> @@ -53,56 +53,75 @@ type manifestSchema1Handler struct {
var _ ManifestHandler = &manifestSchema1Handler{}
func (h *manifestSchema1Handler) FillImageMetadata(ctx context.Context, image *imageapiv1.Image) error {
As it's our internal type, I'd like to propose to split this function into
3 parts:
Layers(ctx context.Context) (layers []imageapi.ImageLayer, annotations map[string]string, error)
Signatures(ctx context.Context) ([][]byte, error)
Metadata(ctx context.Context, layers []imageapi.ImageLayer) (imageapi.DockerImage, err error)
The output of these functions should depend only on the input manifest.
And we do not need to parse manifest data in this functions, because we
already have h.manifest (in this case we can remove DockerImageManifest
in caller).
These functions can be reused in pkg/image/apis/image.ImageWithMetadata.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#16325 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABG_pyWLOuxLD_ZKo0iF9SbhzyrTo5X1ks5sjsdQgaJpZM4PWPJK>
.
|
063f110
to
101be87
Compare
101be87
to
9044499
Compare
Added more tests. |
@@ -143,6 +148,7 @@ func (m *manifestService) Put(ctx context.Context, manifest distribution.Manifes | |||
DockerImageReference: fmt.Sprintf("%s/%s/%s@%s", m.repo.config.registryAddr, m.repo.namespace, m.repo.name, dgst.String()), | |||
DockerImageManifest: string(payload), | |||
DockerImageManifestMediaType: mediaType, | |||
DockerImageConfig: string(config), |
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.
It will land in etcd, won't it?
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.
It will land in etcd, won't it?
I've updated the image strategy to unset DockerImageConfig
and DockerImageManifest
.
Instead of filling metadata on image object in the registry, send manifest and config blobs to the master API and let it do the job. Signed-off-by: Michal Minář <[email protected]>
7afd7f6
to
5ac2762
Compare
@miminar: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
When I click on detail link of ci/openshift-jenkins/extended_image_registry, I get:
The job link works fine though. Is this openshift/test-infra issue? |
/retest |
@miminar yeah we had some issues yesterday... should be fixed from now on :) |
@smarterclayton @dmage any other comments? |
Looks fine to me but I'll let @dmage have the final say |
@dmage can you sign off on this? looks like this is the fix for a blocking bug. |
(it also appears to be blocking #15807, it would be great to clear this logjam) |
/lgtm |
I will answer myself. No. This should not be done because the image we get from the API. /lgtm |
/assign @bparees |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bparees, dmage, legionus, miminar The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
Automatic merge from submit-queue. |
Instead of filling metadata in the image object in the registry, send the manifest and config blobs to the master and let it do the job.
Resolves #16306
Resolves: bz#1491589