jobspec: add max_client_disconnect to hcl1 group parsing. (#12568)

This commit is contained in:
James Rasell 2022-04-14 14:56:58 +02:00 committed by GitHub
parent 3f871973f9
commit 5a67866ae1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 0 deletions

View File

@ -57,6 +57,7 @@ func parseGroups(result *api.Job, list *ast.ObjectList) error {
"volume",
"scaling",
"stop_after_client_disconnect",
"max_client_disconnect",
}
if err := checkHCLKeys(listVal, valid); err != nil {
return multierror.Prefix(err, fmt.Sprintf("'%s' ->", n))

View File

@ -201,6 +201,7 @@ func TestParse(t *testing.T) {
},
},
StopAfterClientDisconnect: timeToPtr(120 * time.Second),
MaxClientDisconnect: timeToPtr(120 * time.Hour),
ReschedulePolicy: &api.ReschedulePolicy{
Interval: timeToPtr(12 * time.Hour),
Attempts: intToPtr(5),

View File

@ -158,6 +158,7 @@ job "binstore-storagelocker" {
}
stop_after_client_disconnect = "120s"
max_client_disconnect = "120h"
task "binstore" {
driver = "docker"