Fix profile updates and validate configuration before apply
This commit is contained in:
parent
b552ec49cb
commit
2bf14948d7
1 changed files with 372 additions and 12 deletions
|
|
@ -157,12 +157,24 @@ func TestLoadConfig(t *testing.T) {
|
|||
data := `python = "compute"
|
||||
terminals = ["app-terminal-", "app-org.example.Console"]
|
||||
|
||||
[profiles.default]
|
||||
cpu = "400%"
|
||||
high = "6G"
|
||||
memory = "8G"
|
||||
swap = "2G"
|
||||
|
||||
[profiles.compute]
|
||||
cpu = "800%"
|
||||
high = "12G"
|
||||
memory = "16G"
|
||||
swap = "2G"
|
||||
|
||||
[profiles.unrestricted]
|
||||
cpu = ""
|
||||
high = "infinity"
|
||||
memory = "infinity"
|
||||
swap = "infinity"
|
||||
|
||||
[[devices]]
|
||||
path = '/dev/mock'
|
||||
[devices.limits.compute]
|
||||
|
|
@ -190,7 +202,9 @@ java = "compute"
|
|||
t.Fatal(err)
|
||||
}
|
||||
want := testConfig()
|
||||
want.Profiles = map[string]profile{"compute": want.Profiles["compute"]}
|
||||
want.Profiles = map[string]profile{
|
||||
"compute": want.Profiles["compute"], "default": want.Profiles["default"], "unrestricted": want.Profiles["unrestricted"],
|
||||
}
|
||||
want.Devices[0].Limits = map[string]ioLimit{"compute": want.Devices[0].Limits["compute"]}
|
||||
want.Apps = map[string][]string{"compute": want.Apps["compute"]}
|
||||
want.Units["unrestricted"] = []string{"containerd.service"}
|
||||
|
|
|
|||
Loading…
Reference in a new issue