Skip to content

Commit 4403974

Browse files
committed
[no-relnote] Don't use fmt.Sprintf
Signed-off-by: Evan Lezar <[email protected]>
1 parent 46c5d59 commit 4403974

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

cmd/nvidia-ctk-installer/container/runtime/crio/config_test.go

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package crio
1818

1919
import (
20-
"fmt"
2120
"os"
2221
"path/filepath"
2322
"strings"
@@ -27,7 +26,6 @@ import (
2726
cli "github.com/urfave/cli/v3"
2827

2928
"github.com/NVIDIA/nvidia-container-toolkit/cmd/nvidia-ctk-installer/container"
30-
"github.com/NVIDIA/nvidia-container-toolkit/internal/config"
3129
)
3230

3331
// TestCrioConfigLifecycle tests the complete Setup->Cleanup lifecycle for both config and hook modes
@@ -460,11 +458,10 @@ plugin_dirs = [
460458
actual, err := os.ReadFile(hookPath)
461459
require.NoError(t, err)
462460

463-
expectedContents := filepath.Join("/usr/bin", config.NVIDIAContainerRuntimeHookExecutable)
464-
expected := fmt.Sprintf(`{
461+
expected := `{
465462
"version": "1.0.0",
466463
"hook": {
467-
"path": "%s",
464+
"path": "/usr/bin/nvidia-container-runtime-hook",
468465
"args": [
469466
"nvidia-container-runtime-hook",
470467
"prestart"
@@ -483,7 +480,7 @@ plugin_dirs = [
483480
"prestart"
484481
]
485482
}
486-
`, expectedContents)
483+
`
487484

488485
require.Equal(t, expected, string(actual))
489486

@@ -542,11 +539,10 @@ plugin_dirs = [
542539
actual, err := os.ReadFile(hookPath)
543540
require.NoError(t, err)
544541

545-
expectedContents := filepath.Join("/usr/bin", config.NVIDIAContainerRuntimeHookExecutable)
546-
expected := fmt.Sprintf(`{
542+
expected := `{
547543
"version": "1.0.0",
548544
"hook": {
549-
"path": "%s",
545+
"path": "/usr/bin/nvidia-container-runtime-hook",
550546
"args": [
551547
"nvidia-container-runtime-hook",
552548
"prestart"
@@ -565,7 +561,7 @@ plugin_dirs = [
565561
"prestart"
566562
]
567563
}
568-
`, expectedContents)
564+
`
569565

570566
require.Equal(t, expected, string(actual))
571567

0 commit comments

Comments
 (0)