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

Commit f3682b6

Browse files
jensendwsuperbrothers
authored andcommitted
set auth in cluster context so it works with EKS (#56)
* support certificate-authority-data for eks * update authoris * Revert "support certificate-authority-data for eks" This reverts commit c095ca9. * set AUTH_USER under context
1 parent 26fa30c commit f3682b6

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ O. Yuanying
99
Anne Schuth
1010
Werner Buck
1111
Lucas de Haas
12+
Daniel Jensen

assets/common.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ setup_kubectl() {
6363
fi
6464
exe kubectl config set-cluster "$CLUSTER_NAME" "${set_cluster_opts[@]}"
6565

66-
exe kubectl config set-context "$CONTEXT_NAME" --cluster="$CLUSTER_NAME"
66+
exe kubectl config set-context "$CONTEXT_NAME" --cluster="$CLUSTER_NAME" --user "$AUTH_NAME"
6767

6868
exe kubectl config use-context "$CONTEXT_NAME"
6969

@@ -110,11 +110,11 @@ EOF
110110
if [[ -n "$namespace" ]]; then
111111
exe kubectl config set-context "$(kubectl config current-context)" --namespace="$namespace"
112112
fi
113-
113+
114114
# if providing a token we set a user and override context to support both kubeconfig and generated config
115115
local token
116116
token="$(jq -r '.source.token // ""' < "$payload")"
117-
if [[ -n "$token" ]]; then
117+
if [[ -n "$token" ]]; then
118118
# Build options for kubectl config set-credentials
119119
# Avoid to expose the token string by using placeholder
120120
local set_credentials_opts

0 commit comments

Comments
 (0)