Merge pull request #25125 from colhom/federation-e2e

e2e tests for federated-apiserver
This commit is contained in:
Alex Mohr
2016-05-26 10:40:30 -07:00
34 changed files with 926 additions and 48 deletions

View File

@@ -98,6 +98,7 @@ kube::build::get_docker_wrapped_binaries() {
kube-controller-manager,busybox
kube-scheduler,busybox
kube-proxy,gcr.io/google_containers/debian-iptables-amd64:v3
federation-apiserver,busybox
);;
"arm")
local targets=(
@@ -105,6 +106,7 @@ kube::build::get_docker_wrapped_binaries() {
kube-controller-manager,armel/busybox
kube-scheduler,armel/busybox
kube-proxy,gcr.io/google_containers/debian-iptables-arm:v3
federation-apiserver,armel/busybox
);;
"arm64")
local targets=(
@@ -112,6 +114,7 @@ kube::build::get_docker_wrapped_binaries() {
kube-controller-manager,aarch64/busybox
kube-scheduler,aarch64/busybox
kube-proxy,gcr.io/google_containers/debian-iptables-arm64:v3
federation-apiserver,aarch64/busybox
);;
"ppc64le")
local targets=(
@@ -119,6 +122,7 @@ kube::build::get_docker_wrapped_binaries() {
kube-controller-manager,ppc64le/busybox
kube-scheduler,ppc64le/busybox
kube-proxy,gcr.io/google_containers/debian-iptables-ppc64le:v3
federation-apiserver,ppc64le/busybox
);;
esac
@@ -1002,6 +1006,11 @@ function kube::release::package_full_tarball() {
mkdir -p "${release_stage}/third_party"
cp -R "${KUBE_ROOT}/third_party/htpasswd" "${release_stage}/third_party/htpasswd"
# Include only federation/cluster and federation/manifests
mkdir "${release_stage}/federation"
cp -R "${KUBE_ROOT}/federation/cluster" "${release_stage}/federation/"
cp -R "${KUBE_ROOT}/federation/manifests" "${release_stage}/federation/"
cp -R "${KUBE_ROOT}/examples" "${release_stage}/"
cp -R "${KUBE_ROOT}/docs" "${release_stage}/"
cp "${KUBE_ROOT}/README.md" "${release_stage}/"

View File

@@ -20,20 +20,10 @@ set -o errexit
set -o nounset
set -o pipefail
# TODO(zmerlynn): Blech, this belongs in build/common.sh, probably,
# but common.sh sets up its readonly variables when its sourced, so
# there's a chicken/egg issue getting it there and using it for
# KUBE_GCE_RELEASE_PREFIX.
function kube::release::semantic_version() {
# This takes:
# Client Version: version.Info{Major:"1", Minor:"1+", GitVersion:"v1.1.0-alpha.0.2328+3c0a05de4a38e3", GitCommit:"3c0a05de4a38e355d147dbfb4d85bad6d2d73bb9", GitTreeState:"clean"}
# and spits back the GitVersion piece in a way that is somewhat
# resilient to the other fields changing (we hope)
${KUBE_ROOT}/cluster/kubectl.sh version -c | sed "s/, */\\
/g" | egrep "^GitVersion:" | cut -f2 -d: | cut -f2 -d\"
}
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
source "${KUBE_ROOT}/build/util.sh"
LATEST=$(kube::release::semantic_version)
KUBE_GCS_NO_CACHING='n'
@@ -44,7 +34,7 @@ KUBE_GCS_DELETE_EXISTING='y'
KUBE_GCS_RELEASE_PREFIX="ci/${LATEST}"
KUBE_GCS_PUBLISH_VERSION="${LATEST}"
source "$KUBE_ROOT/build/common.sh"
source "${KUBE_ROOT}/build/common.sh"
MAX_ATTEMPTS=3
attempt=0
@@ -53,4 +43,13 @@ while [[ ${attempt} -lt ${MAX_ATTEMPTS} ]]; do
attempt=$((attempt + 1))
sleep 5
done
[[ ${attempt} -lt ${MAX_ATTEMPTS} ]] || exit 1
if [[ ! ${attempt} -lt ${MAX_ATTEMPTS} ]];then
kube::log::error "Max attempts reached. Will exit."
exit 1
fi
if [[ "${FEDERATION:-}" == "true" ]];then
source "${KUBE_ROOT}/federation/cluster/common.sh"
# Docker compatiblity
FEDERATION_IMAGE_TAG="$(kube::release::semantic_image_tag_version)" push-federated-images
fi

View File

@@ -37,6 +37,14 @@ if [[ $KUBE_RELEASE_RUN_TESTS =~ ^[yY]$ ]]; then
kube::build::run_build_command hack/test-integration.sh
fi
if [[ "${FEDERATION:-}" == "true" ]];then
(
source "${KUBE_ROOT}/build/util.sh"
# Write federated docker image tag to workspace
kube::release::semantic_image_tag_version > "${KUBE_ROOT}/federation/manifests/federated-image.tag"
)
fi
kube::build::copy_output
kube::release::package_tarballs
kube::release::package_hyperkube

32
build/util.sh Normal file
View File

@@ -0,0 +1,32 @@
#!/bin/bash
# Copyright 2016 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Common utility functions for build scripts
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
function kube::release::semantic_version() {
# This takes:
# Client Version: version.Info{Major:"1", Minor:"1+", GitVersion:"v1.1.0-alpha.0.2328+3c0a05de4a38e3", GitCommit:"3c0a05de4a38e355d147dbfb4d85bad6d2d73bb9", GitTreeState:"clean"}
# and spits back the GitVersion piece in a way that is somewhat
# resilient to the other fields changing (we hope)
${KUBE_ROOT}/cluster/kubectl.sh version -c | sed "s/, */\\
/g" | egrep "^GitVersion:" | cut -f2 -d: | cut -f2 -d\"
}
function kube::release::semantic_image_tag_version() {
printf "$(kube::release::semantic_version)" | tr + _
}