mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 15:58:37 +00:00
Change into the output directory before running go test -c.
This commit is contained in:
parent
bf1de72f4a
commit
90f61f3005
@ -359,16 +359,17 @@ kube::golang::build_binaries_for_platform() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
for test in "${tests[@]:+${tests[@]}}"; do
|
for test in "${tests[@]:+${tests[@]}}"; do
|
||||||
local outfile=$(kube::golang::output_filename_for_binary "${test}" \
|
local outfile=$(kube::golang::output_filename_for_binary "${test}" \
|
||||||
"${platform}")
|
"${platform}")
|
||||||
# Go 1.4 added -o to control where the binary is saved, but Go 1.3 doesn't
|
# Go 1.4 added -o to control where the binary is saved, but Go 1.3 doesn't
|
||||||
# have this flag. Whenever we deprecate go 1.3, update to use -o instead of
|
# have this flag. Whenever we deprecate go 1.3, update to use -o instead of
|
||||||
# calling mv.
|
# changing into the output directory.
|
||||||
|
pushd "$(dirname ${outfile})"
|
||||||
go test -c \
|
go test -c \
|
||||||
"${goflags[@]:+${goflags[@]}}" \
|
"${goflags[@]:+${goflags[@]}}" \
|
||||||
-ldflags "${version_ldflags}" \
|
-ldflags "${version_ldflags}" \
|
||||||
"$(dirname ${test})"
|
"$(dirname ${test})"
|
||||||
mv -f "$(basename ${outfile})" "${outfile}"
|
popd
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user