ci: non-constant format string (govet)

Signed-off-by: Praveen M <m.praveen@ibm.com>
This commit is contained in:
Praveen M
2024-12-20 18:23:59 +05:30
committed by mergify[bot]
parent 96408c01c8
commit 54a8b50957
14 changed files with 63 additions and 57 deletions

View File

@ -1665,7 +1665,7 @@ var _ = Describe("RBD", func() {
}
readOnlyErr := fmt.Sprintf("cannot create %s: Read-only file system", filePath)
if !strings.Contains(stdErr, readOnlyErr) {
framework.Failf(stdErr)
framework.Failf("failed to execute command %s: %v", cmd, stdErr)
}
}
@ -1798,7 +1798,7 @@ var _ = Describe("RBD", func() {
}
readOnlyErr := fmt.Sprintf("'%s': Operation not permitted", devPath)
if !strings.Contains(stdErr, readOnlyErr) {
framework.Failf(stdErr)
framework.Failf("failed to execute command %s: %v", cmd, stdErr)
}
}
err = deletePVCAndDeploymentApp(f, pvcClone, appClone)
@ -3350,14 +3350,15 @@ var _ = Describe("RBD", func() {
}
filePath := appClone.Spec.Containers[0].VolumeMounts[0].MountPath + "/test"
cmd := "echo 'Hello World' > " + filePath
_, stdErr := execCommandInPodAndAllowFail(
f,
"echo 'Hello World' > "+filePath,
cmd,
appClone.Namespace,
&opt)
readOnlyErr := fmt.Sprintf("cannot create %s: Read-only file system", filePath)
if !strings.Contains(stdErr, readOnlyErr) {
framework.Failf(stdErr)
framework.Failf("failed to execute command %s: %v", cmd, stdErr)
}
}
@ -3464,14 +3465,15 @@ var _ = Describe("RBD", func() {
}
filePath := appClone.Spec.Containers[0].VolumeMounts[0].MountPath + "/test"
cmd := "echo 'Hello World' > " + filePath
_, stdErr := execCommandInPodAndAllowFail(
f,
"echo 'Hello World' > "+filePath,
cmd,
appClone.Namespace,
&opt)
readOnlyErr := fmt.Sprintf("cannot create %s: Read-only file system", filePath)
if !strings.Contains(stdErr, readOnlyErr) {
framework.Failf(stdErr)
framework.Failf("failed to execute command %s: %v", cmd, stdErr)
}
}
@ -4126,14 +4128,15 @@ var _ = Describe("RBD", func() {
}
filePath := app.Spec.Containers[0].VolumeMounts[0].MountPath + "/test"
cmd := "echo 'Hello World' > " + filePath
_, stdErr := execCommandInPodAndAllowFail(
f,
"echo 'Hello World' > "+filePath,
cmd,
app.Namespace,
&opt)
readOnlyErr := fmt.Sprintf("cannot create %s: Read-only file system", filePath)
if !strings.Contains(stdErr, readOnlyErr) {
framework.Failf(stdErr)
framework.Failf("failed to execute command %s: %v", cmd, stdErr)
}
// delete PVC and app