Skip to content

Commit d63fe04

Browse files
author
zshotan
committed
updated
1 parent b6b6f66 commit d63fe04

File tree

1 file changed

+3
-1
lines changed
  • airflow_kubernetes_job_operator/kube_api

1 file changed

+3
-1
lines changed

airflow_kubernetes_job_operator/kube_api/config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@ def load_in_cluster():
126126

127127
configuration.host = loader.host
128128
configuration.ssl_ca_cert = loader.ssl_ca_cert
129-
configuration.api_key["authorization"] = "bearer " + loader.token
129+
configuration.api_key["authorization"] = (
130+
loader.token if loader.token.lower().strip().startswith("bearer ") else "bearer " + loader.token
131+
)
130132
default_namespace_file = os.path.join(DEFAULT_SERVICE_ACCOUNT_PATH, "namespace")
131133
if os.path.exists(default_namespace_file):
132134
with open(default_namespace_file, "r") as raw:

0 commit comments

Comments
 (0)