oversubscription: add memory_max to hclv1

Allow specifying the `memory_max` field in HCL under the resources block.

Though HCLv1 is deprecated, I've updated them to ease our testing.
This commit is contained in:
Mahmood Ali
2021-03-26 16:11:26 -04:00
parent 7df90da9c8
commit 18e1a599ed
3 changed files with 7 additions and 4 deletions

View File

@@ -548,6 +548,7 @@ func parseResources(result *api.Resources, list *ast.ObjectList) error {
"iops", // COMPAT(0.10): Remove after one release to allow it to be removed from jobspecs
"disk",
"memory",
"memory_max",
"network",
"device",
}

View File

@@ -285,8 +285,9 @@ func TestParse(t *testing.T) {
"LOREM": "ipsum",
},
Resources: &api.Resources{
CPU: intToPtr(500),
MemoryMB: intToPtr(128),
CPU: intToPtr(500),
MemoryMB: intToPtr(128),
MemoryMaxMB: intToPtr(256),
Networks: []*api.NetworkResource{
{
MBits: intToPtr(100),

View File

@@ -227,8 +227,9 @@ job "binstore-storagelocker" {
}
resources {
cpu = 500
memory = 128
cpu = 500
memory = 128
memory_max = 256
network {
mbits = "100"