Add scheduler config options for hold expiration

This adds max_hold_expiration and default_hold_expiration as
scheduler options.

max_hold_expiration sets the absolute maximum age, in seconds,
a node placed in the hold state will remain available. This
defaults to 0, which means there is no maximum.

default_hold_expiration sets the default value used if no value
is supplied. This defaults to max_hold_expiration.

Change-Id: Ia483ac664e0a2adcec9efb29d3d701f6d315ef3b
This commit is contained in:
David Shrewsbury
2019-09-17 11:14:26 -04:00
parent 2c1c9ae662
commit e8a0d799a6
6 changed files with 188 additions and 6 deletions

View File

@@ -199,12 +199,11 @@ class Client(zuul.cmd.ZuulApp):
cmd_autohold.add_argument('--count',
help='number of job runs (default: 1)',
required=False, type=int, default=1)
cmd_autohold.add_argument('--node-hold-expiration',
help=('how long in seconds should the '
'node set be in HOLD status '
'(default: nodepool\'s max-hold-age '
'if set, or indefinitely)'),
required=False, type=int, default=0)
cmd_autohold.add_argument(
'--node-hold-expiration',
help=('how long in seconds should the node set be in HOLD status '
'(default: scheduler\'s default_hold_expiration value)'),
required=False, type=int)
cmd_autohold.set_defaults(func=self.autohold)
cmd_autohold_delete = subparsers.add_parser(