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
449e94b2
Commit
449e94b2
authored
Sep 07, 2018
by
Katharine Berry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use KUBE_BUILD_WITH_COVERAGE directly.
parent
36174626
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
golang.sh
hack/lib/golang.sh
+3
-4
No files found.
hack/lib/golang.sh
View file @
449e94b2
...
@@ -523,14 +523,14 @@ kube::golang::delete_coverage_dummy_test() {
...
@@ -523,14 +523,14 @@ kube::golang::delete_coverage_dummy_test() {
# Arguments: a list of kubernetes packages to build.
# Arguments: a list of kubernetes packages to build.
# Expected variables: ${build_args} should be set to an array of Go build arguments.
# Expected variables: ${build_args} should be set to an array of Go build arguments.
# In addition, ${package} and ${platform} should have been set earlier, and if
# In addition, ${package} and ${platform} should have been set earlier, and if
# ${
build_with_coverage
} is set, coverage instrumentation will be enabled.
# ${
KUBE_BUILD_WITH_COVERAGE
} is set, coverage instrumentation will be enabled.
#
#
# Invokes Go to actually build some packages. If coverage is disabled, simply invokes
# Invokes Go to actually build some packages. If coverage is disabled, simply invokes
# go install. If coverage is enabled, builds covered binaries using go test, temporarily
# go install. If coverage is enabled, builds covered binaries using go test, temporarily
# producing the required unit test files and then cleaning up after itself.
# producing the required unit test files and then cleaning up after itself.
# Non-covered binaries are then built using go install as usual.
# Non-covered binaries are then built using go install as usual.
kube::golang::build_some_binaries
()
{
kube::golang::build_some_binaries
()
{
if
[[
-n
"
${
build_with_coverage
:-}
"
]]
;
then
if
[[
-n
"
${
KUBE_BUILD_WITH_COVERAGE
:-}
"
]]
;
then
local
-a
uncovered
=()
local
-a
uncovered
=()
for
package
in
"
$@
"
;
do
for
package
in
"
$@
"
;
do
if
kube::golang::is_instrumented_package
"
${
package
}
"
;
then
if
kube::golang::is_instrumented_package
"
${
package
}
"
;
then
...
@@ -661,11 +661,10 @@ kube::golang::build_binaries() {
...
@@ -661,11 +661,10 @@ kube::golang::build_binaries() {
host_platform
=
$(
kube::golang::host_platform
)
host_platform
=
$(
kube::golang::host_platform
)
# Use eval to preserve embedded quoted strings.
# Use eval to preserve embedded quoted strings.
local
goflags goldflags gogcflags
build_with_coverage
local
goflags goldflags gogcflags
eval
"goflags=(
${
GOFLAGS
:-}
)"
eval
"goflags=(
${
GOFLAGS
:-}
)"
goldflags
=
"
${
GOLDFLAGS
:-}
$(
kube::version::ldflags
)
"
goldflags
=
"
${
GOLDFLAGS
:-}
$(
kube::version::ldflags
)
"
gogcflags
=
"
${
GOGCFLAGS
:-}
"
gogcflags
=
"
${
GOGCFLAGS
:-}
"
build_with_coverage
=
"
${
KUBE_BUILD_WITH_COVERAGE
:-}
"
local
-a
targets
=()
local
-a
targets
=()
local
arg
local
arg
...
...
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