Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -456,11 +456,17 @@ func (c *Config) UpdateFromFile(path string) error {
t := new(tomlConfig)
t.fromConfig(c)

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

runtimesKey := []string{"crio", "runtime", "default_runtime"}
if metadata.IsDefined(runtimesKey...) &&
t.Crio.Runtime.RuntimeConfig.DefaultRuntime != defaultRuntime {
delete(c.Runtimes, defaultRuntime)
}

t.toConfig(c)
c.singleConfigPath = path
return nil
Expand Down
3 changes: 2 additions & 1 deletion pkg/config/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ grpc_max_recv_msg_size = {{ .GRPCMaxRecvMsgSize }}
{{ range $ulimit := .DefaultUlimits }}{{ printf "#\t%q,\n" $ulimit }}{{ end }}#]

# default_runtime is the _name_ of the OCI runtime to be used as the default.
# The name is matched against the runtimes map below.
# The name is matched against the runtimes map below. If this value is changed,
# the corresponding existing entry from the runtimes map below will be ignored.
default_runtime = "{{ .DefaultRuntime }}"

# If true, the runtime will not use pivot_root, but instead use MS_MOVE.
Expand Down