yangwwei commented on a change in pull request #233:
URL:
https://github.com/apache/incubator-yunikorn-k8shim/pull/233#discussion_r580000540
##########
File path: scripts/run-e2e-tests.sh
##########
@@ -75,18 +75,35 @@ function install_cluster() {
# install kubectl
echo "step 3/6: installing kubectl"
- stable_release=$(curl -s
https://storage.googleapis.com/kubernetes-release/release/stable.txt)
- exit_on_error "unable to retrieve latest stable version of kubectl"
- curl -LO
https://storage.googleapis.com/kubernetes-release/release/${stable_release}/bin/linux/amd64/kubectl
\
- && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
- exit_on_error "install kubectl failed"
+
+ if [[ "$OSTYPE" == "linux-gnu"* ]]; then
+ echo "Installing Kubectl for Linux.."
+ stable_release=$(curl -s
https://storage.googleapis.com/kubernetes-release/release/stable.txt)
+ exit_on_error "unable to retrieve latest stable version of kubectl"
+ curl -LO
https://storage.googleapis.com/kubernetes-release/release/${stable_release}/bin/linux/amd64/kubectl
\
+ && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
+ exit_on_error "install kubectl failed"
+ elif [[ "$OSTYPE" == "darwin"* ]]; then
+ echo "Installing Kubectl for Mac.."
+ curl -LO "https://dl.k8s.io/release/$(curl -L -s
https://dl.k8s.io/release/stable.txt)/bin/darwin/amd64/kubectl" \
+ && chmod +x kubectl && sudo mv kubectl /usr/local/bin
Review comment:
can we have a similar line "exit_on_error"? This ensures that the script
could fail if the installation somehow fails
##########
File path: scripts/run-e2e-tests.sh
##########
@@ -75,18 +75,35 @@ function install_cluster() {
# install kubectl
echo "step 3/6: installing kubectl"
- stable_release=$(curl -s
https://storage.googleapis.com/kubernetes-release/release/stable.txt)
- exit_on_error "unable to retrieve latest stable version of kubectl"
- curl -LO
https://storage.googleapis.com/kubernetes-release/release/${stable_release}/bin/linux/amd64/kubectl
\
- && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
- exit_on_error "install kubectl failed"
+
+ if [[ "$OSTYPE" == "linux-gnu"* ]]; then
Review comment:
Can we add an "else" clause and explicitly fail if OSTYPE is something
else?
##########
File path: scripts/run-e2e-tests.sh
##########
@@ -65,7 +65,7 @@ function install_cluster() {
# build docker images from latest code, so that we can install yunikorn with
these latest images
echo "step 1/6: building docker images from latest code"
make image REGISTRY=local VERSION=latest
- exit_on_error "build docker images failed"
+ exit_on_error "buildslac docker images failed"
Review comment:
typo?
##########
File path: scripts/run-e2e-tests.sh
##########
@@ -75,18 +75,35 @@ function install_cluster() {
# install kubectl
echo "step 3/6: installing kubectl"
- stable_release=$(curl -s
https://storage.googleapis.com/kubernetes-release/release/stable.txt)
- exit_on_error "unable to retrieve latest stable version of kubectl"
- curl -LO
https://storage.googleapis.com/kubernetes-release/release/${stable_release}/bin/linux/amd64/kubectl
\
- && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
- exit_on_error "install kubectl failed"
+
+ if [[ "$OSTYPE" == "linux-gnu"* ]]; then
+ echo "Installing Kubectl for Linux.."
+ stable_release=$(curl -s
https://storage.googleapis.com/kubernetes-release/release/stable.txt)
+ exit_on_error "unable to retrieve latest stable version of kubectl"
+ curl -LO
https://storage.googleapis.com/kubernetes-release/release/${stable_release}/bin/linux/amd64/kubectl
\
+ && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
+ exit_on_error "install kubectl failed"
+ elif [[ "$OSTYPE" == "darwin"* ]]; then
+ echo "Installing Kubectl for Mac.."
+ curl -LO "https://dl.k8s.io/release/$(curl -L -s
https://dl.k8s.io/release/stable.txt)/bin/darwin/amd64/kubectl" \
+ && chmod +x kubectl && sudo mv kubectl /usr/local/bin
+ fi
Review comment:
indent formating issue
##########
File path: scripts/run-e2e-tests.sh
##########
@@ -75,18 +75,35 @@ function install_cluster() {
# install kubectl
echo "step 3/6: installing kubectl"
- stable_release=$(curl -s
https://storage.googleapis.com/kubernetes-release/release/stable.txt)
- exit_on_error "unable to retrieve latest stable version of kubectl"
- curl -LO
https://storage.googleapis.com/kubernetes-release/release/${stable_release}/bin/linux/amd64/kubectl
\
- && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
- exit_on_error "install kubectl failed"
+
+ if [[ "$OSTYPE" == "linux-gnu"* ]]; then
+ echo "Installing Kubectl for Linux.."
+ stable_release=$(curl -s
https://storage.googleapis.com/kubernetes-release/release/stable.txt)
+ exit_on_error "unable to retrieve latest stable version of kubectl"
+ curl -LO
https://storage.googleapis.com/kubernetes-release/release/${stable_release}/bin/linux/amd64/kubectl
\
+ && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
+ exit_on_error "install kubectl failed"
+ elif [[ "$OSTYPE" == "darwin"* ]]; then
+ echo "Installing Kubectl for Mac.."
+ curl -LO "https://dl.k8s.io/release/$(curl -L -s
https://dl.k8s.io/release/stable.txt)/bin/darwin/amd64/kubectl" \
+ && chmod +x kubectl && sudo mv kubectl /usr/local/bin
+ fi
+
# install KIND
echo "step 4/6: installing kind"
- curl -Lo ./kind "https://kind.sigs.k8s.io/dl/v0.8.0/kind-linux-amd64" \
- && chmod +x ./kind && mv ./kind $(go env GOPATH)/bin
- exit_on_error "install KIND failed"
- check_cmd "kind"
+
+ if [[ "$OSTYPE" == "linux-gnu"* ]]; then
+ echo "Installing KIND for Linux.."
+ curl -Lo ./kind "https://kind.sigs.k8s.io/dl/v0.8.0/kind-linux-amd64"
\
+ && chmod +x ./kind && mv ./kind $(go env GOPATH)/bin
+ exit_on_error "install KIND failed"
+ check_cmd "kind"
+ elif [[ "$OSTYPE" == "darwin"* ]]; then
+ echo "Installing KIND for Mac.."
+ curl -Lo ./kind "https://kind.sigs.k8s.io/dl/v0.10.0/kind-darwin-amd64"
\
Review comment:
can we install same kind version for linux/mac?
##########
File path: scripts/run-e2e-tests.sh
##########
@@ -75,18 +75,35 @@ function install_cluster() {
# install kubectl
echo "step 3/6: installing kubectl"
- stable_release=$(curl -s
https://storage.googleapis.com/kubernetes-release/release/stable.txt)
- exit_on_error "unable to retrieve latest stable version of kubectl"
- curl -LO
https://storage.googleapis.com/kubernetes-release/release/${stable_release}/bin/linux/amd64/kubectl
\
- && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
- exit_on_error "install kubectl failed"
+
+ if [[ "$OSTYPE" == "linux-gnu"* ]]; then
+ echo "Installing Kubectl for Linux.."
+ stable_release=$(curl -s
https://storage.googleapis.com/kubernetes-release/release/stable.txt)
+ exit_on_error "unable to retrieve latest stable version of kubectl"
+ curl -LO
https://storage.googleapis.com/kubernetes-release/release/${stable_release}/bin/linux/amd64/kubectl
\
+ && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
+ exit_on_error "install kubectl failed"
+ elif [[ "$OSTYPE" == "darwin"* ]]; then
+ echo "Installing Kubectl for Mac.."
+ curl -LO "https://dl.k8s.io/release/$(curl -L -s
https://dl.k8s.io/release/stable.txt)/bin/darwin/amd64/kubectl" \
+ && chmod +x kubectl && sudo mv kubectl /usr/local/bin
+ fi
+
# install KIND
echo "step 4/6: installing kind"
- curl -Lo ./kind "https://kind.sigs.k8s.io/dl/v0.8.0/kind-linux-amd64" \
- && chmod +x ./kind && mv ./kind $(go env GOPATH)/bin
- exit_on_error "install KIND failed"
- check_cmd "kind"
+
+ if [[ "$OSTYPE" == "linux-gnu"* ]]; then
+ echo "Installing KIND for Linux.."
+ curl -Lo ./kind "https://kind.sigs.k8s.io/dl/v0.8.0/kind-linux-amd64"
\
+ && chmod +x ./kind && mv ./kind $(go env GOPATH)/bin
+ exit_on_error "install KIND failed"
+ check_cmd "kind"
+ elif [[ "$OSTYPE" == "darwin"* ]]; then
+ echo "Installing KIND for Mac.."
+ curl -Lo ./kind "https://kind.sigs.k8s.io/dl/v0.10.0/kind-darwin-amd64"
\
+ && chmod +x ./kind && mv ./kind $(go env GOPATH)/bin
Review comment:
similar, I think we need to add "exit_on_error" and "check_cmd".
also pls add an "else" in case OSTYPE is something else
##########
File path: scripts/run-e2e-tests.sh
##########
@@ -75,18 +75,35 @@ function install_cluster() {
# install kubectl
echo "step 3/6: installing kubectl"
- stable_release=$(curl -s
https://storage.googleapis.com/kubernetes-release/release/stable.txt)
- exit_on_error "unable to retrieve latest stable version of kubectl"
- curl -LO
https://storage.googleapis.com/kubernetes-release/release/${stable_release}/bin/linux/amd64/kubectl
\
- && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
- exit_on_error "install kubectl failed"
+
+ if [[ "$OSTYPE" == "linux-gnu"* ]]; then
+ echo "Installing Kubectl for Linux.."
+ stable_release=$(curl -s
https://storage.googleapis.com/kubernetes-release/release/stable.txt)
+ exit_on_error "unable to retrieve latest stable version of kubectl"
+ curl -LO
https://storage.googleapis.com/kubernetes-release/release/${stable_release}/bin/linux/amd64/kubectl
\
+ && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
+ exit_on_error "install kubectl failed"
+ elif [[ "$OSTYPE" == "darwin"* ]]; then
+ echo "Installing Kubectl for Mac.."
+ curl -LO "https://dl.k8s.io/release/$(curl -L -s
https://dl.k8s.io/release/stable.txt)/bin/darwin/amd64/kubectl" \
Review comment:
can we use a similar URL to the previous lines for Linux, I think we can
reuse the stable_release variable
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]