runtime: Ignoring deprecated warning.

In the latest oci-spec, the prestart hook is deprecated.
However, the docker & nerdctl tests failed when I switched
to one of the newer hooks which don't run at quite the same time,
so ignore the deprecation warnings for now to unblock the security fix

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
This commit is contained in:
stevenhorsman 2025-05-01 11:39:52 +01:00
parent 37dda6060c
commit 4de79b9821
4 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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))