diff --git a/src/runtime/pkg/katautils/hook.go b/src/runtime/pkg/katautils/hook.go index 8ed6361ae1..313a1348f1 100644 --- a/src/runtime/pkg/katautils/hook.go +++ b/src/runtime/pkg/katautils/hook.go @@ -136,7 +136,7 @@ func PreStartHooks(ctx context.Context, spec specs.Spec, cid, bundlePath string) return nil } - return runHooks(ctx, spec, spec.Hooks.Prestart, cid, bundlePath, "pre-start") + return runHooks(ctx, spec, spec.Hooks.Prestart, cid, bundlePath, "pre-start") //nolint:all } // PostStartHooks run the hooks just after start container diff --git a/src/runtime/pkg/katautils/hook_test.go b/src/runtime/pkg/katautils/hook_test.go index b7bb03409c..7f62cffba0 100644 --- a/src/runtime/pkg/katautils/hook_test.go +++ b/src/runtime/pkg/katautils/hook_test.go @@ -113,7 +113,7 @@ func TestPreStartHooks(t *testing.T) { hook := createHook(0) spec = specs.Spec{ Hooks: &specs.Hooks{ - Prestart: []specs.Hook{hook}, + Prestart: []specs.Hook{hook}, //nolint:all }, } err = PreStartHooks(ctx, spec, testSandboxID, testBundlePath) @@ -123,7 +123,7 @@ func TestPreStartHooks(t *testing.T) { hook = createWrongHook() spec = specs.Spec{ Hooks: &specs.Hooks{ - Prestart: []specs.Hook{hook}, + Prestart: []specs.Hook{hook}, //nolint:all }, } err = PreStartHooks(ctx, spec, testSandboxID, testBundlePath) diff --git a/src/runtime/virtcontainers/utils/utils.go b/src/runtime/virtcontainers/utils/utils.go index 4893a0fe26..2ab4afadae 100644 --- a/src/runtime/virtcontainers/utils/utils.go +++ b/src/runtime/virtcontainers/utils/utils.go @@ -497,7 +497,7 @@ func IsDockerContainer(spec *specs.Spec) bool { return false } - for _, hook := range spec.Hooks.Prestart { + for _, hook := range spec.Hooks.Prestart { //nolint:all for _, arg := range hook.Args { if strings.HasPrefix(arg, "libnetwork") { return true diff --git a/src/runtime/virtcontainers/utils/utils_test.go b/src/runtime/virtcontainers/utils/utils_test.go index d2e4091060..0017072af8 100644 --- a/src/runtime/virtcontainers/utils/utils_test.go +++ b/src/runtime/virtcontainers/utils/utils_test.go @@ -595,7 +595,7 @@ func TestIsDockerContainer(t *testing.T) { } assert.False(IsDockerContainer(ociSpec)) - ociSpec.Hooks.Prestart = append(ociSpec.Hooks.Prestart, specs.Hook{ + ociSpec.Hooks.Prestart = append(ociSpec.Hooks.Prestart, specs.Hook{ //nolint:all Args: []string{"libnetwork-xxx"}, }) assert.True(IsDockerContainer(ociSpec))