Skip to content

Commit fdf2349

Browse files
author
Mrunal Patel
authored
Merge pull request cri-o#4097 from harche/runc_abst
handle runc not present on the system
2 parents 445854e + d2ded1d commit fdf2349

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

pkg/config/config.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,11 +456,17 @@ func (c *Config) UpdateFromFile(path string) error {
456456
t := new(tomlConfig)
457457
t.fromConfig(c)
458458

459-
_, err = toml.Decode(string(data), t)
459+
metadata, err := toml.Decode(string(data), t)
460460
if err != nil {
461461
return fmt.Errorf("unable to decode configuration %v: %v", path, err)
462462
}
463463

464+
runtimesKey := []string{"crio", "runtime", "default_runtime"}
465+
if metadata.IsDefined(runtimesKey...) &&
466+
t.Crio.Runtime.RuntimeConfig.DefaultRuntime != defaultRuntime {
467+
delete(c.Runtimes, defaultRuntime)
468+
}
469+
464470
t.toConfig(c)
465471
c.singleConfigPath = path
466472
return nil

pkg/config/template.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ grpc_max_recv_msg_size = {{ .GRPCMaxRecvMsgSize }}
110110
{{ range $ulimit := .DefaultUlimits }}{{ printf "#\t%q,\n" $ulimit }}{{ end }}#]
111111
112112
# default_runtime is the _name_ of the OCI runtime to be used as the default.
113-
# The name is matched against the runtimes map below.
113+
# The name is matched against the runtimes map below. If this value is changed,
114+
# the corresponding existing entry from the runtimes map below will be ignored.
114115
default_runtime = "{{ .DefaultRuntime }}"
115116
116117
# If true, the runtime will not use pivot_root, but instead use MS_MOVE.

0 commit comments

Comments
 (0)