Skip to content

Commit

Permalink
kubernetes-asyncio 31.1.0
Browse files Browse the repository at this point in the history
Uses BearerToken in kube_auth.py
  • Loading branch information
WalBeh committed Sep 19, 2024
1 parent 98767e7 commit 30d9908
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Changelog
Unreleased
----------

* Upgrade to kubernetes-asyncio 31.1.0

2.41.1 (2024-08-30)
-------------------

Expand Down
3 changes: 2 additions & 1 deletion crate/operator/kube_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ async def login_via_kubernetes_asyncio(
will be made to use that config file. In other cases, an in-cluster
authentication will be tried.
"""

if config.KUBECONFIG:
logger.info("Authenticating with KUBECONFIG='%s'", config.KUBECONFIG)
await load_kube_config(config_file=config.KUBECONFIG)
Expand All @@ -59,7 +60,7 @@ async def login_via_kubernetes_asyncio(
# We need the actual auth-provider's token, so we call it instead of
# accessing api_key.
# Other keys (token, tokenFile) also end up being retrieved via this method.
header: Optional[str] = k8s_config.get_api_key_with_prefix("authorization")
header: Optional[str] = k8s_config.get_api_key_with_prefix("BearerToken")
parts: Sequence[str] = header.split(" ", 1) if header else []
scheme, token = (
(None, None)
Expand Down
4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ def read(path: str) -> str:
"aiopg==1.4.0",
"bitmath==1.3.3.1",
"kopf==1.35.6",
# Careful with 22+ - it is currently not compatible
# and results in various "permission denied" errors.
"kubernetes-asyncio==21.7.1",
"kubernetes-asyncio==31.1.0",
"PyYAML<7.0",
"prometheus_client==0.20.0",
"aiohttp==3.10.5",
Expand Down
1 change: 1 addition & 0 deletions tests/test_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ def test(self, faker, random_string):
assert c_crate.image == "foo/bar:1.2.3"
assert c_crate.name == "crate"
assert c_crate.resources.to_dict() == {
"claims": None,
"limits": {"cpu": str(cpus), "memory": memory},
"requests": {"cpu": str(cpus), "memory": memory},
}
Expand Down

0 comments on commit 30d9908

Please sign in to comment.