From e100e8990b5bf0c6c5abf38f7a89ec1e0a100a33 Mon Sep 17 00:00:00 2001 From: deads2k Date: Tue, 17 Jan 2017 08:55:50 -0500 Subject: [PATCH] update generation bash to handle vendor dir --- hack/.linted_packages | 16 ++++++++++++++++ hack/lib/util.sh | 18 ++++++++++++------ hack/update-api-reference-docs.sh | 2 +- hack/update-codegen.sh | 3 ++- hack/update-federation-api-reference-docs.sh | 4 ++-- ...update-federation-generated-swagger-docs.sh | 2 +- hack/update-generated-swagger-docs.sh | 4 ++-- 7 files changed, 36 insertions(+), 13 deletions(-) diff --git a/hack/.linted_packages b/hack/.linted_packages index 23390faa0f..e6cbb955a7 100644 --- a/hack/.linted_packages +++ b/hack/.linted_packages @@ -68,6 +68,7 @@ pkg/api/annotations pkg/api/errors pkg/api/events pkg/api/install +pkg/api/meta pkg/api/resource pkg/api/service pkg/api/v1 @@ -173,6 +174,7 @@ pkg/controller/volume/cache pkg/controller/volume/populator pkg/controller/volume/reconciler pkg/controller/volume/statusupdater +pkg/conversion pkg/conversion/queryparams pkg/credentialprovider/aws pkg/genericapiserver/api/audit @@ -199,6 +201,7 @@ pkg/kubelet/volumemanager pkg/kubelet/volumemanager/cache pkg/kubelet/volumemanager/populator pkg/kubelet/volumemanager/reconciler +pkg/labels pkg/proxy/config pkg/proxy/healthcheck pkg/quota @@ -236,8 +239,12 @@ pkg/registry/serviceaccount pkg/registry/thirdpartyresource pkg/registry/thirdpartyresource/storage pkg/runtime +pkg/runtime/serializer pkg/runtime/serializer/json +pkg/runtime/serializer/protobuf +pkg/runtime/serializer/recognizer pkg/runtime/serializer/recognizer/testing +pkg/runtime/serializer/streaming pkg/runtime/serializer/versioning pkg/runtime/serializer/yaml pkg/security @@ -248,11 +255,14 @@ pkg/serviceaccount pkg/storage pkg/storage/etcd3 pkg/storage/storagebackend/factory +pkg/types pkg/util/async pkg/util/cert pkg/util/codeinspector +pkg/util/errors pkg/util/flock pkg/util/flushwriter +pkg/util/framer pkg/util/goroutinemap pkg/util/hash pkg/util/homedir @@ -264,14 +274,20 @@ pkg/util/limitwriter pkg/util/logs pkg/util/maps pkg/util/metrics +pkg/util/net pkg/util/netsh pkg/util/rand pkg/util/ratelimit pkg/util/replicaset pkg/util/restoptions +pkg/util/runtime +pkg/util/sets +pkg/util/validation pkg/util/validation/field pkg/util/version +pkg/util/wait pkg/util/workqueue +pkg/util/yaml pkg/version/prometheus pkg/volume pkg/volume/downwardapi diff --git a/hack/lib/util.sh b/hack/lib/util.sh index e6cada20ec..2ef23f0f63 100755 --- a/hack/lib/util.sh +++ b/hack/lib/util.sh @@ -313,22 +313,28 @@ kube::util::group-version-to-pkg-path() { case "${group_version}" in # both group and version are "", this occurs when we generate deep copies for internal objects of the legacy v1 API. __internal) - echo "api" + echo "pkg/api" ;; v1) - echo "api/v1" + echo "pkg/api/v1" + ;; + federation/v1beta1) + echo "federation/apis/federation/v1beta1" + ;; + meta/v1) + echo "vendor/k8s.io/apimachinery/pkg/apis/meta/v1" ;; unversioned) - echo "api/unversioned" + echo "pkg/api/unversioned" ;; *.k8s.io) - echo "apis/${group_version%.*k8s.io}" + echo "pkg/apis/${group_version%.*k8s.io}" ;; *.k8s.io/*) - echo "apis/${group_version/.*k8s.io/}" + echo "pkg/apis/${group_version/.*k8s.io/}" ;; *) - echo "apis/${group_version%__internal}" + echo "pkg/apis/${group_version%__internal}" ;; esac } diff --git a/hack/update-api-reference-docs.sh b/hack/update-api-reference-docs.sh index 6dae42e178..6fb808f7a1 100755 --- a/hack/update-api-reference-docs.sh +++ b/hack/update-api-reference-docs.sh @@ -44,7 +44,7 @@ for gv in "${ALL_GROUP_VERSIONS[@]}"; do fi INTERESTING_GROUP_VERSIONS+=(${gv}) - GV_DIRS+=("${REPO_DIR}/pkg/$(kube::util::group-version-to-pkg-path "${gv}")") + GV_DIRS+=("${REPO_DIR}/$(kube::util::group-version-to-pkg-path "${gv}")") done GROUP_VERSIONS="${INTERESTING_GROUP_VERSIONS[@]}" GV_DIRS="${GV_DIRS[@]}" kube::swagger::gen_api_ref_docs "${SWAGGER_SPEC_PATH}" "${OUTPUT}" diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index fbcf998c24..f74f06438f 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -45,7 +45,8 @@ GV_DIRS=() for gv in "${GROUP_VERSIONS[@]}"; do # add items, but strip off any leading apis/ you find to match command expectations api_dir=$(kube::util::group-version-to-pkg-path "${gv}") - pkg_dir=${api_dir#apis/} + nopkg_dir=${api_dir#pkg/} + pkg_dir=${nopkg_dir#apis/} # skip groups that aren't being served, clients for these don't matter if [[ " ${KUBE_NONSERVER_GROUP_VERSIONS} " == *" ${gv} "* ]]; then diff --git a/hack/update-federation-api-reference-docs.sh b/hack/update-federation-api-reference-docs.sh index 7d0a160ac9..c4f7e6818f 100755 --- a/hack/update-federation-api-reference-docs.sh +++ b/hack/update-federation-api-reference-docs.sh @@ -39,9 +39,9 @@ GROUP_VERSIONS=("federation/v1beta1" "v1" "extensions/v1beta1") GV_DIRS=() for gv in "${GROUP_VERSIONS[@]}"; do if [[ ${gv} == "federation/v1beta1" ]]; then - GV_DIRS+=("${REPO_DIR}/federation/$(kube::util::group-version-to-pkg-path "${gv}")") + GV_DIRS+=("${REPO_DIR}/$(kube::util::group-version-to-pkg-path "${gv}")") else - GV_DIRS+=("${REPO_DIR}/pkg/$(kube::util::group-version-to-pkg-path "${gv}")") + GV_DIRS+=("${REPO_DIR}/$(kube::util::group-version-to-pkg-path "${gv}")") fi done diff --git a/hack/update-federation-generated-swagger-docs.sh b/hack/update-federation-generated-swagger-docs.sh index dc566b7ed8..c6ff916bdc 100755 --- a/hack/update-federation-generated-swagger-docs.sh +++ b/hack/update-federation-generated-swagger-docs.sh @@ -31,7 +31,7 @@ kube::golang::setup_env GROUP_VERSIONS=(federation/v1beta1) GV_DIRS=() for gv in "${GROUP_VERSIONS[@]}"; do - GV_DIRS+=("federation/$(kube::util::group-version-to-pkg-path "${gv}")") + GV_DIRS+=("$(kube::util::group-version-to-pkg-path "${gv}")") done # To avoid compile errors, remove the currently existing files. diff --git a/hack/update-generated-swagger-docs.sh b/hack/update-generated-swagger-docs.sh index 34e676c00f..3fa23dfe0f 100755 --- a/hack/update-generated-swagger-docs.sh +++ b/hack/update-generated-swagger-docs.sh @@ -32,8 +32,8 @@ GROUP_VERSIONS=(meta/v1 ${KUBE_AVAILABLE_GROUP_VERSIONS}) # To avoid compile errors, remove the currently existing files. for group_version in "${GROUP_VERSIONS[@]}"; do - rm -f "pkg/$(kube::util::group-version-to-pkg-path "${group_version}")/types_swagger_doc_generated.go" + rm -f "$(kube::util::group-version-to-pkg-path "${group_version}")/types_swagger_doc_generated.go" done for group_version in "${GROUP_VERSIONS[@]}"; do - kube::swagger::gen_types_swagger_doc "${group_version}" "pkg/$(kube::util::group-version-to-pkg-path "${group_version}")" + kube::swagger::gen_types_swagger_doc "${group_version}" "$(kube::util::group-version-to-pkg-path "${group_version}")" done