Skip to content

Commit

Permalink
raise ConfigException on invalid named-arguments to load_incluster_co…
Browse files Browse the repository at this point in the history
…nfig
  • Loading branch information
addyess committed Mar 1, 2024
1 parent 851dc2a commit 114ff1c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kubernetes/base/config/incluster_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,15 @@ def _read_token_file(self):
) + self._token_refresh_period


def load_incluster_config(client_configuration=None, try_refresh_token=True):
def load_incluster_config(client_configuration=None, try_refresh_token=True, **kwds):
"""
Use the service account kubernetes gives to pods to connect to kubernetes
cluster. It's intended for clients that expect to be running inside a pod
running on kubernetes. It will raise an exception if called from a process
not running in a kubernetes environment."""
for val in kds.values():
if val is not None:
raise ConfigException(f"Unimplemented named-argument {val} for incluster config")
InClusterConfigLoader(
token_filename=SERVICE_TOKEN_FILENAME,
cert_filename=SERVICE_CERT_FILENAME,
Expand Down

0 comments on commit 114ff1c

Please sign in to comment.