-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Allow None value maximum_timeout for gitlab_runner #11174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
85db976
f72d530
8903bdb
7d46fad
55970b1
592db54
3842e8b
c455215
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| minor_changes: | ||
| - gitlab_runner - Convert ``maximum_timeout`` to ``None`` when set to 0 (https://github.com/ansible-collections/community.general/pull/11174). | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -131,7 +131,7 @@ | |
| version_added: 6.3.0 | ||
| maximum_timeout: | ||
| description: | ||
| - The maximum time that a runner has to complete a specific job. | ||
| - The maximum time that a runner has to complete a specific job. Use 0 to set to None. | ||
felixfontein marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| default: 3600 | ||
| type: int | ||
| run_untagged: | ||
|
|
@@ -365,7 +365,7 @@ def update_runner(self, runner, arguments): | |
| changed = False | ||
|
|
||
| for arg_key, arg_value in arguments.items(): | ||
| if arg_value is not None: | ||
| if arg_value is not None or arg_key == "maximum_timeout": | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After changing the disable value to
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since the value of maximum_timeout is already converted to None at this stage without this check a value of 0 would end up being skipped for updates. |
||
| if isinstance(arg_value, list): | ||
| list1 = getattr(runner, arg_key) | ||
| list1.sort() | ||
|
|
@@ -475,7 +475,10 @@ def main(): | |
| run_untagged = module.params["run_untagged"] | ||
| runner_locked = module.params["locked"] | ||
| access_level = module.params["access_level"] | ||
| maximum_timeout = module.params["maximum_timeout"] | ||
| if module.params["maximum_timeout"] == 0: | ||
| maximum_timeout = None | ||
| else: | ||
| maximum_timeout = module.params["maximum_timeout"] | ||
| registration_token = module.params["registration_token"] | ||
| project = module.params["project"] | ||
| group = module.params["group"] | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.