From d8fd5c9f176c0ac3211b1b7e500f5170ad5141f0 Mon Sep 17 00:00:00 2001 From: Antoine Date: Wed, 25 Dec 2019 17:23:48 +0000 Subject: [PATCH] feat: add support for different kubectl versions (#4) --- README.md | 5 +++++ entrypoint.sh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4963241..f4cad1c 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ jobs: uses: steebchen/kubectl@master env: KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }} + KUBECTL_VERSION: "1.15" with: args: '"rollout status deployment/my-app"' ``` @@ -38,4 +39,8 @@ jobs: cat $HOME/.kube/config | base64 ``` +## Environment + +`KUBECTL_VERSION` - (optional): Used to specify the kubectl version. If not specified, this defaults to kubectl 1.13 + **Note**: Do not use kubectl config view as this will hide the certificate-authority-data. diff --git a/entrypoint.sh b/entrypoint.sh index c97846d..cee48e1 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -6,4 +6,4 @@ set -e echo "$KUBE_CONFIG_DATA" | base64 --decode > /tmp/config export KUBECONFIG=/tmp/config -sh -c "kubectl $*" +sh -c "kubectl${KUBECTL_VERSION:+.${KUBECTL_VERSION}} $*"