Skip to content

Commit

Permalink
Allow running EKS-A admin image build on Darwin
Browse files Browse the repository at this point in the history
  • Loading branch information
abhay-krishna committed Apr 23, 2024
1 parent ef4aaae commit 87e868c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion projects/aws/eks-a-admin-image/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ build-ova: KIND_URL?=$(shell ./build/get_kind_url.sh $(ARTIFACTS_BUCKET) )
build-ova: export PKR_VAR_kind-url=$(KIND_URL)
build-ova: $(PACKER) init clean-ova $(OVA_OUTPUT_DIR)
echo $(VSPHERE_PASSWORD) $(VSPHERE_USERNAME)
$(PACKER) build -only='*.vsphere-iso.*' -var-file=ova/linux/ubuntu/vsphere.ubuntu.pkrvars.hcl .
DEBUG=1 $(PACKER) build -force -only='*.vsphere-iso.*' -var-file=ova/linux/ubuntu/vsphere.ubuntu.pkrvars.hcl .

.PHONY: release-ova
release-ova: build-ova publish-ova-to-s3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@ set -o nounset
set -o pipefail

RELEASES_MANIFEST=$(curl --silent -L $EKSA_RELEASE_MANIFEST_URL)
SCRIPT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../../.." && pwd -P)"
source "${SCRIPT_ROOT}/build/lib/common.sh"
DATE=$(build::find::gnu_variant_on_mac date)

newest_release_date=0
newest_release_version=""

while IFS=$'\t' read -r date version _; do
# date is something like '2022-05-05 13:05:34.038243612 +0000 UTC'
# I can't get `date` to parse this format, so deleting the extra timezone first
parsed_date=$(date -d "$(echo $date | awk '{print $1,$2,$3}')" +"%s")
parsed_date=$($DATE -d "$(echo $date | awk '{print $1,$2,$3}')" +"%s")

if [ $parsed_date -gt $newest_release_date ];
then
Expand Down

0 comments on commit 87e868c

Please sign in to comment.