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
56949c78
Commit
56949c78
authored
Feb 14, 2019
by
Jeff Grafton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support split test tarballs in get-kube-binaries.sh
parent
3469579a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
10 deletions
+35
-10
get-kube-binaries.sh
cluster/get-kube-binaries.sh
+35
-10
No files found.
cluster/get-kube-binaries.sh
View file @
56949c78
...
...
@@ -150,11 +150,8 @@ function extract_arch_tarball() {
platforms_dir
=
"
${
KUBE_ROOT
}
/platforms/
${
platform
}
/
${
arch
}
"
echo
"Extracting
${
tarfile
}
into
${
platforms_dir
}
"
mkdir
-p
"
${
platforms_dir
}
"
# Tarball looks like kubernetes/{client,server}/bin/BINARY"
# Tarball looks like kubernetes/{client,server
,test
}/bin/BINARY"
tar
-xzf
"
${
tarfile
}
"
--strip-components
3
-C
"
${
platforms_dir
}
"
# Create convenience symlink
ln
-sf
"
${
platforms_dir
}
"
"
$(
dirname
"
${
tarfile
}
"
)
/bin"
echo
"Add '
$(
dirname
"
${
tarfile
}
"
)
/bin' to your PATH to use newly-installed binaries."
}
detect_kube_release
...
...
@@ -199,11 +196,10 @@ if [[ -n "${NODE_TAR:-}" ]]; then
echo
"Will download and extract
${
NODE_TAR
}
from
${
DOWNLOAD_URL_PREFIX
}
"
fi
TESTS_TAR
=
"kubernetes-test.tar.gz"
DOWNLOAD_TESTS_TAR
=
false
if
[[
-n
"
${
KUBERNETES_DOWNLOAD_TESTS
-
}
"
]]
;
then
DOWNLOAD_TESTS_TAR
=
true
echo
"Will download and extract
${
TESTS_TAR
}
from
${
DOWNLOAD_URL_PREFIX
}
"
echo
"Will download and extract
kubernetes-test tarball(s)
from
${
DOWNLOAD_URL_PREFIX
}
"
fi
if
[[
"
${
DOWNLOAD_CLIENT_TAR
}
"
==
false
&&
\
...
...
@@ -233,11 +229,40 @@ fi
if
"
${
DOWNLOAD_CLIENT_TAR
}
"
;
then
download_tarball
"
${
KUBE_ROOT
}
/client"
"
${
CLIENT_TAR
}
"
extract_arch_tarball
"
${
KUBE_ROOT
}
/client/
${
CLIENT_TAR
}
"
"
${
CLIENT_PLATFORM
}
"
"
${
CLIENT_ARCH
}
"
ln
-s
"
${
KUBE_ROOT
}
/platforms/
${
CLIENT_PLATFORM
}
/
${
CLIENT_ARCH
}
"
"
${
KUBE_ROOT
}
/client/bin"
echo
"Add '
${
KUBE_ROOT
}
/client/bin' to your PATH to use newly-installed binaries."
fi
if
"
${
DOWNLOAD_TESTS_TAR
}
"
;
then
download_tarball
"
${
KUBE_ROOT
}
/test"
"
${
TESTS_TAR
}
"
echo
"Extracting
${
TESTS_TAR
}
into
${
KUBE_ROOT
}
"
# Strip leading "kubernetes/"
tar
-xzf
"
${
KUBE_ROOT
}
/test/
${
TESTS_TAR
}
"
--strip-components
1
-C
"
${
KUBE_ROOT
}
"
TESTS_PORTABLE_TAR
=
"kubernetes-test-portable.tar.gz"
download_tarball
"
${
KUBE_ROOT
}
/test"
"
${
TESTS_PORTABLE_TAR
}
"
||
true
if
[[
-f
"
${
KUBE_ROOT
}
/test/
${
TESTS_PORTABLE_TAR
}
"
]]
;
then
echo
"Extracting
${
TESTS_PORTABLE_TAR
}
into
${
KUBE_ROOT
}
"
# Strip leading "kubernetes/"
tar
-xzf
"
${
KUBE_ROOT
}
/test/
${
TESTS_PORTABLE_TAR
}
"
--strip-components
1
-C
"
${
KUBE_ROOT
}
"
# Next, download platform-specific test tarballs for all relevant platforms
TEST_PLATFORM_TUPLES
=(
"
${
CLIENT_PLATFORM
}
/
${
CLIENT_ARCH
}
"
"
${
SERVER_PLATFORM
}
/
${
SERVER_ARCH
}
"
)
if
[[
-n
"
${
NODE_PLATFORM
:-}
"
&&
-n
"
${
NODE_ARCH
:-}
"
]]
;
then
TEST_PLATFORM_TUPLES+
=(
"
${
NODE_PLATFORM
}
/
${
NODE_ARCH
}
"
)
fi
# Loop over only the unique tuples
for
TUPLE
in
$(
printf
"%s
\n
"
"
${
TEST_PLATFORM_TUPLES
[@]
}
"
|
sort
-u
)
;
do
OS
=
$(
echo
"
${
TUPLE
}
"
|
cut
-d
/
-f1
)
ARCH
=
$(
echo
"
${
TUPLE
}
"
|
cut
-d
/
-f2
)
TEST_PLATFORM_TAR
=
"kubernetes-test-
${
OS
}
-
${
ARCH
}
.tar.gz"
download_tarball
"
${
KUBE_ROOT
}
/test"
"
${
TEST_PLATFORM_TAR
}
"
extract_arch_tarball
"
${
KUBE_ROOT
}
/test/
${
TEST_PLATFORM_TAR
}
"
"
${
OS
}
"
"
${
ARCH
}
"
done
else
echo
"Failed to download portable test tarball, falling back to mondo test tarball."
TESTS_MONDO_TAR
=
"kubernetes-test.tar.gz"
download_tarball
"
${
KUBE_ROOT
}
/test"
"
${
TESTS_MONDO_TAR
}
"
echo
"Extracting
${
TESTS_MONDO_TAR
}
into
${
KUBE_ROOT
}
"
# Strip leading "kubernetes/"
tar
-xzf
"
${
KUBE_ROOT
}
/test/
${
TESTS_MONDO_TAR
}
"
--strip-components
1
-C
"
${
KUBE_ROOT
}
"
fi
fi
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