Skip to content
This repository was archived by the owner on Oct 3, 2020. It is now read-only.

Commit a569478

Browse files
wph95hjacobs
authored andcommitted
fix k8s config user both 'token' and 'client-certificate' (#44)
1 parent 40b1eb4 commit a569478

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pykube/http.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,14 @@ def send(self, request, **kwargs):
125125
# @@@ support token refresh
126126
if "id-token" in auth_config:
127127
request.headers["Authorization"] = "Bearer {}".format(auth_config["id-token"])
128-
elif "client-certificate" in config.user:
128+
elif config.user.get("username") and config.user.get("password"):
129+
request.prepare_auth((config.user["username"], config.user["password"]))
130+
131+
if "client-certificate" in config.user:
129132
kwargs["cert"] = (
130133
config.user["client-certificate"].filename(),
131134
config.user["client-key"].filename(),
132135
)
133-
elif config.user.get("username") and config.user.get("password"):
134-
request.prepare_auth((config.user["username"], config.user["password"]))
135136

136137
# setup certificate verification
137138

0 commit comments

Comments
 (0)