#!/bin/bash # Copyright 2014 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. set -o errexit set -o nounset set -o pipefail global KUBE_ROOT := "$[dirname $(BASH_SOURCE)]/.." source "$(KUBE_ROOT)/hack/lib/init.sh" kube::golang::setup_env make -C $(KUBE_ROOT) WHAT=cmd/hyperkube # Add other BADSYMBOLS here. global BADSYMBOLS := '( "'httptest" "testify" "testing[.]" ) # b/c hyperkube binds everything simply check that for bad symbols global SYMBOLS := $[nm $(KUBE_OUTPUT_HOSTBIN)/hyperkube] global RESULT := '0' for BADSYMBOL in [$(BADSYMBOLS[@])] { if global FOUND := $[echo $SYMBOLS | grep $BADSYMBOL] { echo "Found bad symbol '$(BADSYMBOL)':" echo $FOUND global RESULT := '1' } } exit $RESULT # ex: ts=2 sw=2 et filetype=sh (CommandList children: [ (C {(set)} {(-o)} {(errexit)}) (C {(set)} {(-o)} {(nounset)}) (C {(set)} {(-o)} {(pipefail)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:KUBE_ROOT) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(dirname)} {(DQ (${ VSub_Name BASH_SOURCE))})] ) left_token: spids: [64 72] ) (/..) } spids: [63] ) ] spids: [63] ) (C {(source)} {(DQ (${ VSub_Name KUBE_ROOT) (/hack/lib/init.sh))}) (C {(kube) (Lit_Other ":") (Lit_Other ":") (golang) (Lit_Other ":") (Lit_Other ":") (setup_env)}) (C {(make)} {(-C)} {(DQ (${ VSub_Name KUBE_ROOT))} {(Lit_VarLike "WHAT=") (cmd/hyperkube)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:BADSYMBOLS) op: Equal rhs: {(ArrayLiteralPart words:[{(DQ (httptest))}{(DQ (testify))}{(DQ ("testing[.]"))}])} spids: [111] ) ] spids: [111] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:SYMBOLS) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [(C {(nm)} {(${ VSub_Name KUBE_OUTPUT_HOSTBIN) (/hyperkube)})] ) left_token: spids: [137 144] ) ) } spids: [135] ) ] spids: [135] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:RESULT) op:Equal rhs:{(0)} spids:[148])] spids: [148] ) (ForEach iter_name: BADSYMBOL iter_words: [ { (DQ (BracedVarSub token: bracket_op: (WholeArray op_id:Lit_At) spids: [158 163] ) ) } ] do_arg_iter: False body: (DoGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:FOUND) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {(DQ ($ VSub_Name "$SYMBOLS"))}) (C {(grep)} {(DQ ($ VSub_Name "$BADSYMBOL"))}) ] negated: False ) ] ) left_token: spids: [173 187] ) } spids: [172] ) ] spids: [172] ) terminator: ) ] action: [ (C {(echo)} {(DQ ("Found bad symbol '") (${ VSub_Name BADSYMBOL) ("':"))}) (C {(echo)} {(DQ ($ VSub_Name "$FOUND"))}) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:RESULT) op:Equal rhs:{(1)} spids:[211])] spids: [211] ) ] spids: [-1 190] ) ] spids: [-1 215] ) ] spids: [167 217] ) spids: [156 165] ) (C {(exit)} {($ VSub_Name "$RESULT")}) ] )