forked from rook/rook
this commit update make crds-gen to make crds Signed-off-by: subhamkrai <srai@redhat.com>
43 lines
755 B
Bash
Executable File
43 lines
755 B
Bash
Executable File
#!/bin/bash
|
|
set -ex
|
|
|
|
#############
|
|
# VARIABLES #
|
|
#############
|
|
CODEGEN_ERR="found codegen files! please run 'make codegen' and update your PR"
|
|
MOD_ERR="changes found by mod.check. You may need to run make clean"
|
|
CRD_ERR="changes found by 'make crds'. please run 'make crds' locally and update your PR"
|
|
|
|
#############
|
|
# FUNCTIONS #
|
|
#############
|
|
function validate(){
|
|
git=$(git status --porcelain)
|
|
for file in $git; do
|
|
if [ -n "$file" ]; then
|
|
echo "$1"
|
|
echo "$git"
|
|
git diff
|
|
exit 1
|
|
fi
|
|
done
|
|
}
|
|
|
|
########
|
|
# MAIN #
|
|
########
|
|
case "$1" in
|
|
codegen)
|
|
validate "$CODEGEN_ERR"
|
|
;;
|
|
modcheck)
|
|
validate "$MOD_ERR"
|
|
;;
|
|
crd)
|
|
validate "$CRD_ERR"
|
|
;;
|
|
*)
|
|
echo $"Usage: $0 {codegen|modcheck|crd}"
|
|
exit 1
|
|
esac
|