Skip to content

Commit

Permalink
Fix parsing of Pod.created
Browse files Browse the repository at this point in the history
  • Loading branch information
LewisGaul committed Oct 31, 2024
1 parent 24ef6b7 commit a3ecb77
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion python_on_whales/components/pod/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from typing import List, Mapping, Optional

import pydantic
from pydantic import AliasChoices
from typing_extensions import Annotated

from python_on_whales.components.container.models import PortBinding
Expand Down Expand Up @@ -35,7 +36,10 @@ class PodContainer(DockerCamelModel):
class PodInspectResult(DockerCamelModel):
id: Optional[str] = None
name: Optional[str] = None
created: Annotated[Optional[datetime], pydantic.Field(alias="CreatedAt")] = None
created: Annotated[
Optional[datetime],
pydantic.Field(validation_alias=AliasChoices("Created", "CreatedAt")),
] = None
create_command: Optional[List[str]] = None
exit_policy: Optional[str] = None
state: Optional[str] = None
Expand Down

0 comments on commit a3ecb77

Please sign in to comment.