You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The kubeconfig file loading (which does need to do IO reading) is marked as async in the place it does not do any IO, and NOT marked as async in the place it does 🙃
Possible solution
Leave top-level fn as async, but swap around what is async;
read() should be async and probably use tokio::fs (unless people have better ideas) and load() should be sync (it's a pure fn). This means the top level-fns are still async and it's a relatively minor breaking change to only low-level config loader fns.
For people who do wish to have a purely sync opener function (perhaps because people usually block at the start of an app's init), we could potentially add a secondary Config loader that's not async (by bypassing async read), but ideally would like this to be an addition rather than a breaking change (as proposed and rejected in #1650)
Affected crates
kube-client
The text was updated successfully, but these errors were encountered:
Current and expected behavior
As noted in #1645 and #1336
The kubeconfig file loading (which does need to do IO reading) is marked as async in the place it does not do any IO, and NOT marked as async in the place it does 🙃
Possible solution
Leave top-level fn as async, but swap around what is async;
kube/kube-client/src/config/file_loader.rs
Lines 28 to 36 in 3ee4ae5
read()
should be async and probably usetokio::fs
(unless people have better ideas) andload()
should be sync (it's a pure fn). This means the top level-fns are still async and it's a relatively minor breaking change to only low-level config loader fns.For people who do wish to have a purely sync opener function (perhaps because people usually block at the start of an app's init), we could potentially add a secondary
Config
loader that's not async (by bypassing async read), but ideally would like this to be an addition rather than a breaking change (as proposed and rejected in #1650)Affected crates
kube-client
The text was updated successfully, but these errors were encountered: