From bdc8eaf8e54abe047210286aa597bbeeda210054 Mon Sep 17 00:00:00 2001 From: Alex Luehm Date: Wed, 22 Jan 2025 12:54:54 -0600 Subject: [PATCH] feat(kubernetes-context): Support AWS govcloud accounts --- scripts/kubernetes_context.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/kubernetes_context.sh b/scripts/kubernetes_context.sh index d3e139cc..25930c43 100755 --- a/scripts/kubernetes_context.sh +++ b/scripts/kubernetes_context.sh @@ -17,7 +17,7 @@ current_cluster=$(kubectl config view --minify --output 'jsonpath={.contexts[?(@ current_namespace=$(kubectl config view --minify --output 'jsonpath={.contexts[?(@.name=="'$current_context'")].context.namespace}'; echo) current_account_id="" -if [[ "$current_cluster" =~ ^arn:aws:eks:[a-z0-9\-]*:[0-9]*:cluster/[a-z0-9\-]*$ ]]; then +if [[ "$current_cluster" =~ ^arn:(aws|aws-[a-z\-]*-gov):eks:[a-z0-9\-]*:[0-9]*:cluster/[a-z0-9\-]*$ ]]; then if [ "$extract_account" = "true" ]; then current_account_id=$(echo "$current_cluster" | cut -d':' -f5) fi