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 type: dict
default: {} 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: memory_limit:
description: description:
- Resources define performance characteristics of your container. - Resources define performance characteristics of your container.
- They are allocated to your container at runtime. - They are allocated to your container at runtime.
- Unit is MB of memory.
type: int type: int
container_timeout: container_timeout:
@ -226,6 +235,7 @@ MUTABLE_ATTRIBUTES = (
"min_scale", "min_scale",
"max_scale", "max_scale",
"environment_variables", "environment_variables",
"cpu_limit",
"memory_limit", "memory_limit",
"timeout", "timeout",
"privacy", "privacy",
@ -246,6 +256,7 @@ def payload_from_wished_cn(wished_cn):
"max_scale": wished_cn["max_scale"], "max_scale": wished_cn["max_scale"],
"environment_variables": wished_cn["environment_variables"], "environment_variables": wished_cn["environment_variables"],
"secret_environment_variables": SecretVariables.dict_to_list(wished_cn["secret_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"], "memory_limit": wished_cn["memory_limit"],
"timeout": wished_cn["timeout"], "timeout": wished_cn["timeout"],
"privacy": wished_cn["privacy"], "privacy": wished_cn["privacy"],
@ -361,6 +372,7 @@ def core(module):
"max_scale": module.params["max_scale"], "max_scale": module.params["max_scale"],
"environment_variables": module.params['environment_variables'], "environment_variables": module.params['environment_variables'],
"secret_environment_variables": module.params['secret_environment_variables'], "secret_environment_variables": module.params['secret_environment_variables'],
"cpu_limit": module.params["cpu_limit"],
"memory_limit": module.params["memory_limit"], "memory_limit": module.params["memory_limit"],
"timeout": module.params["container_timeout"], "timeout": module.params["container_timeout"],
"privacy": module.params["privacy"], "privacy": module.params["privacy"],
@ -390,6 +402,7 @@ def main():
description=dict(type='str', default=''), description=dict(type='str', default=''),
min_scale=dict(type='int'), min_scale=dict(type='int'),
max_scale=dict(type='int'), max_scale=dict(type='int'),
cpu_limit=dict(type='int'),
memory_limit=dict(type='int'), memory_limit=dict(type='int'),
container_timeout=dict(type='str'), container_timeout=dict(type='str'),
privacy=dict(type='str', default='public', choices=['public', 'private']), privacy=dict(type='str', default='public', choices=['public', 'private']),