Skip to content

Commit c783fc7

Browse files
abel-vonpull[bot]
authored andcommitted
sandbox: migrate sandbox_mode to sandboxer
Signed-off-by: Abel Feng <[email protected]>
1 parent bff6d32 commit c783fc7

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

pkg/cri/server/base/cri_base.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ func init() {
6767
return nil
6868
}
6969
conf := c.(map[string]interface{})
70+
migrateConfig(conf)
7071
plugins["io.containerd.internal.v1.cri"] = conf
7172
return nil
7273
},
@@ -175,3 +176,22 @@ func setGLogLevel() error {
175176
}
176177
return nil
177178
}
179+
180+
func migrateConfig(conf map[string]interface{}) {
181+
containerdConf, ok := conf["containerd"]
182+
if !ok {
183+
return
184+
}
185+
runtimesConf, ok := containerdConf.(map[string]interface{})["runtimes"]
186+
if !ok {
187+
return
188+
}
189+
for _, v := range runtimesConf.(map[string]interface{}) {
190+
runtimeConf := v.(map[string]interface{})
191+
if sandboxMode, ok := runtimeConf["sandbox_mode"]; ok {
192+
if _, ok := runtimeConf["sandboxer"]; !ok {
193+
runtimeConf["sandboxer"] = sandboxMode
194+
}
195+
}
196+
}
197+
}

0 commit comments

Comments
 (0)