mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-08 03:33:56 +00:00
handle the case when modules are added or removed
don't compare modules that didn't or doesn't exist
This commit is contained in:
parent
52386915a8
commit
7de94d43ca
@ -149,6 +149,10 @@ run () {
|
|||||||
out="$1"
|
out="$1"
|
||||||
mkdir -p "$out"
|
mkdir -p "$out"
|
||||||
for d in "${targets[@]}"; do
|
for d in "${targets[@]}"; do
|
||||||
|
if ! [ -d "${d}" ]; then
|
||||||
|
echo "module ${d} does not exist, skipping ..."
|
||||||
|
continue
|
||||||
|
fi
|
||||||
# cd to the path for modules that are intree but not part of the go workspace
|
# cd to the path for modules that are intree but not part of the go workspace
|
||||||
# per example staging/src/k8s.io/code-generator/examples
|
# per example staging/src/k8s.io/code-generator/examples
|
||||||
(
|
(
|
||||||
@ -208,6 +212,10 @@ compare () {
|
|||||||
what="$1"
|
what="$1"
|
||||||
before="$2"
|
before="$2"
|
||||||
after="$3"
|
after="$3"
|
||||||
|
if [ ! -f "${before}" ] || [ ! -f "${after}" ]; then
|
||||||
|
echo "can not compare changes, module didn't exist before or after"
|
||||||
|
return
|
||||||
|
fi
|
||||||
changes=$(apidiff -m "${before}" "${after}" 2>&1 | grep -v -e "^Ignoring internal package") || true
|
changes=$(apidiff -m "${before}" "${after}" 2>&1 | grep -v -e "^Ignoring internal package") || true
|
||||||
echo "## ${what}"
|
echo "## ${what}"
|
||||||
if [ -z "$changes" ]; then
|
if [ -z "$changes" ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user