kopf
kopf copied to clipboard
Kopf requires aiohttp>=3
Long story short
When I install kopf, I get aiohttp 2.x.x which does not support the ssl kwarg in the aiohttp.TCPConnector constructor. According to the docs this kwarg is introduced in aiohttp version 3.0, so maybe kopf should require this a a minimal version. My workaround was to specify aiohttp 3.7.3 manually in my pyproject.toml.
Source: search for 'TCPConnector' or 'param ssl' on this page, then see the ssl parameter, it states "New in version 3.0"
my traceback:
kopf run operator.py
/Users/dino/Library/Caches/pypoetry/virtualenvs/deployment-operator-46HapXxc-py3.9/lib/python3.9/site-packages/kopf/reactor/running.py:157: FutureWarning: Absence of either namespaces or cluster-wide flag will become an error soon. For now, switching to the cluster-wide mode for backward compatibility.
warnings.warn("Absence of either namespaces or cluster-wide flag will become an error soon."
[2021-02-13 23:13:21,776] kopf.reactor.activit [INFO ] Initial authentication has been initiated.
[2021-02-13 23:13:21,786] kopf.activities.auth [INFO ] Activity 'login_via_client' succeeded.
[2021-02-13 23:13:21,786] kopf.reactor.activit [INFO ] Initial authentication has finished.
[2021-02-13 23:13:21,789] kopf.reactor.running [ERROR ] Resource observer has failed: __init__() got an unexpected keyword argument 'ssl'
Traceback (most recent call last):
File "/Users/dino/Library/Caches/pypoetry/virtualenvs/deployment-operator-46HapXxc-py3.9/lib/python3.9/site-packages/kopf/utilities/aiotasks.py", line 69, in guard
await coro
File "/Users/dino/Library/Caches/pypoetry/virtualenvs/deployment-operator-46HapXxc-py3.9/lib/python3.9/site-packages/kopf/reactor/observation.py", line 104, in resource_observer
resources = await scanning.scan_resources(groups=group_filter)
File "/Users/dino/Library/Caches/pypoetry/virtualenvs/deployment-operator-46HapXxc-py3.9/lib/python3.9/site-packages/kopf/clients/auth.py", line 42, in wrapper
async for key, info, context in vault.extended(APIContext, 'contexts'):
File "/Users/dino/Library/Caches/pypoetry/virtualenvs/deployment-operator-46HapXxc-py3.9/lib/python3.9/site-packages/kopf/structs/credentials.py", line 164, in extended
item.caches[purpose] = factory(item.info)
File "/Users/dino/Library/Caches/pypoetry/virtualenvs/deployment-operator-46HapXxc-py3.9/lib/python3.9/site-packages/kopf/clients/auth.py", line 183, in __init__
connector=aiohttp.TCPConnector(
TypeError: __init__() got an unexpected keyword argument 'ssl'
Traceback (most recent call last):
File "/Users/dino/Library/Caches/pypoetry/virtualenvs/deployment-operator-46HapXxc-py3.9/bin/kopf", line 8, in <module>
sys.exit(main())
File "/Users/dino/Library/Caches/pypoetry/virtualenvs/deployment-operator-46HapXxc-py3.9/lib/python3.9/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/Users/dino/Library/Caches/pypoetry/virtualenvs/deployment-operator-46HapXxc-py3.9/lib/python3.9/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/Users/dino/Library/Caches/pypoetry/virtualenvs/deployment-operator-46HapXxc-py3.9/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/dino/Library/Caches/pypoetry/virtualenvs/deployment-operator-46HapXxc-py3.9/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/dino/Library/Caches/pypoetry/virtualenvs/deployment-operator-46HapXxc-py3.9/lib/python3.9/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/Users/dino/Library/Caches/pypoetry/virtualenvs/deployment-operator-46HapXxc-py3.9/lib/python3.9/site-packages/kopf/cli.py", line 50, in wrapper
return fn(*args, **kwargs)
File "/Users/dino/Library/Caches/pypoetry/virtualenvs/deployment-operator-46HapXxc-py3.9/lib/python3.9/site-packages/click/decorators.py", line 73, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/Users/dino/Library/Caches/pypoetry/virtualenvs/deployment-operator-46HapXxc-py3.9/lib/python3.9/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/Users/dino/Library/Caches/pypoetry/virtualenvs/deployment-operator-46HapXxc-py3.9/lib/python3.9/site-packages/kopf/cli.py", line 97, in run
return running.run(
File "/Users/dino/Library/Caches/pypoetry/virtualenvs/deployment-operator-46HapXxc-py3.9/lib/python3.9/site-packages/kopf/reactor/running.py", line 47, in run
Environment
- Kopf version: kopf, version 1.29.2
- Kubernetes version: doesnt matter
- Python version: 3.9.1
- OS/platform: macOs big sur 11.1
Python packages installed
``` aiohttp @ file:///Users/dino/Library/Caches/pypoetry/artifacts/41/0f/23/7a69d935a278f7e9ae829d0ff2c9b669b96713f4eed57f6b64466634c5/aiohttp-3.7.3.tar.gz aiojobs @ file:///Users/dino/Library/Caches/pypoetry/artifacts/98/2c/2d/fbec70db545b5331949364846b7ac86cca4db40b91730da294b2f9ec50/aiojobs-0.3.0-py3-none-any.whl astroid @ file:///Users/dino/Library/Caches/pypoetry/artifacts/34/e0/99/2edbd67ade70c8c00b3e1ab5559e9ed5efc5470f97256888886f6d312a/astroid-2.4.2-py3-none-any.whl async-timeout @ file:///Users/dino/Library/Caches/pypoetry/artifacts/e1/e7/dc/347dacf16e20e4b15a992103281583f3a03db422172dec1c5f08d68c07/async_timeout-3.0.1-py3-none-any.whl attrs @ file:///Users/dino/Library/Caches/pypoetry/artifacts/f9/48/82/553e4bef24d3b294c0c18f27a7853f3ed151508efd144cb7ea37db1c48/attrs-20.3.0-py2.py3-none-any.whl cachetools @ file:///Users/dino/Library/Caches/pypoetry/artifacts/6f/e8/07/77a8a35bf67f89350dc9cf391674b48c6f880833c4c46a9309228d0546/cachetools-4.2.1-py3-none-any.whl certifi @ file:///Users/dino/Library/Caches/pypoetry/artifacts/d8/df/24/ed696681f34f8916b0aef99138db9a94e37d54684b9829af34a7fd4e39/certifi-2020.12.5-py2.py3-none-any.whl chardet @ file:///Users/dino/Library/Caches/pypoetry/artifacts/8f/6f/1c/8085d730ad63c462222af30d0d01c4bd0caca5287e40b63c1fe8f529b7/chardet-3.0.4-py2.py3-none-any.whl click @ file:///Users/dino/Library/Caches/pypoetry/artifacts/e2/79/34/a23e9d2f683ed66be11ec3bd760dec3a2fe228cfdedf2071bcf0531b06/click-7.1.2-py2.py3-none-any.whl google-auth @ file:///Users/dino/Library/Caches/pypoetry/artifacts/83/9f/60/33b898f8f35d337ff96f05454a752e14a79afeaf22d58da8687103dcff/google_auth-1.26.1-py2.py3-none-any.whl idna @ file:///Users/dino/Library/Caches/pypoetry/artifacts/ef/7f/a9/19cc0b8760bdf6f696290c06532496f8bb29fbdaad044f852fed00ec82/idna-2.10-py2.py3-none-any.whl iso8601 @ file:///Users/dino/Library/Caches/pypoetry/artifacts/d4/71/89/7658ef5c51dadec6c208c5b1ebdeeae0ef36ac56402685529704588aed/iso8601-0.1.14-py2.py3-none-any.whl isort @ file:///Users/dino/Library/Caches/pypoetry/artifacts/13/0e/9d/0ac87b4f86576f57416f5d21432dec16c02955743e7afe51afe253a24b/isort-5.7.0-py3-none-any.whl kopf @ file:///Users/dino/Library/Caches/pypoetry/artifacts/ec/55/f6/35d79e4b88276a813dd5dec4d45604a2cf668bee0b4c3779fcd9b0eba5/kopf-1.29.2-py3-none-any.whl kubernetes @ file:///Users/dino/Library/Caches/pypoetry/artifacts/c9/8b/5a/78ad793efb1c9385d86052d66cc892d11f33d38cff30bbfd2435ddc868/kubernetes-12.0.1-py2.py3-none-any.whl lazy-object-proxy @ file:///Users/dino/Library/Caches/pypoetry/artifacts/18/04/70/fa7b9e82b3409e05c268ba4038442836717cc0255979a9e8cfff1a415f/lazy-object-proxy-1.4.3.tar.gz mccabe @ file:///Users/dino/Library/Caches/pypoetry/artifacts/96/5e/5f/21ae5296697ca7f94de4da6e21d4936d74029c352a35202e4c339a4253/mccabe-0.6.1-py2.py3-none-any.whl multidict @ file:///Users/dino/Library/Caches/pypoetry/artifacts/67/72/75/4f22882a49c8f1595c644f316e1bbebbb8f4bbc8bf2de538f928cea588/multidict-5.1.0.tar.gz oauthlib @ file:///Users/dino/Library/Caches/pypoetry/artifacts/cd/73/ce/de02d263260699199b7d71249cfb85d546e2d53bbf3a508267e87b233e/oauthlib-3.1.0-py2.py3-none-any.whl pip==20.2.2 pyasn1 @ file:///Users/dino/Library/Caches/pypoetry/artifacts/7b/3a/54/42ce43b579bda01b9d79022fb733811594441e7a32e9f9a5a98f672bdc/pyasn1-0.4.8-py2.py3-none-any.whl pyasn1-modules @ file:///Users/dino/Library/Caches/pypoetry/artifacts/dd/b8/4f/b56433e0354274a31074995e01b8671751e9f0ed0001f5254e5b03a54f/pyasn1_modules-0.2.8-py2.py3-none-any.whl pylint @ file:///Users/dino/Library/Caches/pypoetry/artifacts/f5/28/9c/9c127841963caba0fa5310c92162143da8ad0b19de264fb03c7b25d79d/pylint-2.6.0-py3-none-any.whl python-dateutil @ file:///Users/dino/Library/Caches/pypoetry/artifacts/93/67/cf/49f56d9e954addcfc50e5ffc9faee013c2eb00c6d77d56c6a22cb33b54/python_dateutil-2.8.1-py2.py3-none-any.whl python-json-logger @ file:///Users/dino/Library/Caches/pypoetry/artifacts/6c/b2/9e/87d24622c6d60716f59f27298a0458888858784bc2ea70a34400f70ce6/python-json-logger-2.0.1.tar.gz PyYAML @ file:///Users/dino/Library/Caches/pypoetry/artifacts/4a/f4/03/07b8639f883fbaa6f6c0c9af133435a163e11ddcb00ebab6ec3daa09df/PyYAML-5.4.1.tar.gz requests @ file:///Users/dino/Library/Caches/pypoetry/artifacts/22/0a/9d/0df883fbffbb406d0cddbb35e881e4ac6bfb8f0dee8733056b6a054bf7/requests-2.25.1-py2.py3-none-any.whl requests-oauthlib @ file:///Users/dino/Library/Caches/pypoetry/artifacts/11/f5/eb/81a5da1da15ae0d7c5c1cc43f729856e59f8a0f09c77051ed1841bd01d/requests_oauthlib-1.3.0-py2.py3-none-any.whl rope @ file:///Users/dino/Library/Caches/pypoetry/artifacts/e9/fd/6c/b743a9ad0e91e4ddcfdef121030235cd39345a1bd7761143da136fabd6/rope-0.18.0.tar.gz rsa @ file:///Users/dino/Library/Caches/pypoetry/artifacts/ec/f9/78/8f0a5b86843da4022adb0c5a82223fd59c82e0e973b9150b847207c8a5/rsa-4.7-py3-none-any.whl setuptools==51.2.0 six @ file:///Users/dino/Library/Caches/pypoetry/artifacts/dd/1c/65/ad0dea11136f5a869f072890a0eea955aa8fc35b90c85c55249fd3abfe/six-1.15.0-py2.py3-none-any.whl toml @ file:///Users/dino/Library/Caches/pypoetry/artifacts/6b/6a/c9/53b19f7870a77d855e8b05ecdc98193944e5d246dafe11bbcad850ecba/toml-0.10.2-py2.py3-none-any.whl typing-extensions @ file:///Users/dino/Library/Caches/pypoetry/artifacts/ab/c3/72/446cb2c521f10fc837619e8a7c68ed3c3bd74859bd625b7d74f38a159b/typing_extensions-3.7.4.3-py3-none-any.whl urllib3 @ file:///Users/dino/Library/Caches/pypoetry/artifacts/3d/49/75/4245c9a53c80e9d437e00720b38959ccd850e173b62242bcea85c1b100/urllib3-1.26.3-py2.py3-none-any.whl websocket-client @ file:///Users/dino/Library/Caches/pypoetry/artifacts/83/d9/33/524e1bb12489c6d0573175851ad9e59b936282ac76e7a2c4f0308e1406/websocket_client-0.57.0-py2.py3-none-any.whl wheel==0.36.2 wrapt @ file:///Users/dino/Library/Caches/pypoetry/artifacts/6c/e2/d9/2c022794d212a87320efa16fd1b05654bf6656b6cf0510c072845ecc95/wrapt-1.12.1.tar.gz yapf @ file:///Users/dino/Library/Caches/pypoetry/artifacts/d4/79/c0/d3be7c7004716c6ab7c5177f8d59ec4d28e9152f045368536bcdd1b8a9/yapf-0.30.0-py2.py3-none-any.whl yarl @ file:///Users/dino/Library/Caches/pypoetry/artifacts/4a/2e/96/4e7dccdaca47b59e170425a689c820c9b76a11f8ac97501563cc294741/yarl-1.6.3.tar.gz</details>