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
dca376a0
Commit
dca376a0
authored
May 23, 2018
by
Jeff Grafton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add KUBE_CGO_OVERRIDES env var to force enabling CGO
parent
65a81933
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
golang.sh
hack/lib/golang.sh
+15
-3
No files found.
hack/lib/golang.sh
View file @
dca376a0
...
...
@@ -213,12 +213,24 @@ readonly KUBE_STATIC_LIBRARIES=(
kubectl
)
# KUBE_CGO_OVERRIDES is a space-separated list of binaries which should be built
# with CGO enabled, assuming CGO is supported on the target platform.
# This overrides any entry in KUBE_STATIC_LIBRARIES.
IFS
=
" "
read
-ra
KUBE_CGO_OVERRIDES
<<<
"
${
KUBE_CGO_OVERRIDES
:-}
"
readonly
KUBE_CGO_OVERRIDES
# KUBE_STATIC_OVERRIDES is a space-separated list of binaries which should be
# built with CGO disabled. This is in addition to the list in
# KUBE_STATIC_LIBRARIES.
IFS
=
" "
read
-ra
KUBE_STATIC_OVERRIDES
<<<
"
${
KUBE_STATIC_OVERRIDES
:-}
"
readonly
KUBE_STATIC_OVERRIDES
kube::golang::is_statically_linked_library
()
{
local
e
if
[[
-n
"
${
KUBE_CGO_OVERRIDES
:+x
}
"
]]
;
then
for
e
in
"
${
KUBE_CGO_OVERRIDES
[@]
}
"
;
do
[[
"
$1
"
==
*
"/
$e
"
]]
&&
return
1
;
done
;
fi
for
e
in
"
${
KUBE_STATIC_LIBRARIES
[@]
}
"
;
do
[[
"
$1
"
==
*
"/
$e
"
]]
&&
return
0
;
done
;
# Allow individual overrides--e.g., so that you can get a static build of
# kubectl for inclusion in a container.
if
[
-n
"
${
KUBE_STATIC_OVERRIDES
:+x
}
"
]
;
then
if
[[
-n
"
${
KUBE_STATIC_OVERRIDES
:+x
}
"
]]
;
then
for
e
in
"
${
KUBE_STATIC_OVERRIDES
[@]
}
"
;
do
[[
"
$1
"
==
*
"/
$e
"
]]
&&
return
0
;
done
;
fi
return
1
;
...
...
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