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}} $*"