Do not use goimports in hack/update-generated-conversions.sh
Stop depending on an external binary needing to be on people's system. Use the code directly.
This commit is contained in:
@@ -33,26 +33,15 @@ function generate_version() {
|
||||
|
||||
sed 's/YEAR/2015/' hack/boilerplate/boilerplate.go.txt > "$TMPFILE"
|
||||
cat >> "$TMPFILE" <<EOF
|
||||
package ${version##*/}
|
||||
// DO NOT EDIT. THIS FILE IS AUTO-GENERATED BY \$KUBEROOT/hack/update-generated-conversions.sh
|
||||
|
||||
// AUTO-GENERATED FUNCTIONS START HERE
|
||||
EOF
|
||||
|
||||
"${genconversion}" -v "${version}" -f - >> "$TMPFILE"
|
||||
|
||||
cat >> "$TMPFILE" <<EOF
|
||||
// AUTO-GENERATED FUNCTIONS END HERE
|
||||
EOF
|
||||
|
||||
goimports -w "$TMPFILE"
|
||||
mv "$TMPFILE" "pkg/${version}/conversion_generated.go"
|
||||
}
|
||||
|
||||
if ! which goimports >/dev/null; then
|
||||
echo "goimports not in path, run go get golang.org/x/tools/cmd/goimports"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DEFAULT_VERSIONS="api/v1 expapi/v1"
|
||||
VERSIONS=${VERSIONS:-$DEFAULT_VERSIONS}
|
||||
for ver in $VERSIONS; do
|
||||
|
Reference in New Issue
Block a user