Skip to content

Commit adf58ea

Browse files
committed
Update.
1 parent 0ef9a94 commit adf58ea

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PROJECT = concourse-helm3
2-
ID = YOUR_DOCKER_HOST_HERE/${PROJECT}
2+
ID = artielabs/${PROJECT}
33
VERSION = $(shell cat VERSION)
44

55

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.38.2
1+
1.38.3

assets/common.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,25 @@ setup_aws_kubernetes() {
157157
secret_access_key=${secret_access_key}
158158
fi
159159

160-
# user credentail will be persisted on the disk under a specific profile
160+
# user credentials will be persisted on the disk under a specific profile
161161
# in order to call `aws eks get-token`
162162
mkdir -p ~/.aws
163163
echo "[${profile:-default}]
164164
aws_access_key_id=${access_key_id}
165165
aws_secret_access_key=${secret_access_key}
166166
region=${region}" > ~/.aws/credentials
167167

168-
aws eks update-kubeconfig --region ${region} --name ${cluster_name} ${profile_opt}
168+
# If the role arn is provided, we will create a separate profile for the role.
169+
if [ -n "$role_arn" ]; then
170+
echo "[assume_role]
171+
role_arn=${role_arn}
172+
source_profile=${profile:-default}" > ~/.aws/credentials
173+
174+
aws eks update-kubeconfig --region ${region} --name ${cluster_name} --profile assume_role
175+
else
176+
aws eks update-kubeconfig --region ${region} --name ${cluster_name} ${profile_opt}
177+
fi
178+
169179
else
170180
# defaults to use instance identity.
171181
echo "no role or user specified. Fallback to use identity of the instance e.g. instance profile) to set up kubeconfig"

0 commit comments

Comments
 (0)