Skip to content

Commit

Permalink
Add timeout argument for docker.image.push() method (#929)
Browse files Browse the repository at this point in the history
* added timeout for push command

* add a feature #929 file

---------

Co-authored-by: costefan <konstantine.ovchynnikov@apolo.us>
  • Loading branch information
costefan and costefan authored Nov 20, 2024
1 parent ba05d80 commit a40b374
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES/929.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added timeout parameter for push method
4 changes: 4 additions & 0 deletions aiodocker/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ async def push(
auth: Optional[Union[JSONObject, str, bytes]] = None,
tag: Optional[str] = None,
stream: Literal[False] = False,
timeout: Union[float, Sentinel, None] = SENTINEL,
) -> Dict[str, Any]: ...

@overload
Expand All @@ -167,6 +168,7 @@ def push(
auth: Optional[Union[JSONObject, str, bytes]] = None,
tag: Optional[str] = None,
stream: Literal[True],
timeout: Union[float, Sentinel, None] = SENTINEL,
) -> AsyncIterator[Dict[str, Any]]: ...

def push(
Expand All @@ -176,6 +178,7 @@ def push(
auth: Optional[Union[JSONObject, str, bytes]] = None,
tag: Optional[str] = None,
stream: bool = False,
timeout: Union[float, Sentinel, None] = SENTINEL,
) -> Any:
params = {}
headers = {
Expand All @@ -197,6 +200,7 @@ def push(
"POST",
params=params,
headers=headers,
timeout=timeout,
)
return self._handle_response(cm, stream)

Expand Down

0 comments on commit a40b374

Please sign in to comment.