Skip to content

Commit

Permalink
fix: resolve comment for Patrick
Browse files Browse the repository at this point in the history
Signed-off-by: Junjie Gao <[email protected]>
  • Loading branch information
JeyJeyGao committed Nov 12, 2024
1 parent cecd18e commit a22f8d1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions cmd/notation/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ func getVerifier(ctx context.Context) (notation.Verifier, error) {
}
fileCache, err := crl.NewFileCache(cacheRoot)
if err != nil {
// discard NewFileCache error directly as cache is not critical
fmt.Printf("Warning: %v\n", err)
// discard NewFileCache error as cache errors are not critical
fmt.Fprintf(os.Stderr, "Warning: %v\n", err)
} else {
crlFetcher.Cache = &clicrl.CacheWithLog{
Cache: fileCache,
Expand Down
10 changes: 4 additions & 6 deletions test/e2e/suite/scenario/crl.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ var _ = Describe("notation CRL revocation check", Serial, func() {
})
})

It("successfully completed with cache creation error in debug log", func() {
It("successfully completed with cache creation error in warning message", func() {
Host(CRLOptions(), func(notation *utils.ExecOpts, artifact *Artifact, vhost *utils.VirtualHost) {
notation.Exec("sign", artifact.ReferenceWithDigest()).
MatchKeyWords(SignSuccessfully)
Expand All @@ -152,9 +152,9 @@ var _ = Describe("notation CRL revocation check", Serial, func() {
notation.Exec("verify", artifact.ReferenceWithDigest(), "-d").
MatchKeyWords(
VerifySuccessfully,
"Warning: failed to create crl file cache",
).
MatchErrKeyWords(
"Warning: failed to create crl file cache",
"OCSP check failed with unknown error and fallback to CRL check for certificate #2",
`"GET" "http://localhost:10086/intermediate.crl"`,
`"GET" "http://localhost:10086/leaf.crl"`,
Expand All @@ -165,7 +165,7 @@ var _ = Describe("notation CRL revocation check", Serial, func() {
})
})

It("failed with revoked leaf certificate and cache creation error in debug log", func() {
It("failed with revoked leaf certificate and cache creation error in warning message", func() {
Host(CRLOptions(), func(notation *utils.ExecOpts, artifact *Artifact, vhost *utils.VirtualHost) {
notation.Exec("sign", artifact.ReferenceWithDigest()).
MatchKeyWords(SignSuccessfully)
Expand All @@ -180,11 +180,9 @@ var _ = Describe("notation CRL revocation check", Serial, func() {

// verify without cache
notation.ExpectFailure().Exec("verify", artifact.ReferenceWithDigest(), "-d").
MatchKeyWords(
"Warning: failed to create crl file cache",
).
MatchErrKeyWords(
VerifyFailed,
"Warning: failed to create crl file cache",
"OCSP check failed with unknown error and fallback to CRL check for certificate #2",
`"GET" "http://localhost:10086/intermediate.crl"`,
`"GET" "http://localhost:10086/leaf.crl"`,
Expand Down

0 comments on commit a22f8d1

Please sign in to comment.