Skip to content

Commit

Permalink
Merge pull request #7608 from hashicorp/b-config-lower-case
Browse files Browse the repository at this point in the history
Tweak declared hcl key casing in structs
  • Loading branch information
Mahmood Ali committed May 1, 2020
1 parent a3f0a4d commit 7d62bce
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
7 changes: 7 additions & 0 deletions command/agent/config_parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@ var basicConfig = &Config{
RetryIntervalHCL: "15s",
RetryMaxAttempts: 3,
},
DefaultSchedulerConfig: &structs.SchedulerConfiguration{
PreemptionConfig: structs.PreemptionConfig{
SystemSchedulerEnabled: true,
BatchSchedulerEnabled: true,
ServiceSchedulerEnabled: true,
},
},
},
ACL: &ACLConfig{
Enabled: true,
Expand Down
8 changes: 8 additions & 0 deletions command/agent/testdata/basic.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,14 @@ server {
retry_max = 3
retry_interval = "15s"
}

default_scheduler_config {
preemption_config {
batch_scheduler_enabled = true
system_scheduler_enabled = true
service_scheduler_enabled = true
}
}
}

acl {
Expand Down
7 changes: 7 additions & 0 deletions command/agent/testdata/basic.json
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,13 @@
"1.1.1.1",
"2.2.2.2"
],
"default_scheduler_config": [{
"preemption_config": [{
"batch_scheduler_enabled": true,
"system_scheduler_enabled": true,
"service_scheduler_enabled": true
}]
}],
"upgrade_version": "0.8.0"
}
],
Expand Down
2 changes: 1 addition & 1 deletion nomad/structs/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ type PreemptionConfig struct {
BatchSchedulerEnabled bool `hcl:"batch_scheduler_enabled"`

// ServiceSchedulerEnabled specifies if preemption is enabled for service jobs
ServiceSchedulerEnabled bool `hcl:"service_Scheduler_enabled"`
ServiceSchedulerEnabled bool `hcl:"service_scheduler_enabled"`
}

// SchedulerSetConfigRequest is used by the Operator endpoint to update the
Expand Down

0 comments on commit 7d62bce

Please sign in to comment.