Skip to content

Commit

Permalink
refactor: standardize on "private" method names
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin O'Donnell <kevin@blockchaintp.com>
  • Loading branch information
scealiontach committed Jan 19, 2021
1 parent 236a04c commit b226d35
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bash/aws-get-kubeconfigs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ source "$(dirname "${BASH_SOURCE[0]}")/includer.sh"
@include log
@include options

function ::eksctl() {
function _eksctl() {
$(commands::use eksctl) "$@"
}

Expand All @@ -39,15 +39,16 @@ else
fi

function get_clusters() {
::eksctl get clusters -A -o json -v 0
_eksctl get clusters -A -o json -v 0
}

clusters="$(get_clusters)"
log::debug "Found clusters: $clusters"
for c in $(echo "$clusters" | jq -r '.[].metadata |.name+"="+.region'); do
for c in $(echo "$clusters" |
$(commands::use jq) -r '.[].metadata |.name+"="+.region'); do
cluster=$(echo "$c" | awk -F= '{print $1}')
region=$(echo "$c" | awk -F= '{print $2}')
log::info "Updating kubeconfig for $cluster in $region"
exec::hide ::eksctl utils write-kubeconfig --cluster "$cluster" \
exec::hide _eksctl utils write-kubeconfig --cluster "$cluster" \
--region "$region" || error::exit "Failed to update kubeconfig for $cluster"
done

0 comments on commit b226d35

Please sign in to comment.