mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-01 01:33:20 +00:00
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:
parent
37dda6060c
commit
4de79b9821
@ -136,7 +136,7 @@ func PreStartHooks(ctx context.Context, spec specs.Spec, cid, bundlePath string)
|
|||||||
return nil
|
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
|
// PostStartHooks run the hooks just after start container
|
||||||
|
@ -113,7 +113,7 @@ func TestPreStartHooks(t *testing.T) {
|
|||||||
hook := createHook(0)
|
hook := createHook(0)
|
||||||
spec = specs.Spec{
|
spec = specs.Spec{
|
||||||
Hooks: &specs.Hooks{
|
Hooks: &specs.Hooks{
|
||||||
Prestart: []specs.Hook{hook},
|
Prestart: []specs.Hook{hook}, //nolint:all
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
err = PreStartHooks(ctx, spec, testSandboxID, testBundlePath)
|
err = PreStartHooks(ctx, spec, testSandboxID, testBundlePath)
|
||||||
@ -123,7 +123,7 @@ func TestPreStartHooks(t *testing.T) {
|
|||||||
hook = createWrongHook()
|
hook = createWrongHook()
|
||||||
spec = specs.Spec{
|
spec = specs.Spec{
|
||||||
Hooks: &specs.Hooks{
|
Hooks: &specs.Hooks{
|
||||||
Prestart: []specs.Hook{hook},
|
Prestart: []specs.Hook{hook}, //nolint:all
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
err = PreStartHooks(ctx, spec, testSandboxID, testBundlePath)
|
err = PreStartHooks(ctx, spec, testSandboxID, testBundlePath)
|
||||||
|
@ -497,7 +497,7 @@ func IsDockerContainer(spec *specs.Spec) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, hook := range spec.Hooks.Prestart {
|
for _, hook := range spec.Hooks.Prestart { //nolint:all
|
||||||
for _, arg := range hook.Args {
|
for _, arg := range hook.Args {
|
||||||
if strings.HasPrefix(arg, "libnetwork") {
|
if strings.HasPrefix(arg, "libnetwork") {
|
||||||
return true
|
return true
|
||||||
|
@ -595,7 +595,7 @@ func TestIsDockerContainer(t *testing.T) {
|
|||||||
}
|
}
|
||||||
assert.False(IsDockerContainer(ociSpec))
|
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"},
|
Args: []string{"libnetwork-xxx"},
|
||||||
})
|
})
|
||||||
assert.True(IsDockerContainer(ociSpec))
|
assert.True(IsDockerContainer(ociSpec))
|
||||||
|
Loading…
Reference in New Issue
Block a user