Skip to content

Commit f16de30

Browse files
author
Magnus Bengtsson
committed
Fix failing checks
1 parent 028a730 commit f16de30

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

doc/cosign_upload_blob.md

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/cosign/remote/index_test.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ func TestUploadFiles(t *testing.T) {
215215
}
216216
})
217217
}
218-
219218
}
220219

221220
func checkPlatform(t *testing.T, ref name.Reference, p *v1.Platform) bool {
@@ -272,11 +271,12 @@ func checkIndex(t *testing.T, ref name.Reference) bool {
272271

273272
func checkAnnotations(t *testing.T, ref name.Reference, annotations map[string]string) bool {
274273
t.Helper()
275-
var found bool = false
274+
var found bool
276275
d, err := remote.Get(ref)
277276
if err != nil {
278277
t.Fatalf("Get() = %v", err)
279278
}
279+
280280
if d.MediaType.IsIndex() {
281281
idx, err := remote.Index(ref)
282282
if err != nil {
@@ -286,7 +286,7 @@ func checkAnnotations(t *testing.T, ref name.Reference, annotations map[string]s
286286
if err != nil {
287287
t.Fatalf("IndexManifest() = %v", err)
288288
}
289-
for annotationsKey, _ := range annotations {
289+
for annotationsKey := range annotations {
290290
_, ok := m.Annotations[annotationsKey]
291291
if ok {
292292
found = true
@@ -301,14 +301,13 @@ func checkAnnotations(t *testing.T, ref name.Reference, annotations map[string]s
301301
t.Fatalf("Image() = %v", err)
302302
}
303303
m, _ := i.Manifest()
304-
for annotationsKey, _ := range annotations {
304+
for annotationsKey := range annotations {
305305
_, ok := m.Annotations[annotationsKey]
306306
if ok {
307307
found = true
308308
}
309309
}
310310
return found
311311
}
312-
313312
return false
314313
}

pkg/cosign/remote/testdata/bar

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
bar
1+
bar

pkg/cosign/remote/testdata/foo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
foo
1+
foo

test/e2e_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ func TestUploadBlob(t *testing.T) {
909909

910910
// Upload it!
911911
files := []cremote.File{cremote.FileFromFlag(payloadPath)}
912-
must(upload.BlobCmd(ctx, options.RegistryOptions{}, files, "", imgName), t)
912+
must(upload.BlobCmd(ctx, options.RegistryOptions{}, files, nil, "", imgName), t)
913913

914914
// Check it
915915
ref, err := name.ParseReference(imgName)

0 commit comments

Comments
 (0)