Commit 3a7af8fb authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #39673 from liggitt/deads2k-fix-bindata

Automatic merge from submit-queue (batch tested with PRs 39673, 39536, 39617, 39540, 39686) Generate stable bindata output fixes #30621 bindata generation produces spurious diffs when run with different go versions because gzip output is not stable between versions. It also produces spurious diffs when invoked directly vs via make/go:generate. This PR: * adds data to bindata uncompressed (makes translation files human-readable, and the zip files were already compressed... for reference the file was 27.7 KB before, and 20.1 KB with this change) * runs the generation from KUBE_ROOT, so it doesn't matter whether it is invoked directly or via go:generate supercedes https://github.com/kubernetes/kubernetes/pull/39631
parents d3c0914a 1127d5c0
...@@ -38,14 +38,17 @@ if ! which go-bindata &>/dev/null ; then ...@@ -38,14 +38,17 @@ if ! which go-bindata &>/dev/null ; then
exit 5 exit 5
fi fi
# run the generation from the root directory for stable output
pushd "${KUBE_ROOT}"
# These are files for e2e tests. # These are files for e2e tests.
BINDATA_OUTPUT="${KUBE_ROOT}/test/e2e/generated/bindata.go" BINDATA_OUTPUT="test/e2e/generated/bindata.go"
go-bindata -nometadata -prefix "${KUBE_ROOT}" -o "${BINDATA_OUTPUT}.tmp" -pkg generated \ go-bindata -nometadata -o "${BINDATA_OUTPUT}.tmp" -pkg generated \
-ignore .jpg -ignore .png -ignore .md \ -ignore .jpg -ignore .png -ignore .md \
"${KUBE_ROOT}/examples/..." \ "examples/..." \
"${KUBE_ROOT}/test/e2e/testing-manifests/..." \ "test/e2e/testing-manifests/..." \
"${KUBE_ROOT}/test/images/..." \ "test/images/..." \
"${KUBE_ROOT}/test/fixtures/..." "test/fixtures/..."
gofmt -s -w "${BINDATA_OUTPUT}.tmp" gofmt -s -w "${BINDATA_OUTPUT}.tmp"
...@@ -62,10 +65,10 @@ fi ...@@ -62,10 +65,10 @@ fi
rm -f "${BINDATA_OUTPUT}.tmp" rm -f "${BINDATA_OUTPUT}.tmp"
# These are files for runtime code # These are files for runtime code
BINDATA_OUTPUT="${KUBE_ROOT}/pkg/generated/bindata.go" BINDATA_OUTPUT="pkg/generated/bindata.go"
go-bindata -nometadata -prefix "${KUBE_ROOT}" -o "${BINDATA_OUTPUT}.tmp" -pkg generated \ go-bindata -nometadata -nocompress -o "${BINDATA_OUTPUT}.tmp" -pkg generated \
-ignore .jpg -ignore .png -ignore .md \ -ignore .jpg -ignore .png -ignore .md \
"${KUBE_ROOT}/translations/..." "translations/..."
gofmt -s -w "${BINDATA_OUTPUT}.tmp" gofmt -s -w "${BINDATA_OUTPUT}.tmp"
...@@ -80,3 +83,5 @@ else ...@@ -80,3 +83,5 @@ else
fi fi
rm -f "${BINDATA_OUTPUT}.tmp" rm -f "${BINDATA_OUTPUT}.tmp"
popd
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment