Add cpu limit argument to scaleway_container (#10646)

Add cpu limit arguments

And document the units used for memory_limit and cpu_limit.
This commit is contained in:
mscherer 2025-08-23 18:36:00 +02:00 committed by GitHub
commit 09f11523d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 0 deletions

View file

@ -0,0 +1,2 @@
minor_changes:
- scaleway_container - add a ``cpu_limit`` argument (https://github.com/ansible-collections/community.general/pull/10646).

View file

@ -97,10 +97,19 @@ options:
type: dict
default: {}
cpu_limit:
description:
- Resources define performance characteristics of your container.
- They are allocated to your container at runtime.
- Unit is 1/1000 of a VCPU.
type: int
version_added: 11.3.0
memory_limit:
description:
- Resources define performance characteristics of your container.
- They are allocated to your container at runtime.
- Unit is MB of memory.
type: int
container_timeout:
@ -226,6 +235,7 @@ MUTABLE_ATTRIBUTES = (
"min_scale",
"max_scale",
"environment_variables",
"cpu_limit",
"memory_limit",
"timeout",
"privacy",
@ -246,6 +256,7 @@ def payload_from_wished_cn(wished_cn):
"max_scale": wished_cn["max_scale"],
"environment_variables": wished_cn["environment_variables"],
"secret_environment_variables": SecretVariables.dict_to_list(wished_cn["secret_environment_variables"]),
"cpu_limit": wished_cn["cpu_limit"],
"memory_limit": wished_cn["memory_limit"],
"timeout": wished_cn["timeout"],
"privacy": wished_cn["privacy"],
@ -361,6 +372,7 @@ def core(module):
"max_scale": module.params["max_scale"],
"environment_variables": module.params['environment_variables'],
"secret_environment_variables": module.params['secret_environment_variables'],
"cpu_limit": module.params["cpu_limit"],
"memory_limit": module.params["memory_limit"],
"timeout": module.params["container_timeout"],
"privacy": module.params["privacy"],
@ -390,6 +402,7 @@ def main():
description=dict(type='str', default=''),
min_scale=dict(type='int'),
max_scale=dict(type='int'),
cpu_limit=dict(type='int'),
memory_limit=dict(type='int'),
container_timeout=dict(type='str'),
privacy=dict(type='str', default='public', choices=['public', 'private']),