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

Commit

Permalink
set auth in cluster context so it works with EKS (#56)
Browse files Browse the repository at this point in the history
* support certificate-authority-data for eks

* update authoris

* Revert "support certificate-authority-data for eks"

This reverts commit c095ca9.

* set AUTH_USER under context
  • Loading branch information
jensendw authored and superbrothers committed Nov 20, 2018
1 parent 26fa30c commit f3682b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ O. Yuanying
Anne Schuth
Werner Buck
Lucas de Haas
Daniel Jensen
6 changes: 3 additions & 3 deletions assets/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ setup_kubectl() {
fi
exe kubectl config set-cluster "$CLUSTER_NAME" "${set_cluster_opts[@]}"

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

exe kubectl config use-context "$CONTEXT_NAME"

Expand Down Expand Up @@ -110,11 +110,11 @@ EOF
if [[ -n "$namespace" ]]; then
exe kubectl config set-context "$(kubectl config current-context)" --namespace="$namespace"
fi

# if providing a token we set a user and override context to support both kubeconfig and generated config
local token
token="$(jq -r '.source.token // ""' < "$payload")"
if [[ -n "$token" ]]; then
if [[ -n "$token" ]]; then
# Build options for kubectl config set-credentials
# Avoid to expose the token string by using placeholder
local set_credentials_opts
Expand Down

0 comments on commit f3682b6

Please sign in to comment.