Skip to content

Commit 400d641

Browse files
committed
improve Jenkinsfile
1 parent 0f3acc0 commit 400d641

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Jenkinsfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,10 @@ void runTest(Integer TEST_ID) {
248248

249249
void prepareNode() {
250250
sh """
251-
sudo curl -s -L -o /usr/local/bin/kubectl https://dl.k8s.io/release/\$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl && sudo chmod +x /usr/local/bin/kubectl
251+
if [ ! -f /usr/local/bin/kubectl ]; then
252+
sudo curl -s -L -o /usr/local/bin/kubectl https://dl.k8s.io/release/\$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl && sudo chmod +x /usr/local/bin/kubectl
253+
fi
254+
252255
kubectl version --client --output=yaml
253256
254257
curl -fsSL https://get.helm.sh/helm-v3.18.0-linux-amd64.tar.gz | sudo tar -C /usr/local/bin --strip-components 1 -xzf - linux-amd64/helm

0 commit comments

Comments
 (0)