Skip to content

Commit 0c3493c

Browse files
committed
mantle: fix errors when building tests
``` [coreos-assembler]$ make mantle-check cd mantle && ./test Building tests... ? github.com/coreos/coreos-assembler/mantle/auth [no test files] platform/metal.go:315:26: non-constant format string in call to fmt.Errorf kola/harness.go:1309:14: non-constant format string in call to (*github.com/coreos/coreos-assembler/mantle/harness.H).Fatalf ? github.com/coreos/coreos-assembler/mantle/cli [no test files] kola/tests/misc/network.go:172:12: non-constant format string in call to (*github.com/coreos/coreos-assembler/mantle/harness.H).Errorf kola/tests/misc/network.go:668:12: non-constant format string in call to (*github.com/coreos/coreos-assembler/mantle/harness.H).Fatalf kola/tests/misc/network.go:673:13: non-constant format string in call to (*github.com/coreos/coreos-assembler/mantle/harness.H).Fatalf ``` I asked for help from AI on this and it took care of things for me. Assisted-By: <google/gemini-2.5-pro>
1 parent 4ba766c commit 0c3493c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

mantle/kola/harness.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1306,7 +1306,7 @@ ExecStart=%s
13061306
plog.Errorf("failed to get terminal via ssh: %v", err)
13071307
}
13081308
}
1309-
c.Fatalf(errors.Wrapf(err, "kolet failed: %s", stderr).Error())
1309+
c.Fatalf("kolet failed: %s: %v", stderr, err)
13101310
}
13111311
},
13121312

mantle/kola/tests/misc/network.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ func NetworkListeners(c cluster.TestCluster) {
169169
return checkListeners(c, expectedListeners)
170170
}
171171
if err := util.Retry(3, 5*time.Second, checkList); err != nil {
172-
c.Errorf(err.Error())
172+
c.Errorf("%v", err)
173173
}
174174
}
175175

@@ -665,12 +665,12 @@ func getConnectionIpv4Addresses(c cluster.TestCluster, m platform.Machine, conne
665665
func checkExpectedMACs(c cluster.TestCluster, m platform.Machine, expectedMacsList []string) {
666666
macConnectionMap, err := getMacConnectionMap(c, m)
667667
if err != nil {
668-
c.Fatalf(fmt.Sprintf("failed to get macConnectionMap: %v", err))
668+
c.Fatalf("failed to get macConnectionMap: %v", err)
669669
}
670670

671671
for _, expectedMac := range expectedMacsList {
672672
if _, exists := macConnectionMap[expectedMac]; !exists {
673-
c.Fatalf(fmt.Sprintf("expected Mac %s does not appear in macConnectionMap %v", expectedMac, macConnectionMap))
673+
c.Fatalf("expected Mac %s does not appear in macConnectionMap %v", expectedMac, macConnectionMap)
674674
}
675675
}
676676
}

mantle/platform/metal.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ func (inst *Install) setup(kern *kernelSetup) (*installerRun, error) {
312312
pxe.tftpipaddr = "10.0.2.2"
313313
pxe.bootindex = "1"
314314
default:
315-
return nil, fmt.Errorf("Unsupported arch %s" + coreosarch.CurrentRpmArch())
315+
return nil, fmt.Errorf("Unsupported arch %s", coreosarch.CurrentRpmArch())
316316
}
317317

318318
mux := http.NewServeMux()

0 commit comments

Comments
 (0)