Skip to content

Commit

Permalink
Make EBS CSI driver version overridable
Browse files Browse the repository at this point in the history
  • Loading branch information
chienhanlin committed Nov 30, 2023
1 parent 0ac9ca7 commit eb08906
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions al2.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ build {
environment_vars = [
"REGION=${var.region}",
"AGENT_VERSION=${var.ecs_agent_version}",
"EBS_CSI_DRIVER_VERSION=${var.ebs_csi_driver_version}",
"AIR_GAPPED=${var.air_gapped}",
"MANAGED_DAEMON_BASE_URL=${var.managed_daemon_base_url}"
]
Expand Down
1 change: 1 addition & 0 deletions al2023.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ build {
environment_vars = [
"REGION=${var.region}",
"AGENT_VERSION=${var.ecs_agent_version}",
"EBS_CSI_DRIVER_VERSION=${var.ebs_csi_driver_version}",
"AIR_GAPPED=${var.air_gapped}",
"MANAGED_DAEMON_BASE_URL=${var.managed_daemon_base_url}"
]
Expand Down
6 changes: 5 additions & 1 deletion scripts/install-managed-daemons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ if [ -z "$MANAGED_DAEMON_BASE_URL" ]; then
MANAGED_DAEMON_BASE_URL="https://s3.$REGION.amazonaws.com${host_suffix}/amazon-ecs-agent-$REGION/"
fi

if [ -z "$EBS_CSI_DRIVER_VERSION" ]; then
EBS_CSI_DRIVER_VERSION="v${AGENT_VERSION}"
fi

ARCH=$(uname -m)
case "$ARCH" in
"aarch64")
Expand All @@ -165,7 +169,7 @@ case "$ARCH" in
esac

# Install CSI driver managed daemon
CSI_DRIVER_FILENAME="ebs-csi-driver${ARCH_MOD}-v$AGENT_VERSION.tar"
CSI_DRIVER_FILENAME="ebs-csi-driver${ARCH_MOD}-${EBS_CSI_DRIVER_VERSION}.tar"
CSI_DRIVER_FULL_URL="${MANAGED_DAEMON_BASE_URL}${CSI_DRIVER_FILENAME}"

curl -fLSs -o "$WORK_DIR/${CSI_DRIVER_FILENAME}" "$CSI_DRIVER_FULL_URL"
Expand Down
6 changes: 6 additions & 0 deletions variables.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -210,3 +210,9 @@ variable "managed_daemon_base_url" {
description = "Base URL (minus file name) to download managed daemons from."
default = ""
}

variable "ebs_csi_driver_version" {
type = string
description = "EBS CSI driver version to build AMI with."
default = ""
}

0 comments on commit eb08906

Please sign in to comment.