fix: various lint issues (#2571)

Originally found by @jkroepke in: https://github.com/project-zot/zot/actions/runs/10056774230/job/27796324933?pr=2556
And https://github.com/project-zot/zot/pull/2556 in general

This commit covers:
- (canonicalheader) capitalization of Docker-Content-Digest header
- (protogetter) the proto getters were not used, they check for nil pointers, we should switch to using them
- (zerologlint) fix the false positive

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>
This commit is contained in:
Andrei Aaron
2024-07-25 20:14:22 +03:00
committed by GitHub
parent 048e59186f
commit 7d87558b7e
5 changed files with 156 additions and 168 deletions
+2 -2
View File
@@ -307,7 +307,7 @@ func fetchImageIndexStruct(ctx context.Context, job *httpJob) (*imageStruct, err
return nil, err
}
indexDigest := header.Get("docker-content-digest")
indexDigest := header.Get("Docker-Content-Digest")
indexSize, err := strconv.ParseInt(header.Get("Content-Length"), 10, 64)
if err != nil {
@@ -398,7 +398,7 @@ func fetchManifestStruct(ctx context.Context, repo, manifestReference string, se
return common.ManifestSummary{}, err
}
manifestDigest := header.Get("docker-content-digest")
manifestDigest := header.Get("Docker-Content-Digest")
configDigest := manifestResp.Config.Digest.String()
configContent, err := fetchConfig(ctx, repo, configDigest, searchConf, username, password)