Skip to content

Commit 1ee19f1

Browse files
author
kartik494
committed
Add check for update-crd script file
1 parent d8ff17b commit 1ee19f1

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

hack/update-crd.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,15 @@
1818
set -o nounset
1919
set -o pipefail
2020

21-
## find or download controller-gen
21+
SCRIPT_ROOT=$(unset CDPATH && cd $(dirname "${BASH_SOURCE[0]}")/.. && pwd)
22+
23+
if [ ${SCRIPT_ROOT}/client != $(pwd) ]
24+
then
25+
echo "NOTE: This script should be run from client directory only";
26+
exit 1;
27+
fi
28+
29+
# find or download controller-gen
2230
CONTROLLER_GEN=$(which controller-gen)
2331

2432
if [ "$CONTROLLER_GEN" = "" ]
@@ -37,7 +45,6 @@ then
3745
exit 1;
3846
fi
3947

40-
SCRIPT_ROOT=$(unset CDPATH && cd $(dirname "${BASH_SOURCE[0]}")/.. && pwd)
4148
$CONTROLLER_GEN crd:trivialVersions=true,preserveUnknownFields=false paths=${SCRIPT_ROOT}/client/apis/volumesnapshot/v1beta1
4249

4350
# To use your own boilerplate text use:

0 commit comments

Comments
 (0)