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
b9e060a6
Commit
b9e060a6
authored
Jan 13, 2017
by
Jeff Grafton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update scripts to look for binary artifacts in bazel-bin/
parent
bc4b6ac3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
26 deletions
+37
-26
common.sh
cluster/common.sh
+27
-25
kubeadm.sh
cluster/kubeadm.sh
+1
-0
kubectl.sh
cluster/kubectl.sh
+1
-0
util.sh
hack/lib/util.sh
+8
-1
No files found.
cluster/common.sh
View file @
b9e060a6
...
...
@@ -412,6 +412,30 @@ function tars_from_version() {
fi
}
# Search for the specified tarball in the various known output locations,
# echoing the location if found.
#
# Assumed vars:
# KUBE_ROOT
#
# Args:
# $1 name of tarball to search for
function
find-tar
()
{
local
-r
tarball
=
$1
locations
=(
"
${
KUBE_ROOT
}
/server/
${
tarball
}
"
"
${
KUBE_ROOT
}
/_output/release-tars/
${
tarball
}
"
"
${
KUBE_ROOT
}
/bazel-bin/build/release-tars/
${
tarball
}
"
)
location
=
$(
(
ls
-t
"
${
locations
[@]
}
"
2>/dev/null
||
true
)
|
head
-1
)
if
[[
!
-f
"
${
location
}
"
]]
;
then
echo
"!!! Cannot find
${
tarball
}
"
>
&2
exit
1
fi
echo
"
${
location
}
"
}
# Verify and find the various tar files that we are going to use on the server.
#
# Assumed vars:
...
...
@@ -421,36 +445,14 @@ function tars_from_version() {
# SALT_TAR
# KUBE_MANIFESTS_TAR
function
find-release-tars
()
{
SERVER_BINARY_TAR
=
"
${
KUBE_ROOT
}
/server/kubernetes-server-linux-amd64.tar.gz"
if
[[
!
-f
"
${
SERVER_BINARY_TAR
}
"
]]
;
then
SERVER_BINARY_TAR
=
"
${
KUBE_ROOT
}
/_output/release-tars/kubernetes-server-linux-amd64.tar.gz"
fi
if
[[
!
-f
"
${
SERVER_BINARY_TAR
}
"
]]
;
then
echo
"!!! Cannot find kubernetes-server-linux-amd64.tar.gz"
>
&2
exit
1
fi
SALT_TAR
=
"
${
KUBE_ROOT
}
/server/kubernetes-salt.tar.gz"
if
[[
!
-f
"
${
SALT_TAR
}
"
]]
;
then
SALT_TAR
=
"
${
KUBE_ROOT
}
/_output/release-tars/kubernetes-salt.tar.gz"
fi
if
[[
!
-f
"
${
SALT_TAR
}
"
]]
;
then
echo
"!!! Cannot find kubernetes-salt.tar.gz"
>
&2
exit
1
fi
SERVER_BINARY_TAR
=
$(
find-tar kubernetes-server-linux-amd64.tar.gz
)
SALT_TAR
=
$(
find-tar kubernetes-salt.tar.gz
)
# This tarball is used by GCI, Ubuntu Trusty, and Container Linux.
KUBE_MANIFESTS_TAR
=
if
[[
"
${
MASTER_OS_DISTRIBUTION
:-}
"
==
"trusty"
||
"
${
MASTER_OS_DISTRIBUTION
:-}
"
==
"gci"
||
"
${
MASTER_OS_DISTRIBUTION
:-}
"
==
"container-linux"
]]
||
\
[[
"
${
NODE_OS_DISTRIBUTION
:-}
"
==
"trusty"
||
"
${
NODE_OS_DISTRIBUTION
:-}
"
==
"gci"
||
"
${
NODE_OS_DISTRIBUTION
:-}
"
==
"container-linux"
]]
;
then
KUBE_MANIFESTS_TAR
=
"
${
KUBE_ROOT
}
/server/kubernetes-manifests.tar.gz"
if
[[
!
-f
"
${
KUBE_MANIFESTS_TAR
}
"
]]
;
then
KUBE_MANIFESTS_TAR
=
"
${
KUBE_ROOT
}
/_output/release-tars/kubernetes-manifests.tar.gz"
fi
if
[[
!
-f
"
${
KUBE_MANIFESTS_TAR
}
"
]]
;
then
echo
"!!! Cannot find kubernetes-manifests.tar.gz"
>
&2
exit
1
fi
KUBE_MANIFESTS_TAR
=
$(
find-tar kubernetes-manifests.tar.gz
)
fi
}
...
...
cluster/kubeadm.sh
View file @
b9e060a6
...
...
@@ -76,6 +76,7 @@ if [[ -z "${KUBEADM_PATH:-}" ]]; then
"
${
KUBE_ROOT
}
/_output/bin/kubeadm"
"
${
KUBE_ROOT
}
/_output/dockerized/bin/
${
host_os
}
/
${
host_arch
}
/kubeadm"
"
${
KUBE_ROOT
}
/_output/local/bin/
${
host_os
}
/
${
host_arch
}
/kubeadm"
"
${
KUBE_ROOT
}
/bazel-bin/cmd/kubectl/kubeadm"
"
${
KUBE_ROOT
}
/platforms/
${
host_os
}
/
${
host_arch
}
/kubeadm"
)
kubeadm
=
$(
(
ls
-t
"
${
locations
[@]
}
"
2>/dev/null
||
true
)
|
head
-1
)
...
...
cluster/kubectl.sh
View file @
b9e060a6
...
...
@@ -88,6 +88,7 @@ if [[ -z "${KUBECTL_PATH:-}" ]]; then
"
${
KUBE_ROOT
}
/_output/bin/kubectl"
"
${
KUBE_ROOT
}
/_output/dockerized/bin/
${
host_os
}
/
${
host_arch
}
/kubectl"
"
${
KUBE_ROOT
}
/_output/local/bin/
${
host_os
}
/
${
host_arch
}
/kubectl"
"
${
KUBE_ROOT
}
/bazel-bin/cmd/kubectl/kubectl"
"
${
KUBE_ROOT
}
/platforms/
${
host_os
}
/
${
host_arch
}
/kubectl"
)
kubectl
=
$(
(
ls
-t
"
${
locations
[@]
}
"
2>/dev/null
||
true
)
|
head
-1
)
...
...
hack/lib/util.sh
View file @
b9e060a6
...
...
@@ -167,12 +167,19 @@ kube::util::host_platform() {
kube::util::find-binary-for-platform
()
{
local
-r
lookfor
=
"
$1
"
local
-r
platform
=
"
$2
"
local
-r
locations
=(
local
locations
=(
"
${
KUBE_ROOT
}
/_output/bin/
${
lookfor
}
"
"
${
KUBE_ROOT
}
/_output/dockerized/bin/
${
platform
}
/
${
lookfor
}
"
"
${
KUBE_ROOT
}
/_output/local/bin/
${
platform
}
/
${
lookfor
}
"
"
${
KUBE_ROOT
}
/platforms/
${
platform
}
/
${
lookfor
}
"
)
# Also search for binary in bazel build tree.
# In some cases we have to name the binary $BINARY_bin, since there was a
# directory named $BINARY next to it.
locations+
=(
$(
find
"
${
KUBE_ROOT
}
/bazel-bin/"
-type
f
-executable
\
\(
-name
"
${
lookfor
}
"
-o
-name
"
${
lookfor
}
_bin"
\)
2>/dev/null
||
true
)
)
# List most recently-updated location.
local
-r
bin
=
$(
(
ls
-t
"
${
locations
[@]
}
"
2>/dev/null
||
true
)
|
head
-1
)
echo
-n
"
${
bin
}
"
}
...
...
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