Skip to content

Commit 115f695

Browse files
authored
Merge pull request #15 from abhay-krishna/always-setup-symlinks
Always setup symlinks required for EKS Pod Identity Agent
2 parents dc2ddd1 + 0036e79 commit 115f695

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

eks-hybrid-ssm-setup.sh

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ HOST_ROOTFS="/.bottlerocket/rootfs"
77
SSM_AGENT_PERSISTENT_STATE_DIR="${HOST_ROOTFS}/local/host-containers/control/ssm"
88
SSM_AGENT_REGISTRATION="${SSM_AGENT_PERSISTENT_STATE_DIR}/registration"
99
mkdir -p "${SSM_AGENT_PERSISTENT_STATE_DIR}"
10-
ENABLE_CREDENTIALS_FILE="false"
1110
SSM_ACTIVATION_ID_REGEX="^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
1211

1312
for opt in "$@"; do
@@ -16,7 +15,6 @@ for opt in "$@"; do
1615
--region=*) AWS_REGION="${optarg}" ;;
1716
--activation-code=*) SSM_ACTIVATION_CODE="${optarg}" ;;
1817
--activation-id=*) SSM_ACTIVATION_ID="${optarg}" ;;
19-
--enable-credentials-file=*) ENABLE_CREDENTIALS_FILE="${optarg}" ;;
2018
esac
2119
done
2220

@@ -71,11 +69,9 @@ symlink_aws_creds() {
7169
control_creds="${control_aws_dir}/credentials"
7270
host_creds="${HOST_ROOTFS}/root/.aws/credentials"
7371
ln -srnf "${control_creds}" "${host_creds}"
74-
if [ "${ENABLE_CREDENTIALS_FILE}" = "true" ]; then
75-
hybrid_nodes_pod_identity_aws_dir="${HOST_ROOTFS}/var/eks-hybrid/.aws"
76-
mkdir -p "$(dirname "${hybrid_nodes_pod_identity_aws_dir}")"
77-
ln -sf "${control_aws_dir_relative_to_host}" "${hybrid_nodes_pod_identity_aws_dir}"
78-
fi
72+
hybrid_nodes_pod_identity_aws_dir="${HOST_ROOTFS}/var/eks-hybrid/.aws"
73+
mkdir -p "$(dirname "${hybrid_nodes_pod_identity_aws_dir}")"
74+
ln -sf "${control_aws_dir_relative_to_host}" "${hybrid_nodes_pod_identity_aws_dir}"
7975
}
8076

8177
if [ ! -s "${SSM_AGENT_REGISTRATION}" ]; then

0 commit comments

Comments
 (0)