mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Make description checker check for descriptions in internal API
This commit is contained in:
parent
85ee11afc0
commit
2dceb28444
@ -38,18 +38,24 @@ find_files() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if [[ $# -eq 0 ]]; then
|
if [[ $# -eq 0 ]]; then
|
||||||
files=`find_files | egrep "pkg/api/v.[^/]*/types\.go"`
|
versioned_api_files=`find_files | egrep "pkg/api/v.[^/]*/types\.go"`
|
||||||
else
|
else
|
||||||
files=("${@}")
|
versioned_api_files=("${@}")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for file in $files; do
|
for file in $versioned_api_files; do
|
||||||
if grep json: "${file}" | grep -v // | grep -v ,inline | grep -v -q description: ; then
|
if grep json: "${file}" | grep -v // | grep -v ,inline | grep -v -q description: ; then
|
||||||
echo "API file is missing the required field descriptions: ${file}"
|
echo "API file is missing the required field descriptions: ${file}"
|
||||||
result=1
|
result=1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
internal_types_file="${KUBE_ROOT}/pkg/api/types.go"
|
||||||
|
if grep json: "${internal_types_file}" | grep -v // | grep description: ; then
|
||||||
|
echo "Internal API types should not contain descriptions"
|
||||||
|
result=1
|
||||||
|
fi
|
||||||
|
|
||||||
exit ${result}
|
exit ${result}
|
||||||
|
|
||||||
# ex: ts=2 sw=2 et filetype=sh
|
# ex: ts=2 sw=2 et filetype=sh
|
||||||
|
Loading…
Reference in New Issue
Block a user