mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-28 08:17:37 +00:00
Merge pull request #2257 from fidencio/wip/runtime-option-fix
shim-v2: Be compatible with the old runtime options
This commit is contained in:
commit
a8a623fb75
@ -24,6 +24,7 @@ import (
|
||||
crioption "github.com/containerd/containerd/pkg/runtimeoptions/v1"
|
||||
_ "github.com/containerd/containerd/runtime/linux/runctypes"
|
||||
_ "github.com/containerd/containerd/runtime/v2/runc/options"
|
||||
oldcrioption "github.com/containerd/cri-containerd/pkg/api/runtimeoptions/v1"
|
||||
|
||||
"github.com/kata-containers/kata-containers/src/runtime/pkg/katautils"
|
||||
"github.com/kata-containers/kata-containers/src/runtime/pkg/katautils/katatrace"
|
||||
@ -188,6 +189,16 @@ func loadRuntimeConfig(s *service, r *taskAPI.CreateTaskRequest, anno map[string
|
||||
// and we'll ignore it.
|
||||
if ok {
|
||||
configPath = option.ConfigPath
|
||||
} else {
|
||||
// Some versions of containerd, such as 1.4.3, and 1.4.4
|
||||
// still rely on the runtime options coming from
|
||||
// github.com/containerd/cri-containerd/pkg/api/runtimeoptions/v1
|
||||
// Knowing that, instead of breaking compatibility with such
|
||||
// versions, let's work this around on our side
|
||||
oldOption, ok := v.(*oldcrioption.Options)
|
||||
if ok {
|
||||
configPath = oldOption.ConfigPath
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user