From c6212cc275f4a4982e64144ab224966bd9174d44 Mon Sep 17 00:00:00 2001 From: Clayton Coleman Date: Sun, 15 Jan 2017 16:13:24 -0500 Subject: [PATCH] Strip k8s gen tags from client-go Prevents client-go from being part of generation now that vendored dependencies are considered in the chain. --- staging/copy.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/staging/copy.sh b/staging/copy.sh index 3e912fce07b..3ea89cf658e 100755 --- a/staging/copy.sh +++ b/staging/copy.sh @@ -42,6 +42,7 @@ CLIENT_REPO="${MAIN_REPO}/staging/src/${CLIENT_REPO_FROM_SRC}" CLIENT_REPO_TEMP="${MAIN_REPO}/staging/src/${CLIENT_REPO_TEMP_FROM_SRC}" DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +sedi="-i" cleanup() { rm -rf "${CLIENT_REPO_TEMP}" @@ -89,7 +90,7 @@ GO15VENDOREXPERIMENT=1 godep save ./... popd > /dev/null echo "moving vendor/k8s.io/kubernetes" -cp -rn "${CLIENT_REPO_TEMP}"/vendor/k8s.io/kubernetes/* "${CLIENT_REPO_TEMP}"/ +cp -r "${CLIENT_REPO_TEMP}"/vendor/k8s.io/kubernetes/* "${CLIENT_REPO_TEMP}"/ rm -rf "${CLIENT_REPO_TEMP}"/vendor/k8s.io/kubernetes # client-go will share the vendor of the main repo for now. When client-go # becomes a standalone repo, it will have its own vendor @@ -130,6 +131,13 @@ sed -i "s/kubernetes_build_info/kubernetes_build_info_copy/g" "${CLIENT_REPO_TEM echo "rewrite proto names in proto.RegisterType" find "${CLIENT_REPO_TEMP}" -type f -name "generated.pb.go" -print0 | xargs -0 sed -i "s/k8s\.io\.kubernetes/k8s.io.client-go/g" +# strip all generator tags from client-go +find "${CLIENT_REPO_TEMP}" -type f -name "*.go" -print0 | xargs -0 sed -i '/^\/\/ +k8s:openapi-gen=true/d' +find "${CLIENT_REPO_TEMP}" -type f -name "*.go" -print0 | xargs -0 sed -i '/^\/\/ +k8s:defaulter-gen=/d' +find "${CLIENT_REPO_TEMP}" -type f -name "*.go" -print0 | xargs -0 sed -i '/^\/\/ +k8s:deepcopy-gen=/d' +find "${CLIENT_REPO_TEMP}" -type f -name "*.go" -print0 | xargs -0 sed -i '/^\/\/ +k8s:conversion-gen=/d' + + echo "rearranging directory layout" # $1 and $2 are relative to ${CLIENT_REPO_TEMP} function mvfolder {