Skip to content

Commit 3d9a8b1

Browse files
Merge pull request #323 from luehm/feat/eks-gov
2 parents a71ce68 + bdc8eaf commit 3d9a8b1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/kubernetes_context.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ current_cluster=$(kubectl config view --minify --output 'jsonpath={.contexts[?(@
1717
current_namespace=$(kubectl config view --minify --output 'jsonpath={.contexts[?(@.name=="'$current_context'")].context.namespace}'; echo)
1818

1919
current_account_id=""
20-
if [[ "$current_cluster" =~ ^arn:aws:eks:[a-z0-9\-]*:[0-9]*:cluster/[a-z0-9\-]*$ ]]; then
20+
if [[ "$current_cluster" =~ ^arn:(aws|aws-[a-z\-]*-gov):eks:[a-z0-9\-]*:[0-9]*:cluster/[a-z0-9\-]*$ ]]; then
2121
if [ "$extract_account" = "true" ]; then
2222
current_account_id=$(echo "$current_cluster" | cut -d':' -f5)
2323
fi

0 commit comments

Comments
 (0)