File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -23,22 +23,36 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
23
23
24
24
kube::golang::setup_env
25
25
26
- make -C " ${KUBE_ROOT} " WHAT=cmd/hyperkube
26
+ kube::util::ensure-temp-dir
27
+ OUTPUT=" ${KUBE_TEMP} " /symbols-output
28
+ cleanup () {
29
+ rm -rf " ${OUTPUT} "
30
+ }
31
+ trap " cleanup" EXIT SIGINT
32
+ mkdir -p " ${OUTPUT} "
33
+
34
+ GOLDFLAGS=" -w" make -C " ${KUBE_ROOT} " WHAT=cmd/hyperkube
27
35
28
36
# Add other BADSYMBOLS here.
29
37
BADSYMBOLS=(
30
38
" httptest"
31
39
" testify"
32
40
" testing[.]"
33
41
" TestOnlySetFatalOnDecodeError"
42
+ " TrackStorageCleanup"
34
43
)
35
44
36
45
# b/c hyperkube binds everything simply check that for bad symbols
37
- SYMBOLS=" $( go tool nm " ${KUBE_OUTPUT_HOSTBIN} /hyperkube" ) "
46
+ go tool nm " ${KUBE_OUTPUT_HOSTBIN} /hyperkube" > " ${OUTPUT} /hyperkube-symbols"
47
+
48
+ if ! grep -q " NewHyperKubeCommand" " ${OUTPUT} /hyperkube-symbols" ; then
49
+ echo " No symbols found in hyperkube binary."
50
+ exit 1
51
+ fi
38
52
39
53
RESULT=0
40
54
for BADSYMBOL in " ${BADSYMBOLS[@]} " ; do
41
- if FOUND=$( echo " ${SYMBOLS } " | grep " ${BADSYMBOL} " ) ; then
55
+ if FOUND=$( grep " ${BADSYMBOL } " < " ${OUTPUT} /hyperkube-symbols " ) ; then
42
56
echo " Found bad symbol '${BADSYMBOL} ':"
43
57
echo " $FOUND "
44
58
RESULT=1
You can’t perform that action at this time.
0 commit comments