Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Aug 22, 2024
1 parent cb0d880 commit e431d22
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 4 additions & 1 deletion kr8s/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,10 @@ async def async_watch(
) as (obj_cls, response):
async for line in response.aiter_lines():
event = json.loads(line)
if event["object"]["kind"] == "Status" and event["object"].get("code") == 410:
if (
event["object"]["kind"] == "Status"
and event["object"].get("code") == 410
):
raise GoneError("Too old resource version")
yield event["type"], obj_cls(event["object"], api=self)

Expand Down
10 changes: 6 additions & 4 deletions kr8s/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,11 +328,13 @@ async def test_api_gone(example_pod_spec):
since=1,
):
# Patch the pod to increment the resourceVersion if needed
await pod.patch({
"metadata": {
"annotations": {"version": i},
await pod.patch(
{
"metadata": {
"annotations": {"version": i},
}
}
})
)
i += 1

await pod.delete()
Expand Down

0 comments on commit e431d22

Please sign in to comment.