sandbox: migrate sandbox_mode to sandboxer
Signed-off-by: Abel Feng <fshb1988@gmail.com>
This commit is contained in:
parent
c8012b6d74
commit
b0fef6738f
@ -67,6 +67,7 @@ func init() {
|
||||
return nil
|
||||
}
|
||||
conf := c.(map[string]interface{})
|
||||
migrateConfig(conf)
|
||||
plugins["io.containerd.internal.v1.cri"] = conf
|
||||
return nil
|
||||
},
|
||||
@ -175,3 +176,22 @@ func setGLogLevel() error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func migrateConfig(conf map[string]interface{}) {
|
||||
containerdConf, ok := conf["containerd"]
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
runtimesConf, ok := containerdConf.(map[string]interface{})["runtimes"]
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
for _, v := range runtimesConf.(map[string]interface{}) {
|
||||
runtimeConf := v.(map[string]interface{})
|
||||
if sandboxMode, ok := runtimeConf["sandbox_mode"]; ok {
|
||||
if _, ok := runtimeConf["sandboxer"]; !ok {
|
||||
runtimeConf["sandboxer"] = sandboxMode
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user