Bumping k8s dependencies to 1.13
This commit is contained in:
21
vendor/k8s.io/kubernetes/hack/lib/etcd.sh
generated
vendored
21
vendor/k8s.io/kubernetes/hack/lib/etcd.sh
generated
vendored
@@ -16,14 +16,16 @@
|
||||
|
||||
# A set of helpers for starting/running etcd for tests
|
||||
|
||||
ETCD_VERSION=${ETCD_VERSION:-3.2.18}
|
||||
ETCD_VERSION=${ETCD_VERSION:-3.2.24}
|
||||
ETCD_HOST=${ETCD_HOST:-127.0.0.1}
|
||||
ETCD_PORT=${ETCD_PORT:-2379}
|
||||
export KUBE_INTEGRATION_ETCD_URL="http://${ETCD_HOST}:${ETCD_PORT}"
|
||||
|
||||
kube::etcd::validate() {
|
||||
# validate if in path
|
||||
command -v etcd >/dev/null || {
|
||||
kube::log::usage "etcd must be in your PATH"
|
||||
kube::log::info "You can use 'hack/install-etcd.sh' to install a copy in third_party/."
|
||||
exit 1
|
||||
}
|
||||
|
||||
@@ -71,15 +73,15 @@ kube::etcd::start() {
|
||||
if [[ -d "${ARTIFACTS_DIR:-}" ]]; then
|
||||
ETCD_LOGFILE="${ARTIFACTS_DIR}/etcd.$(uname -n).$(id -un).log.DEBUG.$(date +%Y%m%d-%H%M%S).$$"
|
||||
else
|
||||
ETCD_LOGFILE=/dev/null
|
||||
ETCD_LOGFILE=${ETCD_LOGFILE:-"/dev/null"}
|
||||
fi
|
||||
kube::log::info "etcd --advertise-client-urls http://${ETCD_HOST}:${ETCD_PORT} --data-dir ${ETCD_DIR} --listen-client-urls http://${ETCD_HOST}:${ETCD_PORT} --debug > \"${ETCD_LOGFILE}\" 2>/dev/null"
|
||||
etcd --advertise-client-urls http://${ETCD_HOST}:${ETCD_PORT} --data-dir ${ETCD_DIR} --listen-client-urls http://${ETCD_HOST}:${ETCD_PORT} --debug 2> "${ETCD_LOGFILE}" >/dev/null &
|
||||
kube::log::info "etcd --advertise-client-urls ${KUBE_INTEGRATION_ETCD_URL} --data-dir ${ETCD_DIR} --listen-client-urls http://${ETCD_HOST}:${ETCD_PORT} --debug > \"${ETCD_LOGFILE}\" 2>/dev/null"
|
||||
etcd --advertise-client-urls ${KUBE_INTEGRATION_ETCD_URL} --data-dir ${ETCD_DIR} --listen-client-urls ${KUBE_INTEGRATION_ETCD_URL} --debug 2> "${ETCD_LOGFILE}" >/dev/null &
|
||||
ETCD_PID=$!
|
||||
|
||||
echo "Waiting for etcd to come up."
|
||||
kube::util::wait_for_url "http://${ETCD_HOST}:${ETCD_PORT}/v2/machines" "etcd: " 0.25 80
|
||||
curl -fs -X PUT "http://${ETCD_HOST}:${ETCD_PORT}/v2/keys/_test"
|
||||
kube::util::wait_for_url "${KUBE_INTEGRATION_ETCD_URL}/v2/machines" "etcd: " 0.25 80
|
||||
curl -fs -X PUT "${KUBE_INTEGRATION_ETCD_URL}/v2/keys/_test"
|
||||
}
|
||||
|
||||
kube::etcd::stop() {
|
||||
@@ -102,11 +104,13 @@ kube::etcd::cleanup() {
|
||||
|
||||
kube::etcd::install() {
|
||||
(
|
||||
local os
|
||||
cd "${KUBE_ROOT}/third_party"
|
||||
if [[ $(readlink etcd) == etcd-v${ETCD_VERSION}-* ]]; then
|
||||
os=$(uname | tr "[:upper:]" "[:lower:]")
|
||||
if [[ $(readlink etcd) == etcd-v${ETCD_VERSION}-${os}-* ]]; then
|
||||
return # already installed
|
||||
fi
|
||||
if [[ $(uname) == "Darwin" ]]; then
|
||||
if [[ ${os} == "darwin" ]]; then
|
||||
download_file="etcd-v${ETCD_VERSION}-darwin-amd64.zip"
|
||||
url="https://github.com/coreos/etcd/releases/download/v${ETCD_VERSION}/${download_file}"
|
||||
kube::util::download_file "${url}" "${download_file}"
|
||||
@@ -119,6 +123,7 @@ kube::etcd::install() {
|
||||
kube::util::download_file "${url}" "${download_file}"
|
||||
tar xzf "${download_file}"
|
||||
ln -fns "etcd-v${ETCD_VERSION}-linux-amd64" etcd
|
||||
rm "${download_file}"
|
||||
fi
|
||||
kube::log::info "etcd v${ETCD_VERSION} installed. To use:"
|
||||
kube::log::info "export PATH=$(pwd)/etcd:\${PATH}"
|
||||
|
153
vendor/k8s.io/kubernetes/hack/lib/golang.sh
generated
vendored
153
vendor/k8s.io/kubernetes/hack/lib/golang.sh
generated
vendored
@@ -30,7 +30,6 @@ kube::golang::server_targets() {
|
||||
cmd/kubeadm
|
||||
cmd/hyperkube
|
||||
cmd/kube-scheduler
|
||||
vendor/k8s.io/kube-aggregator
|
||||
vendor/k8s.io/apiextensions-apiserver
|
||||
cluster/gce/gci/mounter
|
||||
)
|
||||
@@ -41,6 +40,23 @@ IFS=" " read -ra KUBE_SERVER_TARGETS <<< "$(kube::golang::server_targets)"
|
||||
readonly KUBE_SERVER_TARGETS
|
||||
readonly KUBE_SERVER_BINARIES=("${KUBE_SERVER_TARGETS[@]##*/}")
|
||||
|
||||
# The set of server targets we build docker images for
|
||||
kube::golang::server_image_targets() {
|
||||
# NOTE: this contains cmd targets for kube::build::get_docker_wrapped_binaries
|
||||
local targets=(
|
||||
cmd/cloud-controller-manager
|
||||
cmd/kube-apiserver
|
||||
cmd/kube-controller-manager
|
||||
cmd/kube-scheduler
|
||||
cmd/kube-proxy
|
||||
)
|
||||
echo "${targets[@]}"
|
||||
}
|
||||
|
||||
IFS=" " read -ra KUBE_SERVER_IMAGE_TARGETS <<< "$(kube::golang::server_image_targets)"
|
||||
readonly KUBE_SERVER_IMAGE_TARGETS
|
||||
readonly KUBE_SERVER_IMAGE_BINARIES=("${KUBE_SERVER_IMAGE_TARGETS[@]##*/}")
|
||||
|
||||
# The set of server targets that we are only building for Kubernetes nodes
|
||||
# If you update this list, please also update build/BUILD.
|
||||
kube::golang::node_targets() {
|
||||
@@ -208,11 +224,19 @@ readonly KUBE_STATIC_LIBRARIES=(
|
||||
kube-controller-manager
|
||||
kube-scheduler
|
||||
kube-proxy
|
||||
kube-aggregator
|
||||
kubeadm
|
||||
kubectl
|
||||
)
|
||||
|
||||
# Fully-qualified package names that we want to instrument for coverage information.
|
||||
readonly KUBE_COVERAGE_INSTRUMENTED_PACKAGES=(
|
||||
k8s.io/kubernetes/cmd/kube-apiserver
|
||||
k8s.io/kubernetes/cmd/kube-controller-manager
|
||||
k8s.io/kubernetes/cmd/kube-scheduler
|
||||
k8s.io/kubernetes/cmd/kube-proxy
|
||||
k8s.io/kubernetes/cmd/kubelet
|
||||
)
|
||||
|
||||
# KUBE_CGO_OVERRIDES is a space-separated list of binaries which should be built
|
||||
# with CGO enabled, assuming CGO is supported on the target platform.
|
||||
# This overrides any entry in KUBE_STATIC_LIBRARIES.
|
||||
@@ -443,6 +467,100 @@ kube::golang::outfile_for_binary() {
|
||||
echo "${output_path}/${bin}"
|
||||
}
|
||||
|
||||
# Argument: the name of a Kubernetes package.
|
||||
# Returns 0 if the binary can be built with coverage, 1 otherwise.
|
||||
# NB: this ignores whether coverage is globally enabled or not.
|
||||
kube::golang::is_instrumented_package() {
|
||||
return $(kube::util::array_contains "$1" "${KUBE_COVERAGE_INSTRUMENTED_PACKAGES[@]}")
|
||||
}
|
||||
|
||||
# Argument: the name of a Kubernetes package (e.g. k8s.io/kubernetes/cmd/kube-scheduler)
|
||||
# Echos the path to a dummy test used for coverage information.
|
||||
kube::golang::path_for_coverage_dummy_test() {
|
||||
local package="$1"
|
||||
local path="${KUBE_GOPATH}/src/${package}"
|
||||
local name=$(basename "${package}")
|
||||
echo "$path/zz_generated_${name}_test.go"
|
||||
}
|
||||
|
||||
# Argument: the name of a Kubernetes package (e.g. k8s.io/kubernetes/cmd/kube-scheduler).
|
||||
# Creates a dummy unit test on disk in the source directory for the given package.
|
||||
# This unit test will invoke the package's standard entry point when run.
|
||||
kube::golang::create_coverage_dummy_test() {
|
||||
local package="$1"
|
||||
local name="$(basename "${package}")"
|
||||
cat <<EOF > $(kube::golang::path_for_coverage_dummy_test "${package}")
|
||||
package main
|
||||
import (
|
||||
"testing"
|
||||
"k8s.io/kubernetes/pkg/util/coverage"
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
// Get coverage running
|
||||
coverage.InitCoverage("${name}")
|
||||
|
||||
// Go!
|
||||
main()
|
||||
|
||||
// Make sure we actually write the profiling information to disk, if we make it here.
|
||||
// On long-running services, or anything that calls os.Exit(), this is insufficient,
|
||||
// so we also flush periodically with a default period of five seconds (configurable by
|
||||
// the KUBE_COVERAGE_FLUSH_INTERVAL environment variable).
|
||||
coverage.FlushCoverage()
|
||||
}
|
||||
EOF
|
||||
}
|
||||
|
||||
# Argument: the name of a Kubernetes package (e.g. k8s.io/kubernetes/cmd/kube-scheduler).
|
||||
# Deletes a test generated by kube::golang::create_coverage_dummy_test.
|
||||
# It is not an error to call this for a nonexistent test.
|
||||
kube::golang::delete_coverage_dummy_test() {
|
||||
local package="$1"
|
||||
rm -f $(kube::golang::path_for_coverage_dummy_test "${package}")
|
||||
}
|
||||
|
||||
# Arguments: a list of kubernetes packages to build.
|
||||
# Expected variables: ${build_args} should be set to an array of Go build arguments.
|
||||
# In addition, ${package} and ${platform} should have been set earlier, and if
|
||||
# ${build_with_coverage} is set, coverage instrumentation will be enabled.
|
||||
#
|
||||
# Invokes Go to actually build some packages. If coverage is disabled, simply invokes
|
||||
# go install. If coverage is enabled, builds covered binaries using go test, temporarily
|
||||
# producing the required unit test files and then cleaning up after itself.
|
||||
# Non-covered binaries are then built using go install as usual.
|
||||
kube::golang::build_some_binaries() {
|
||||
if [[ -n "${build_with_coverage:-}" ]]; then
|
||||
local -a uncovered=()
|
||||
for package in "$@"; do
|
||||
if kube::golang::is_instrumented_package "${package}"; then
|
||||
V=2 kube::log::info "Building ${package} with coverage..."
|
||||
|
||||
kube::golang::create_coverage_dummy_test "${package}"
|
||||
kube::util::trap_add "kube::golang::delete_coverage_dummy_test \"${package}\"" EXIT
|
||||
|
||||
go test -c -o "$(kube::golang::outfile_for_binary "${package}" "${platform}")" \
|
||||
-covermode count \
|
||||
-coverpkg k8s.io/... \
|
||||
"${build_args[@]}" \
|
||||
-tags coverage \
|
||||
"${package}"
|
||||
else
|
||||
uncovered+=("${package}")
|
||||
fi
|
||||
done
|
||||
if [[ "${#uncovered[@]}" != 0 ]]; then
|
||||
V=2 kube::log::info "Building ${uncovered[@]} without coverage..."
|
||||
go install "${build_args[@]}" "${uncovered[@]}"
|
||||
else
|
||||
V=2 kube::log::info "Nothing to build without coverage."
|
||||
fi
|
||||
else
|
||||
V=2 kube::log::info "Coverage is disabled."
|
||||
go install "${build_args[@]}" "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
kube::golang::build_binaries_for_platform() {
|
||||
local platform=$1
|
||||
|
||||
@@ -462,18 +580,24 @@ kube::golang::build_binaries_for_platform() {
|
||||
fi
|
||||
done
|
||||
|
||||
local -a build_args
|
||||
if [[ "${#statics[@]}" != 0 ]]; then
|
||||
CGO_ENABLED=0 go install -installsuffix static "${goflags[@]:+${goflags[@]}}" \
|
||||
-gcflags "${gogcflags}" \
|
||||
-ldflags "${goldflags}" \
|
||||
"${statics[@]:+${statics[@]}}"
|
||||
build_args=(
|
||||
-installsuffix static
|
||||
${goflags:+"${goflags[@]}"}
|
||||
-gcflags "${gogcflags:-}"
|
||||
-ldflags "${goldflags:-}"
|
||||
)
|
||||
CGO_ENABLED=0 kube::golang::build_some_binaries "${statics[@]}"
|
||||
fi
|
||||
|
||||
if [[ "${#nonstatics[@]}" != 0 ]]; then
|
||||
go install "${goflags[@]:+${goflags[@]}}" \
|
||||
-gcflags "${gogcflags}" \
|
||||
-ldflags "${goldflags}" \
|
||||
"${nonstatics[@]:+${nonstatics[@]}}"
|
||||
build_args=(
|
||||
${goflags:+"${goflags[@]}"}
|
||||
-gcflags "${gogcflags:-}"
|
||||
-ldflags "${goldflags:-}"
|
||||
)
|
||||
kube::golang::build_some_binaries "${nonstatics[@]}"
|
||||
fi
|
||||
|
||||
for test in "${tests[@]:+${tests[@]}}"; do
|
||||
@@ -482,9 +606,9 @@ kube::golang::build_binaries_for_platform() {
|
||||
|
||||
mkdir -p "$(dirname ${outfile})"
|
||||
go test -c \
|
||||
"${goflags[@]:+${goflags[@]}}" \
|
||||
-gcflags "${gogcflags}" \
|
||||
-ldflags "${goldflags}" \
|
||||
${goflags:+"${goflags[@]}"} \
|
||||
-gcflags "${gogcflags:-}" \
|
||||
-ldflags "${goldflags:-}" \
|
||||
-o "${outfile}" \
|
||||
"${testpkg}"
|
||||
done
|
||||
@@ -537,10 +661,11 @@ kube::golang::build_binaries() {
|
||||
host_platform=$(kube::golang::host_platform)
|
||||
|
||||
# Use eval to preserve embedded quoted strings.
|
||||
local goflags goldflags gogcflags
|
||||
local goflags goldflags gogcflags build_with_coverage
|
||||
eval "goflags=(${GOFLAGS:-})"
|
||||
goldflags="${GOLDFLAGS:-} $(kube::version::ldflags)"
|
||||
gogcflags="${GOGCFLAGS:-}"
|
||||
build_with_coverage="${KUBE_BUILD_WITH_COVERAGE:-}"
|
||||
|
||||
local -a targets=()
|
||||
local arg
|
||||
|
3
vendor/k8s.io/kubernetes/hack/lib/init.sh
generated
vendored
3
vendor/k8s.io/kubernetes/hack/lib/init.sh
generated
vendored
@@ -68,10 +68,12 @@ authorization.k8s.io/v1 \
|
||||
authorization.k8s.io/v1beta1 \
|
||||
autoscaling/v1 \
|
||||
autoscaling/v2beta1 \
|
||||
autoscaling/v2beta2 \
|
||||
batch/v1 \
|
||||
batch/v1beta1 \
|
||||
batch/v2alpha1 \
|
||||
certificates.k8s.io/v1beta1 \
|
||||
coordination.k8s.io/v1beta1 \
|
||||
extensions/v1beta1 \
|
||||
events.k8s.io/v1beta1 \
|
||||
imagepolicy.k8s.io/v1alpha1 \
|
||||
@@ -178,4 +180,3 @@ kube::realpath() {
|
||||
fi
|
||||
kube::readlinkdashf "$1"
|
||||
}
|
||||
|
||||
|
21
vendor/k8s.io/kubernetes/hack/lib/util.sh
generated
vendored
21
vendor/k8s.io/kubernetes/hack/lib/util.sh
generated
vendored
@@ -18,6 +18,20 @@ kube::util::sortable_date() {
|
||||
date "+%Y%m%d-%H%M%S"
|
||||
}
|
||||
|
||||
# arguments: target, item1, item2, item3, ...
|
||||
# returns 0 if target is in the given items, 1 otherwise.
|
||||
kube::util::array_contains() {
|
||||
local search="$1"
|
||||
local element
|
||||
shift
|
||||
for element; do
|
||||
if [[ "${element}" == "${search}" ]]; then
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
kube::util::wait_for_url() {
|
||||
local url=$1
|
||||
local prefix=${2:-}
|
||||
@@ -308,7 +322,7 @@ kube::util::gv-to-swagger-name() {
|
||||
# Assumed vars:
|
||||
# SWAGGER_API_PATH: Base path for swaggerapi on apiserver. Ex:
|
||||
# http://localhost:8080/swaggerapi.
|
||||
# SWAGGER_ROOT_DIR: Root dir where we want to to save the fetched spec.
|
||||
# SWAGGER_ROOT_DIR: Root dir where we want to save the fetched spec.
|
||||
# VERSIONS: Array of group versions to include in swagger spec.
|
||||
kube::util::fetch-swagger-spec() {
|
||||
for ver in ${VERSIONS}; do
|
||||
@@ -435,7 +449,7 @@ kube::util::ensure_godep_version() {
|
||||
fi
|
||||
|
||||
kube::log::status "Installing godep version ${GODEP_VERSION}"
|
||||
go install ./vendor/github.com/tools/godep/
|
||||
go install k8s.io/kubernetes/vendor/github.com/tools/godep/
|
||||
if ! which godep >/dev/null 2>&1; then
|
||||
kube::log::error "Can't find godep - is your GOPATH 'bin' in your PATH?"
|
||||
kube::log::error " GOPATH: ${GOPATH}"
|
||||
@@ -540,6 +554,7 @@ function kube::util::test_openssl_installed {
|
||||
echo "Failed to run openssl. Please ensure openssl is installed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
OPENSSL_BIN=$(command -v openssl)
|
||||
}
|
||||
|
||||
@@ -787,6 +802,8 @@ if [[ -z "${color_start-}" ]]; then
|
||||
declare -r color_red="${color_start}0;31m"
|
||||
declare -r color_yellow="${color_start}0;33m"
|
||||
declare -r color_green="${color_start}0;32m"
|
||||
declare -r color_blue="${color_start}1;34m"
|
||||
declare -r color_cyan="${color_start}1;36m"
|
||||
declare -r color_norm="${color_start}0m"
|
||||
fi
|
||||
|
||||
|
Reference in New Issue
Block a user