From e6fccc36d8e7f557a99948bfeb2a852460e3f4c2 Mon Sep 17 00:00:00 2001 From: Antonio Ojea Date: Thu, 28 Nov 2024 15:42:59 +0000 Subject: [PATCH] apidiff support internal go modules The kubernetes repository contains some internal golang modules that are not part of the golang global workspace. Because apidiff is currently run from the root of the repository, it does not work against this internal modules. Instead of executing apidiff from the root we can just cd into the passed path of the module to avoid this limitation. --- hack/apidiff.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hack/apidiff.sh b/hack/apidiff.sh index fa70631de38..43fb44f825f 100755 --- a/hack/apidiff.sh +++ b/hack/apidiff.sh @@ -156,7 +156,12 @@ run () { out="$1" mkdir -p "$out" for d in "${targets[@]}"; do - apidiff -m -w "${out}/$(output_name "${d}")" "${d}" + # 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 + ( + cd "${d}" + apidiff -m -w "${out}/$(output_name "${d}")" . + ) done }