Skip to content

Commit

Permalink
Better variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake Pearson committed Nov 22, 2019
1 parent 905c4f3 commit 30426e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.vscode
12 changes: 6 additions & 6 deletions k
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ fi

# Ensure we have at least 1 kubectl version
KNOWN_VERSION="v1.16.3"
KNOWN_TARGET=$KX_PATH/kubectl-$KNOWN_VERSION
LOCAL_KUBECTL=$KX_PATH/kubectl-$KNOWN_VERSION
KUBECTL_PATH=$(command -v kubectl)
if [ ! -z "$KUBECTL_PATH" ]; then
KNOWN_TARGET=$KUBECTL_PATH
elif [ ! -f "$KNOWN_TARGET" ]; then
curl -L -o "$KNOWN_TARGET" "https://storage.googleapis.com/kubernetes-release/release/$KNOWN_VERSION/bin/$OS/amd64/kubectl"
chmod +x "$KNOWN_TARGET"
LOCAL_KUBECTL=$KUBECTL_PATH
elif [ ! -f "$LOCAL_KUBECTL" ]; then
curl -L -o "$LOCAL_KUBECTL" "https://storage.googleapis.com/kubernetes-release/release/$KNOWN_VERSION/bin/$OS/amd64/kubectl"
chmod +x "$LOCAL_KUBECTL"
fi

# Get the server version from the server if not cached
if [ -z "$TARGET_VERSION" ]; then
TARGET_VERSION=$($KNOWN_TARGET version -o json | jq -r '.serverVersion.gitVersion')
TARGET_VERSION=$($LOCAL_KUBECTL version -o json | jq -r '.serverVersion.gitVersion')
if [ -z "$TARGET_VERSION" ] || [ "$TARGET_VERSION" == "null" ]; then
echo "Unable to get version information from cluster"
exit 1
Expand Down

0 comments on commit 30426e4

Please sign in to comment.