SIGN IN SIGN UP

Fix PermissionError in async OIDC token refresh on Windows

_refresh_oidc passed the name of an open NamedTemporaryFile to
OpenIDRequestor. On Windows the file cannot be reopened by path while the
original handle is alive, so any consumer reading the CA cert fails.

Add the module-level _create_temp_file_with_content helper, mirroring
kubernetes/base/config/kube_config.py, and use it for the CA cert. The
FileOrData method now delegates to it, which also closes the descriptor
that mkstemp returned.

Follow-up to #2644.
E
ealeonraz committed
880f22737c24c65fce32155a3e0d233fd3988931
Parent: 9bc5eac