20 lines
572 B
Plaintext
20 lines
572 B
Plaintext
|
#!/bin/zsh
|
||
|
_DEPENDENCIES+=()
|
||
|
_REQUIRED_ENV+=()
|
||
|
source ${0:a:h}/common.zsh
|
||
|
#####################################################################
|
||
|
|
||
|
__STATUS "performing AWS ECR docker login"
|
||
|
|
||
|
CLUSTER_NAME=$(\
|
||
|
_AWS eks list-clusters \
|
||
|
| jq -r '.[] | .[]' \
|
||
|
| __FZF 'select a cluster'
|
||
|
)
|
||
|
[ ! $CLUSTER_NAME ] && __ABORT
|
||
|
|
||
|
__STATUS "updating kubeconfig for '$CLUSTER_NAME'"
|
||
|
_AWS eks update-kubeconfig --name $CLUSTER_NAME \
|
||
|
&& __SUCCESS "kubeconfig updated with '$CLUSTER_NAME'" \
|
||
|
|| __ERROR "failed to update kubeconfig; do you have permissions to access '$CLUSTER_NAME'?"
|