Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
657951c3
Unverified
Commit
657951c3
authored
Mar 21, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Mar 21, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #74889 from akutz/feature/get-kube-binaries-client-choice
Allow choice of os/arch when downloading client
parents
22621ca4
020dc470
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
43 deletions
+71
-43
get-kube-binaries.sh
cluster/get-kube-binaries.sh
+71
-43
No files found.
cluster/get-kube-binaries.sh
View file @
657951c3
...
...
@@ -29,6 +29,21 @@
# * ppc64le
# * s390x
#
# Set KUBERNETES_CLIENT_OS to choose the client OS to download:
# * current OS [default]
# * linux
# * darwin
# * windows
#
# Set KUBERNETES_CLIENT_ARCH to choose the client architecture to download:
# * current architecture [default]
# * amd64
# * arm
# * arm64
# * ppc64le
# * s390x
# * windows
#
# Set KUBERNETES_SKIP_CONFIRM to skip the installation confirmation prompt.
# Set KUBERNETES_RELEASE_URL to choose where to download binaries from.
# (Defaults to https://storage.googleapis.com/kubernetes-release/release).
...
...
@@ -59,48 +74,57 @@ function detect_kube_release() {
}
function
detect_client_info
()
{
local
kernel machine
kernel
=
"
$(
uname
-s
)
"
case
"
${
kernel
}
"
in
Darwin
)
CLIENT_PLATFORM
=
"darwin"
;;
Linux
)
CLIENT_PLATFORM
=
"linux"
;;
*
)
echo
"Unknown, unsupported platform:
${
kernel
}
."
>
&2
echo
"Supported platforms: Linux, Darwin."
>
&2
echo
"Bailing out."
>
&2
exit
2
esac
# TODO: migrate the kube::util::host_platform function out of hack/lib and
# use it here.
machine
=
"
$(
uname
-m
)
"
case
"
${
machine
}
"
in
x86_64
*
|
i?86_64
*
|
amd64
*
)
CLIENT_ARCH
=
"amd64"
;;
aarch64
*
|
arm64
*
)
CLIENT_ARCH
=
"arm64"
;;
arm
*
)
CLIENT_ARCH
=
"arm"
;;
i?86
*
)
CLIENT_ARCH
=
"386"
;;
s390x
*
)
CLIENT_ARCH
=
"s390x"
;;
*
)
echo
"Unknown, unsupported architecture (
${
machine
}
)."
>
&2
echo
"Supported architectures x86_64, i686, arm, arm64, s390x."
>
&2
echo
"Bailing out."
>
&2
exit
3
;;
esac
if
[
-n
"
${
KUBERNETES_CLIENT_OS
-
}
"
]
;
then
CLIENT_PLATFORM
=
"
${
KUBERNETES_CLIENT_OS
}
"
else
local
kernel
kernel
=
"
$(
uname
-s
)
"
case
"
${
kernel
}
"
in
Darwin
)
CLIENT_PLATFORM
=
"darwin"
;;
Linux
)
CLIENT_PLATFORM
=
"linux"
;;
*
)
echo
"Unknown, unsupported platform:
${
kernel
}
."
>
&2
echo
"Supported platforms: Linux, Darwin."
>
&2
echo
"Bailing out."
>
&2
exit
2
esac
fi
if
[
-n
"
${
KUBERNETES_CLIENT_ARCH
-
}
"
]
;
then
CLIENT_ARCH
=
"
${
KUBERNETES_CLIENT_ARCH
}
"
else
# TODO: migrate the kube::util::host_platform function out of hack/lib and
# use it here.
local
machine
machine
=
"
$(
uname
-m
)
"
case
"
${
machine
}
"
in
x86_64
*
|
i?86_64
*
|
amd64
*
)
CLIENT_ARCH
=
"amd64"
;;
aarch64
*
|
arm64
*
)
CLIENT_ARCH
=
"arm64"
;;
arm
*
)
CLIENT_ARCH
=
"arm"
;;
i?86
*
)
CLIENT_ARCH
=
"386"
;;
s390x
*
)
CLIENT_ARCH
=
"s390x"
;;
*
)
echo
"Unknown, unsupported architecture (
${
machine
}
)."
>
&2
echo
"Supported architectures x86_64, i686, arm, arm64, s390x."
>
&2
echo
"Bailing out."
>
&2
exit
3
;;
esac
fi
}
function
md5sum_file
()
{
...
...
@@ -171,7 +195,11 @@ CLIENT_TAR="kubernetes-client-${CLIENT_PLATFORM}-${CLIENT_ARCH}.tar.gz"
echo
"Kubernetes release:
${
KUBE_VERSION
}
"
echo
"Server:
${
SERVER_PLATFORM
}
/
${
SERVER_ARCH
}
(to override, set KUBERNETES_SERVER_ARCH)"
echo
"Client:
${
CLIENT_PLATFORM
}
/
${
CLIENT_ARCH
}
(autodetected)"
printf
"Client: %s/%s"
"
${
CLIENT_PLATFORM
}
"
"
${
CLIENT_ARCH
}
"
if
[
-z
"
${
KUBERNETES_CLIENT_OS
-
}
"
]
&&
[
-z
"
${
KUBERNETES_CLIENT_ARCH
-
}
"
]
;
then
printf
" (autodetected)"
fi
echo
" (to override, set KUBERNETES_CLIENT_OS and/or KUBERNETES_CLIENT_ARCH)"
echo
echo
"Will download
${
SERVER_TAR
}
from
${
DOWNLOAD_URL_PREFIX
}
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment