Skip to content

Commit

Permalink
Support for building and testing al2023 images (optionally)
Browse files Browse the repository at this point in the history
Signed-off-by: Davanum Srinivas <[email protected]>
  • Loading branch information
dims committed Jul 13, 2023
1 parent 715d486 commit ba6c89c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions hack/build-ami.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ KUBE_DATE=$(date -u +'%Y-%m-%d')
pushd "$(go env GOPATH)/src/github.com/awslabs/amazon-eks-ami" >/dev/null
sed -i 's/amazon-eks/provider-aws-test-infra/' eks-worker-al2-variables.json
sed -i 's/us-west-2/us-east-1/' eks-worker-al2-variables.json
if [[ ${BUILD_EKS_AMI_OS:-""} == "al2023" ]]; then
make transform-al2-to-al2023
export PACKER_DEFAULT_VARIABLE_FILE=eks-worker-al2023-variables.json
export PACKER_TEMPLATE_FILE=eks-worker-al2023.json
fi
make k8s kubernetes_version=${KUBE_VERSION} kubernetes_build_date=${KUBE_DATE} pull_cni_from_github=true
# shellcheck disable=SC2164
popd
6 changes: 5 additions & 1 deletion hack/make-rules/test-e2e-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ TEST_INFRA_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)"

build_eks_ami=${BUILD_EKS_AMI:-"false"}
if [[ ${build_eks_ami} != "false" ]]; then
ami_id=$(aws ec2 describe-images --region=us-east-1 --filters Name=name,Values=amazon-eks-node-${KUBE_MINOR_VERSION}-v${TODAYS_DATE} --query 'Images[*].[ImageId]' --output text)
if [[ ${BUILD_EKS_AMI_OS:-""} == "al2023" ]]; then
ami_id=$(aws ec2 describe-images --region=us-east-1 --filters Name=name,Values=amazon-eks-node-al2023-${KUBE_MINOR_VERSION}-v${TODAYS_DATE} --query 'Images[*].[ImageId]' --output text)
else
ami_id=$(aws ec2 describe-images --region=us-east-1 --filters Name=name,Values=amazon-eks-node-${KUBE_MINOR_VERSION}-v${TODAYS_DATE} --query 'Images[*].[ImageId]' --output text)
fi
if [ -z "${ami_id}" ] ; then
${TEST_INFRA_ROOT}/hack/build-ami.sh
ami_id=$(jq -r ".builds[].artifact_id" "$(go env GOPATH)/src/github.com/awslabs/amazon-eks-ami/manifest.json" | cut -f 2 -d ':')
Expand Down

0 comments on commit ba6c89c

Please sign in to comment.