Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve "flavor/color" in EKS cluster name abbreviation #956

Merged
merged 3 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.ECR_AWS_ROLE }}
role-to-assume: ${{ vars.ECR_AWS_ROLE }}
aws-region: ${{ env.AWS_REGION }}
role-session-name: ${{ env.IAM_ROLE_SESSION_NAME }}

Expand Down
2 changes: 1 addition & 1 deletion os/alpine/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cryptography==42.0.7
cryptography==43.0.1
PyYAML==6.0.1
awscli==1.33.10
boto3==1.34.128
9 changes: 7 additions & 2 deletions rootfs/etc/profile.d/geodesic.kube-ps1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,13 @@ function short_cluster_name_from_eks() {
local full_name=$(printf "%s" "$1" | cut -d/ -f2)
# remove namespace prefix if present
full_name=${full_name#${NAMESPACE}-}
# remove eks and everything after it, if present
full_name=${full_name%-eks-*}
# remove "-eks" and "-cluster" if present, leave the rest
full_name=${full_name/-eks-/-}
if [[ "$full_name" =~ -cluster(-.*)?$ ]]; then
# If true, remove '-cluster'
full_name="${full_name/-cluster/}"
fi

printf "%s" "${full_name}"
# If NAMESPACE is unset, delete everything before and including the first dash
# printf "%s" "$1" | sed -e 's%arn.*:cluster/'"${NAMESPACE:-[^-]\+}"'-\([^-]\+\)-eks-.*$%\1%'
Expand Down