Skip to content

distribution: verifySchema1Manifest: pass through context#49021

Merged
AkihiroSuda merged 1 commit intomoby:masterfrom
thaJeztah:verifySchema1Manifest_context
Dec 4, 2024
Merged

distribution: verifySchema1Manifest: pass through context#49021
AkihiroSuda merged 1 commit intomoby:masterfrom
thaJeztah:verifySchema1Manifest_context

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

Before this patch:

go test -run TestValidateManifest
ERRO[0000] image verification failed for digest sha256:02fee8c3220ba806531f606525eceb83f4feb654f62b207191b1c9209188dedd
PASS
ok  	github.com/docker/docker/distribution	0.008s

With this patch:

go test -run TestValidateManifest
PASS
ok  	github.com/docker/docker/distribution	0.010s

Note that in verbose mode, the logs are still printed, but through t.Log;

go test -run TestValidateManifest -v
=== RUN   TestValidateManifest
    log_hook.go:47: time="2024-12-03T13:41:19.308383552Z" level=error msg="image verification failed for digest sha256:02fee8c3220ba806531f606525eceb83f4feb654f62b207191b1c9209188dedd" func=distribution.verifySchema1Manifest file="/go/src/github.com/docker/docker/distribution/pull_v2.go:1010" testcase=TestValidateManifest
--- PASS: TestValidateManifest (0.00s)
PASS
ok  	github.com/docker/docker/distribution	0.011s

Before this patch:

    go test -run TestValidateManifest
    ERRO[0000] image verification failed for digest sha256:02fee8c3220ba806531f606525eceb83f4feb654f62b207191b1c9209188dedd
    PASS
    ok  	github.com/docker/docker/distribution	0.008s

With this patch:

    go test -run TestValidateManifest
    PASS
    ok  	github.com/docker/docker/distribution	0.010s

Note that in verbose mode, the logs are still printed, but through t.Log;

    go test -run TestValidateManifest -v
    === RUN   TestValidateManifest
        log_hook.go:47: time="2024-12-03T13:41:19.308383552Z" level=error msg="image verification failed for digest sha256:02fee8c3220ba806531f606525eceb83f4feb654f62b207191b1c9209188dedd" func=distribution.verifySchema1Manifest file="/go/src/github.com/docker/docker/distribution/pull_v2.go:1010" testcase=TestValidateManifest
    --- PASS: TestValidateManifest (0.00s)
    PASS
    ok  	github.com/docker/docker/distribution	0.011s

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah added this to the 28.0.0 milestone Dec 3, 2024
@thaJeztah thaJeztah self-assigned this Dec 3, 2024
t.Skip("Needs fixing on Windows")
}
ctx := context.TODO()
ctx = logtest.WithT(ctx, t)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Still want to look at adding a NopLogger or DiscardLogger to the log module; in this specific case, we're not really interested in the logs.

@AkihiroSuda AkihiroSuda merged commit f3749f9 into moby:master Dec 4, 2024
@thaJeztah thaJeztah deleted the verifySchema1Manifest_context branch December 4, 2024 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants