From 1e2b644260cf6643f89502b953912b581cc689a0 Mon Sep 17 00:00:00 2001 From: Mike Danese Date: Sat, 13 Jan 2018 16:25:18 -0800 Subject: [PATCH] cluster: move logging library to hack/ it's used once in cluster and used a bunch in hack/ and build/ --- cluster/BUILD | 4 ---- cluster/common.sh | 3 +-- cluster/lib/BUILD | 25 ------------------------- hack/generate-bindata.sh | 2 +- hack/lib/BUILD | 4 +--- hack/lib/init.sh | 2 +- {cluster => hack}/lib/logging.sh | 0 test/e2e_node/gubernator.sh | 2 +- 8 files changed, 5 insertions(+), 37 deletions(-) delete mode 100644 cluster/lib/BUILD rename {cluster => hack}/lib/logging.sh (100%) diff --git a/cluster/BUILD b/cluster/BUILD index 1f55e38dc5..9d3ad2c974 100644 --- a/cluster/BUILD +++ b/cluster/BUILD @@ -20,7 +20,6 @@ filegroup( "//cluster/images/etcd/rollback:all-srcs", "//cluster/images/hyperkube:all-srcs", "//cluster/images/kubemark:all-srcs", - "//cluster/lib:all-srcs", "//cluster/saltbase:all-srcs", ], tags = ["automanaged"], @@ -55,7 +54,6 @@ sh_test( name = "common_test", srcs = ["common.sh"], deps = [ - "//cluster/lib", "//hack/lib", ], ) @@ -64,7 +62,6 @@ sh_test( name = "clientbin_test", srcs = ["clientbin.sh"], deps = [ - "//cluster/lib", "//hack/lib", ], ) @@ -73,7 +70,6 @@ sh_test( name = "kube-util_test", srcs = ["kube-util.sh"], deps = [ - "//cluster/lib", "//hack/lib", ], ) diff --git a/cluster/common.sh b/cluster/common.sh index 2aa73622a6..cdc2300612 100755 --- a/cluster/common.sh +++ b/cluster/common.sh @@ -25,7 +25,6 @@ KUBE_ROOT=$(cd $(dirname "${BASH_SOURCE}")/.. && pwd) DEFAULT_KUBECONFIG="${HOME:-.}/.kube/config" source "${KUBE_ROOT}/hack/lib/util.sh" -source "${KUBE_ROOT}/cluster/lib/logging.sh" # KUBE_RELEASE_VERSION_REGEX matches things like "v1.2.3" or "v1.2.3-alpha.4" # # NOTE This must match the version_regex in build/common.sh @@ -499,7 +498,7 @@ function stage-images() { done kube::util::wait-for-jobs || { - kube::log::error "unable to push images. See ${temp_dir}/*.log for more info." + echo "!!! unable to push images. See ${temp_dir}/*.log for more info." 1>&2 return 1 } diff --git a/cluster/lib/BUILD b/cluster/lib/BUILD deleted file mode 100644 index 9634d17f6f..0000000000 --- a/cluster/lib/BUILD +++ /dev/null @@ -1,25 +0,0 @@ -sh_library( - name = "lib", - srcs = [ - "logging.sh", - ], - visibility = [ - "//build/visible_to:COMMON_testing", - "//build/visible_to:cluster", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], - visibility = [ - "//build/visible_to:cluster", - ], -) diff --git a/hack/generate-bindata.sh b/hack/generate-bindata.sh index 40605fb419..6d2ec0a5d7 100755 --- a/hack/generate-bindata.sh +++ b/hack/generate-bindata.sh @@ -22,7 +22,7 @@ if [[ -z "${KUBE_ROOT:-}" ]]; then KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. fi -source "${KUBE_ROOT}/cluster/lib/logging.sh" +source "${KUBE_ROOT}/hack/lib/logging.sh" if [[ ! -d "${KUBE_ROOT}/examples" ]]; then echo "${KUBE_ROOT}/examples not detected. This script should be run from a location where the source dirs are available." diff --git a/hack/lib/BUILD b/hack/lib/BUILD index 4c3122fb09..bfce52eb23 100644 --- a/hack/lib/BUILD +++ b/hack/lib/BUILD @@ -6,14 +6,12 @@ sh_library( "etcd.sh", "golang.sh", "init.sh", + "logging.sh", "swagger.sh", "test.sh", "util.sh", "version.sh", ], - deps = [ - "//cluster/lib", - ], ) filegroup( diff --git a/hack/lib/init.sh b/hack/lib/init.sh index cbff854137..d141d168c7 100755 --- a/hack/lib/init.sh +++ b/hack/lib/init.sh @@ -37,7 +37,7 @@ export no_proxy=127.0.0.1,localhost THIS_PLATFORM_BIN="${KUBE_ROOT}/_output/bin" source "${KUBE_ROOT}/hack/lib/util.sh" -source "${KUBE_ROOT}/cluster/lib/logging.sh" +source "${KUBE_ROOT}/hack/lib/logging.sh" kube::log::install_errexit diff --git a/cluster/lib/logging.sh b/hack/lib/logging.sh similarity index 100% rename from cluster/lib/logging.sh rename to hack/lib/logging.sh diff --git a/test/e2e_node/gubernator.sh b/test/e2e_node/gubernator.sh index 6a41900c81..97f3da8ce3 100755 --- a/test/e2e_node/gubernator.sh +++ b/test/e2e_node/gubernator.sh @@ -22,7 +22,7 @@ set -o errexit set -o nounset set -o pipefail -source cluster/lib/logging.sh +source hack/lib/logging.sh if [[ $# -eq 0 || ! $1 =~ ^[Yy]$ ]]; then