Skip to content

Commit

Permalink
cleanup + fix shell linter issues
Browse files Browse the repository at this point in the history
Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>
  • Loading branch information
NikitaSkrynnik committed Aug 22, 2024
1 parent 3fa42de commit c52662b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 16 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ jobs:
uses: actions/checkout@v4
with:
path: ${{ github.workspace }}/src/github.com/${{ github.repository }}

- name: Setup gke
run: |
scripts/gke/gke-start.sh
Expand Down Expand Up @@ -113,12 +114,6 @@ jobs:
mv ./kubectl /usr/local/bin/kubectl
- name: Run interdomain testing
run: |
echo "cluster1"
kubectl version --kubeconfig=$KUBECONFIG1
echo "cluster2"
kubectl version --kubeconfig=$KUBECONFIG2
echo "cluster3"
kubectl version --kubeconfig=$KUBECONFIG3
go test -count 1 -timeout 2h -race -v ./... -parallel 4
env:
KUBECONFIG1: /tmp/config1
Expand Down
5 changes: 2 additions & 3 deletions scripts/aks/aks-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
readonly AZURE_RESOURCE_GROUP=$1
readonly AZURE_CLUSTER_NAME=$2
readonly AZURE_CREDENTIALS_PATH=$3

if [[ -z "$1" ]] || [[ -z "$2" ]] || [[ -z "$3" ]]; then
echo "Usage: aks-start.sh <resource-group> <cluster-name> <kube-config-path>"
exit 1
fi

AKS_K8S_VERSION=$(echo $K8S_VERSION | cut -d '.' -f 1,2 | cut -c 2-)
echo "k8s version: $K8S_VERSION"
echo "AKS K8S: $AKS_K8S_VERSION"
AKS_K8S_VERSION=$(echo "$K8S_VERSION" | cut -d '.' -f 1,2 | cut -c 2-)

echo -n "Creating AKS cluster '$AZURE_CLUSTER_NAME'..."
az aks create \
Expand Down
6 changes: 3 additions & 3 deletions scripts/aws/aws-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ export IAM_NAME=ebs-csi-controller-sa
apt-get update && apt-get -y install curl dnsutils


curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp; \
curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_"$(uname -s)"_amd64.tar.gz" | tar xz -C /tmp; \
mv /tmp/eksctl /usr/local/bin; \
eksctl version

curl -Lo aws-iam-authenticator https://github.com/kubernetes-sigs/aws-iam-authenticator/releases/download/v0.6.22/aws-iam-authenticator_0.6.22_$(uname -s)_amd64; \
curl -Lo aws-iam-authenticator https://github.com/kubernetes-sigs/aws-iam-authenticator/releases/download/v0.6.22/aws-iam-authenticator_0.6.22_"$(uname -s)"_amd64; \
chmod 755 aws-iam-authenticator; \
mv ./aws-iam-authenticator /usr/local/bin

AWS_K8S_VERSION=$(echo $K8S_VERSION | cut -d "." -f 1-2 | cut -c 2-)
AWS_K8S_VERSION=$(echo "$K8S_VERSION" | cut -d "." -f 1-2 | cut -c 2-)
echo $AWS_K8S_VERSION
eksctl create cluster \
--name "${AWS_CLUSTER_NAME}" \
Expand Down
5 changes: 1 addition & 4 deletions scripts/gke/gke-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@ K8S_VERSION=$(echo ${K8S_VERSION} | cut -d '.' -f 1,2 | cut -c 2-)
GKE_CLUSTER_VERSION=$(gcloud container get-server-config --zone="$GKE_CLUSTER_ZONE" --format=json \
| jq '.channels[] | select (.channel=="REGULAR") | .validVersions[]' \
| grep -m 1 "$K8S_VERSION" | tr -d '"')
if [ -z "$GKE_CLUSTER_VERSION"]; then
if [ -z "$GKE_CLUSTER_VERSION" ]; then
echo "GKE cluster version is not valid: $GKE_CLUSTER_VERSION"
exit 1
fi

echo $K8S_VERSION
echo $GKE_CLUSTER_VERSION

gcloud components install gke-gcloud-auth-plugin
gcloud components update
time gcloud container clusters create "${GKE_CLUSTER_NAME}" \
Expand Down

0 comments on commit c52662b

Please sign in to comment.