Skip to content
This repository was archived by the owner on Jul 19, 2023. It is now read-only.

Commit f1521b5

Browse files
authored
fix: correct yq syntax and lock k8 version (#211)
1 parent d648f40 commit f1521b5

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

tests/codebuild/run_canarytest.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ then
5858
[ "${CLUSTER_PRIVATE_SUBNETS}" != "" ] && eksctl_args+=( --vpc-private-subnets="${CLUSTER_PRIVATE_SUBNETS}" )
5959

6060
eksctl create cluster "${cluster_name}" "${eksctl_args[@]}" --dry-run > generated-cluster.yaml
61-
yq w -i ".managedNodeGroups[0].disableIMDSv1 = true" generated-cluster.yaml
61+
yq w -i generated-cluster.yaml managedNodeGroups[0].disableIMDSv1 true
6262

6363
eksctl create cluster -f generated-cluster.yaml --auto-kubeconfig --timeout=40m
6464

tests/codebuild/run_canarytest_china.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ CLUSTER_NAME=${DEPLOYMENT_NAME}-cluster
2929
CLUSTER_REGION=${CLUSTER_REGION:-cn-northwest-1}
3030
OIDC_ROLE_NAME=pod-role-$DEPLOYMENT_NAME
3131
AWS_ACC_NUM=$(aws sts get-caller-identity --region $CLUSTER_REGION --query Account --output text)
32+
CLUSTER_VERSION=1.21
3233

3334
function download_installer_china(){
3435
if [ -f ./installer_china.yaml ]; then
@@ -57,12 +58,12 @@ function download_installer_china(){
5758
}
5859

5960
function create_eks_cluster() {
60-
eksctl_args=( --managed --nodes 1 --node-type=c5.xlarge --region "$CLUSTER_REGION" )
61+
eksctl_args=( --managed --nodes 1 --node-type=c5.xlarge --region "$CLUSTER_REGION" --version "${CLUSTER_VERSION}" )
6162
[ ! -z "${USE_EXISTING_SUBNET}" ] && eksctl_args+=( --vpc-public-subnets="${EKS_PUBLIC_SUBNET_1},${EKS_PUBLIC_SUBNET_2}" )
6263
[ ! -z "${USE_EXISTING_SUBNET}" ] && eksctl_args+=( --vpc-private-subnets="${EKS_PRIVATE_SUBNET_1},${EKS_PRIVATE_SUBNET_2}" )
6364

6465
eksctl create cluster "${CLUSTER_NAME}" "${eksctl_args[@]}" --dry-run > generated-cluster.yaml
65-
yq w -i ".managedNodeGroups[0].disableIMDSv1 = true" generated-cluster.yaml
66+
yq w -i generated-cluster.yaml managedNodeGroups[0].disableIMDSv1 true
6667

6768
eksctl create cluster -f generated-cluster.yaml --auto-kubeconfig --timeout=40m
6869
}

0 commit comments

Comments
 (0)