Closed jonakarl closed 8 months ago
Many thanks for the bug report. The right data type should be privileges: Optional[Dict[str, Union[None, str, bool]]] = None
. I'm open to a pull request to fix it (with the offending json added to the list of json files to try in the unit tests). If no one does it, I'll do it when I have the time.
When executing docker.stack.services(stack_name)
I get the following error:
The offending output is :
Fully upgraded python-on-whales (from pypi) and docker. It looks like the "NoNewPrivileges" has changed from string to bool
To fix it you can change line https://github.com/gabrieldemarmiesse/python-on-whales/blob/d8420f923fd6759d4c74a204808473d1472cb538/python_on_whales/components/service/models.py#L23C5-L23C16 ->
privileges: Optional[Dict[str, Any]] = None
Never worked with pydantic before so I have no clue what the side effects of this are or the reason to enforce it to (optional) str in the first place.
Full output: