Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply networking timeout to aiohttp session globally #1157

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions kopf/_cogs/clients/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import aiohttp

from kopf._cogs.clients import errors
from kopf._cogs.configs import configuration
from kopf._cogs.helpers import versions
from kopf._cogs.structs import credentials

Expand Down Expand Up @@ -101,6 +102,8 @@ def __init__(
certificate_path: Optional[str]
private_key_path: Optional[str]

settings = configuration.OperatorSettings()

if info.ca_path and info.ca_data:
raise credentials.LoginError("Both CA path & data are set. Need only one.")
elif info.ca_path:
Expand Down Expand Up @@ -172,6 +175,11 @@ def __init__(
),
headers=headers,
auth=auth,
timeout=aiohttp.ClientTimeout(
total=settings.networking.request_timeout,
sock_connect=settings.networking.connect_timeout,
),

)

# Add the extra payload information. We avoid overriding the constructor.
Expand Down
Loading