diff --git a/.gitattributes b/.gitattributes index 0bf66f3ab5..ca340357b8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7,4 +7,3 @@ test/test_owners.csv merge=union **/generated.proto -diff **/types_swagger_doc_generated.go -diff docs/api-reference/** -diff -federation/docs/api-reference/** -diff diff --git a/api/openapi-spec/swagger.json b/api/openapi-spec/swagger.json index 387a252409..b6f08c8888 100644 --- a/api/openapi-spec/swagger.json +++ b/api/openapi-spec/swagger.json @@ -74546,11 +74546,6 @@ "kind": "DeleteOptions", "version": "v1beta1" }, - { - "group": "federation", - "kind": "DeleteOptions", - "version": "v1beta1" - }, { "group": "imagepolicy.k8s.io", "kind": "DeleteOptions", @@ -75065,11 +75060,6 @@ "kind": "WatchEvent", "version": "v1beta1" }, - { - "group": "federation", - "kind": "WatchEvent", - "version": "v1beta1" - }, { "group": "imagepolicy.k8s.io", "kind": "WatchEvent", diff --git a/build/BUILD b/build/BUILD index 0864c9cdd0..aa6efab3d4 100644 --- a/build/BUILD +++ b/build/BUILD @@ -103,7 +103,6 @@ release_filegroup( name = "client-targets", srcs = [ "//cmd/kubectl", - "//federation/cmd/kubefed", ], ) @@ -143,7 +142,6 @@ filegroup( "//cmd/genyaml", "//cmd/kubemark", # TODO: server platforms only "//cmd/linkcheck", - "//federation/cmd/genfeddocs", "//test/e2e:e2e.test", "//test/e2e_node:e2e_node.test", # TODO: server platforms only "//vendor/github.com/onsi/ginkgo/ginkgo", @@ -154,9 +152,7 @@ filegroup( filegroup( name = "test-portable-targets", srcs = [ - "//federation/develop:all-srcs", "//hack:e2e.go", - "//hack:federated-ginkgo-e2e.sh", "//hack:get-build.sh", "//hack:ginkgo-e2e.sh", "//hack/e2e-internal:all-srcs", diff --git a/build/lib/release.sh b/build/lib/release.sh index d0a0464ab9..d2881ec0cb 100644 --- a/build/lib/release.sh +++ b/build/lib/release.sh @@ -503,11 +503,6 @@ EOF mkdir -p "${release_stage}/third_party" cp -R "${KUBE_ROOT}/third_party/htpasswd" "${release_stage}/third_party/htpasswd" - # Include only federation/cluster and federation/deploy - mkdir "${release_stage}/federation" - cp -R "${KUBE_ROOT}/federation/cluster" "${release_stage}/federation/" - cp -R "${KUBE_ROOT}/federation/deploy" "${release_stage}/federation/" - # Include hack/lib as a dependency for the cluster/ scripts mkdir -p "${release_stage}/hack" cp -R "${KUBE_ROOT}/hack/lib" "${release_stage}/hack/" diff --git a/build/release-tars/BUILD b/build/release-tars/BUILD index 0d09ffcccf..4b84a6246f 100644 --- a/build/release-tars/BUILD +++ b/build/release-tars/BUILD @@ -193,7 +193,6 @@ pkg_tar( strip_prefix = "//", deps = [ ":_full_server", - "//federation:release", ], ) diff --git a/build/root/BUILD.root b/build/root/BUILD.root index a56e731655..5b162716fc 100644 --- a/build/root/BUILD.root +++ b/build/root/BUILD.root @@ -63,7 +63,6 @@ filegroup( "//cmd:all-srcs", "//docs:all-srcs", "//examples:all-srcs", - "//federation:all-srcs", "//hack:all-srcs", "//pkg:all-srcs", "//plugin:all-srcs", diff --git a/build/root/Makefile b/build/root/Makefile index e39c505321..76c8af23d9 100644 --- a/build/root/Makefile +++ b/build/root/Makefile @@ -291,7 +291,6 @@ else test-cmd: generated_files hack/make-rules/test-kubeadm-cmd.sh hack/make-rules/test-cmd.sh - hack/make-rules/test-federation-cmd.sh endif define CLEAN_HELP_INFO @@ -482,21 +481,6 @@ $(notdir $(abspath $(wildcard plugin/cmd/*/))): generated_files hack/make-rules/build.sh plugin/cmd/$@ endif -define FED_CMD_HELP_INFO -# Add rules for all directories in federation/cmd/ -# -# Example: -# make federation-apiserver federation-controller-manager -endef -.PHONY: $(notdir $(abspath $(wildcard federation/cmd/*/))) -ifeq ($(PRINT_HELP),y) -$(notdir $(abspath $(wildcard federation/cmd/*/))): - @echo "$$FED_CMD_HELP_INFO" -else -$(notdir $(abspath $(wildcard federation/cmd/*/))): generated_files - hack/make-rules/build.sh federation/cmd/$@ -endif - define GENERATED_FILES_HELP_INFO # Produce auto-generated files needed for the build. # diff --git a/build/visible_to/BUILD b/build/visible_to/BUILD index 50c4a1c79d..6963f4960f 100644 --- a/build/visible_to/BUILD +++ b/build/visible_to/BUILD @@ -50,18 +50,6 @@ package_group( ], ) -package_group( - name = "FEDERATION_BAD", - packages = [ - "//federation/cmd/genfeddocs", - "//federation/cmd/kubefed/app", - "//federation/pkg/kubefed", - "//federation/pkg/kubefed/init", - "//federation/pkg/kubefed/testing", - "//federation/pkg/kubefed/util", - ], -) - package_group( name = "cluster", packages = [ @@ -93,7 +81,6 @@ package_group( package_group( name = "pkg_kubectl_CONSUMERS_BAD", includes = [ - ":FEDERATION_BAD", ":KUBEADM_BAD", ], packages = [ @@ -125,9 +112,6 @@ package_group( package_group( name = "pkg_kubectl_cmd_CONSUMERS_BAD", - includes = [ - ":FEDERATION_BAD", - ], packages = [ "//cmd/clicheck", "//cmd/hyperkube", @@ -178,19 +162,11 @@ package_group( ], ) -package_group( - name = "pkg_kubectl_cmd_templates_CONSUMERS_BAD", - packages = [ - "//federation/pkg/kubefed/init", - ], -) - package_group( name = "pkg_kubectl_cmd_templates_CONSUMERS", includes = [ ":COMMON_generators", ":COMMON_testing", - ":FEDERATION_BAD", ], packages = [ "//cmd/kubectl", @@ -213,19 +189,8 @@ package_group( ], ) -package_group( - name = "pkg_kubectl_cmd_testing_CONSUMERS_BAD", - packages = [ - "//federation/pkg/kubefed", - "//federation/pkg/kubefed/init", - ], -) - package_group( name = "pkg_kubectl_cmd_testing_CONSUMERS", - includes = [ - ":pkg_kubectl_cmd_testing_CONSUMERS_BAD", - ], packages = [ "//pkg/kubectl/cmd", "//pkg/kubectl/cmd/auth", @@ -236,7 +201,6 @@ package_group( package_group( name = "pkg_kubectl_cmd_util_CONSUMERS_BAD", includes = [ - ":FEDERATION_BAD", ":KUBEADM_BAD", ], packages = [ @@ -293,9 +257,6 @@ package_group( package_group( name = "pkg_kubectl_metricsutil_CONSUMERS_BAD", - includes = [ - ":FEDERATION_BAD", - ], packages = [ "//cmd/clicheck", "//cmd/hyperkube", @@ -316,19 +277,11 @@ package_group( ], ) -package_group( - name = "pkg_kubectl_resource_CONSUMERS_BAD", - packages = [ - "//federation/pkg/kubefed", - ], -) - package_group( name = "pkg_kubectl_resource_CONSUMERS", includes = [ ":COMMON_generators", ":COMMON_testing", - ":pkg_kubectl_resource_CONSUMERS_BAD", ], packages = [ "//cmd/kubectl", diff --git a/build/visible_to/README.md b/build/visible_to/README.md index 6f5e7cf537..9daa99a0fc 100644 --- a/build/visible_to/README.md +++ b/build/visible_to/README.md @@ -34,7 +34,7 @@ generally inhibit progress. one can specify the following visibility rule in any `BUILD` rule: ``` visibility = [ "//build/visible_to:database_CONSUMERS" ], - ``` + ``` * A visibility rule takes a list of package groups as its argument - or one of the pre-defined groups @@ -59,7 +59,7 @@ generally inhibit progress. * One set of `OWNERS` to manage visibility. The alternative is to use special [package literals] directly -in visibility rules, e.g. +in visibility rules, e.g. ``` visibility = [ @@ -114,7 +114,7 @@ visibility = ["//visible_to:client_foo,//visible_to:server_foo"], #### Quickly check for visibility violations ``` bazel build --check_visibility --nobuild \ - //cmd/... //pkg/... //federation/... //plugin/... \ + //cmd/... //pkg/... //plugin/... \ //third_party/... //examples/... //test/... //vendor/k8s.io/... ``` @@ -179,6 +179,6 @@ bazel query --nohost_deps --noimplicit_deps \ bazel query "somepath(cmd/kubectl:kubectl, pkg/util/parsers:go_default_library)" ``` - + [package literals]: https://bazel.build/versions/master/docs/be/common-definitions.html#common.visibility diff --git a/cluster/common.sh b/cluster/common.sh index 159e3809ec..51ee773f62 100755 --- a/cluster/common.sh +++ b/cluster/common.sh @@ -160,20 +160,6 @@ function clear-kubeconfig() { echo "Cleared config for ${CONTEXT} from ${KUBECONFIG}" } -# Creates a kubeconfig file with the credentials for only the current-context -# cluster. This is used by federation to create secrets in test setup. -function create-kubeconfig-for-federation() { - if [[ "${FEDERATION:-}" == "true" ]]; then - echo "creating kubeconfig for federation secret" - local kubectl="${KUBE_ROOT}/cluster/kubectl.sh" - local cc=$("${kubectl}" config view -o jsonpath='{.current-context}') - KUBECONFIG_DIR=$(dirname ${KUBECONFIG:-$DEFAULT_KUBECONFIG}) - KUBECONFIG_PATH="${KUBECONFIG_DIR}/federation/kubernetes-apiserver/${cc}" - mkdir -p "${KUBECONFIG_PATH}" - "${kubectl}" config view --minify --flatten > "${KUBECONFIG_PATH}/kubeconfig" - fi -} - function tear_down_alive_resources() { local kubectl="${KUBE_ROOT}/cluster/kubectl.sh" "${kubectl}" delete deployments --all || true @@ -946,17 +932,6 @@ AUTOSCALER_EXPANDER_CONFIG: $(yaml-quote ${AUTOSCALER_EXPANDER_CONFIG}) EOF fi - # Federation specific environment variables. - if [[ -n "${FEDERATION:-}" ]]; then - cat >>$file <>$file <>$file <&2 & - APISERVER_PID=$! - - kube::util::wait_for_url "http://127.0.0.1:${API_PORT}/healthz" "apiserver" -} - -function run_federation_controller_manager() { - kube::log::status "Building federation-controller-manager" - make -C "${KUBE_ROOT}" WHAT="federation/cmd/federation-controller-manager" - - # Create a kubeconfig for federation apiserver. - local kubeconfig="${KUBE_TEMP}/kubeconfig" - touch "${kubeconfig}" - kubectl config set-cluster "apiserver" --server="http://127.0.0.1:${API_PORT}" --insecure-skip-tls-verify=true --kubeconfig="${kubeconfig}" - kubectl config set-context "context" --cluster="apiserver" --kubeconfig="${kubeconfig}" - kubectl config use-context "context" --kubeconfig="${kubeconfig}" - - # Start controller manager - kube::log::status "Starting federation-controller-manager" - "${KUBE_OUTPUT_HOSTBIN}/federation-controller-manager" \ - --port="${CTLRMGR_PORT}" \ - --kubeconfig="${kubeconfig}" \ - --kube-api-content-type="${KUBE_TEST_API_TYPE-}" \ - --controllers="service-dns=false" \ - --master="127.0.0.1:${API_PORT}" 1>&2 & - CTLRMGR_PID=$! - - kube::util::wait_for_url "http://127.0.0.1:${CTLRMGR_PORT}/healthz" "controller-manager" -} - -kube::log::status "Running kubectl tests for federation-apiserver" - -setup -run_federation_apiserver -run_federation_controller_manager -# TODO: Fix for replicasets and deployments. -SUPPORTED_RESOURCES=("configmaps" "daemonsets" "events" "ingress" "namespaces" "services" "secrets") -# Set wait for deletion to true for federation apiserver since resources are -# deleted asynchronously. -# This is a temporary workaround until https://github.com/kubernetes/kubernetes/issues/42594 is fixed. -WAIT_FOR_DELETION="true" -# WARNING: Do not wrap this call in a subshell to capture output, e.g. output=$(runTests) -# Doing so will suppress errexit behavior inside runTests -runTests - -kube::log::status "TESTS PASSED" diff --git a/hack/make-rules/test-integration.sh b/hack/make-rules/test-integration.sh index 53804c37f1..c180f45e89 100755 --- a/hack/make-rules/test-integration.sh +++ b/hack/make-rules/test-integration.sh @@ -49,9 +49,6 @@ kube::test::find_integration_test_dirs() { find vendor/k8s.io/apiextensions-apiserver/test/integration/ -name '*_test.go' -print0 \ | xargs -0n1 dirname | sed "s|^|${KUBE_GO_PACKAGE}/|" \ | LC_ALL=C sort -u - find federation/test/integration/ -name '*_test.go' -print0 \ - | xargs -0n1 dirname | sed "s|^|${KUBE_GO_PACKAGE}/|" \ - | LC_ALL=C sort -u ) } diff --git a/hack/make-rules/test.sh b/hack/make-rules/test.sh index c7b5a1481a..54feeea8ea 100755 --- a/hack/make-rules/test.sh +++ b/hack/make-rules/test.sh @@ -61,7 +61,6 @@ kube::test::find_dirs() { -o -path './third_party/*' \ -o -path './staging/*' \ -o -path './vendor/*' \ - -o -path './federation/test/*' \ \) -prune \ \) -name '*_test.go' -print0 | xargs -0n1 dirname | sed "s|^\./|${KUBE_GO_PACKAGE}/|" | LC_ALL=C sort -u @@ -113,7 +112,7 @@ KUBE_GOVERALLS_BIN=${KUBE_GOVERALLS_BIN:-} # "v1,compute/v1alpha1,experimental/v1alpha2;v1,compute/v2,experimental/v1alpha3" # FIXME: due to current implementation of a test client (see: pkg/api/testapi/testapi.go) # ONLY the last version is tested in each group. -ALL_VERSIONS_CSV=$(IFS=',';echo "${KUBE_AVAILABLE_GROUP_VERSIONS[*]// /,}";IFS=$),federation/v1beta1 +ALL_VERSIONS_CSV=$(IFS=',';echo "${KUBE_AVAILABLE_GROUP_VERSIONS[*]// /,}";IFS=$) KUBE_TEST_API_VERSIONS="${KUBE_TEST_API_VERSIONS:-${ALL_VERSIONS_CSV}}" # once we have multiple group supports # Create a junit-style XML test report in this directory if set. diff --git a/hack/update-all.sh b/hack/update-all.sh index 7fbfeb84af..e62795e787 100755 --- a/hack/update-all.sh +++ b/hack/update-all.sh @@ -63,10 +63,6 @@ BASH_TARGETS=" update-swagger-spec update-openapi-spec update-api-reference-docs - update-federation-openapi-spec - update-federation-swagger-spec - update-federation-generated-swagger-docs - update-federation-api-reference-docs update-staging-godeps update-bazel" diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index e13f11d1b1..337eb1da00 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -61,14 +61,12 @@ GV_DIRS_CSV=$(IFS=',';echo "${GV_DIRS[*]// /,}";IFS=$) # update- and verify- scripts. ${clientgen} "$@" ${clientgen} --output-base "${KUBE_ROOT}/vendor" --clientset-path="k8s.io/client-go" --clientset-name="kubernetes" --input-base="k8s.io/kubernetes/vendor/k8s.io/api" --input="${GV_DIRS_CSV}" "$@" -# Clientgen for federation clientset. -${clientgen} --clientset-name=federation_clientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --input-base="k8s.io/kubernetes/vendor/k8s.io/api" --input="../../../federation/apis/federation/v1beta1","core/v1","extensions/v1beta1","batch/v1","autoscaling/v1" --included-types-overrides="core/v1/Service,core/v1/Namespace,extensions/v1beta1/ReplicaSet,core/v1/Secret,extensions/v1beta1/Ingress,extensions/v1beta1/Deployment,extensions/v1beta1/DaemonSet,core/v1/ConfigMap,core/v1/Event,batch/v1/Job,autoscaling/v1/HorizontalPodAutoscaler" "$@" listergen_internal_apis=( pkg/api $( cd ${KUBE_ROOT} - find pkg/apis -maxdepth 2 -name types.go | xargs -n1 dirname | sort + find pkg/apis -maxdepth 2 -name types.go | xargs -n1 dirname | sort ) ) listergen_internal_apis=(${listergen_internal_apis[@]/#/k8s.io/kubernetes/}) @@ -89,7 +87,7 @@ informergen_internal_apis=( pkg/api $( cd ${KUBE_ROOT} - find pkg/apis -maxdepth 2 -name types.go | xargs -n1 dirname | sort + find pkg/apis -maxdepth 2 -name types.go | xargs -n1 dirname | sort ) ) informergen_internal_apis=(${informergen_internal_apis[@]/#/k8s.io/kubernetes/}) diff --git a/hack/update-federation-api-reference-docs.sh b/hack/update-federation-api-reference-docs.sh deleted file mode 100755 index c4f7e6818f..0000000000 --- a/hack/update-federation-api-reference-docs.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash - -# Copyright 2016 The Kubernetes Authors. -# -# 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. - -# Generates updated api-reference docs from the latest swagger spec for -# federation apiserver. The docs are generated at federation/docs/api-reference -# Usage: ./update-federation-api-reference-docs.sh - -set -o errexit -set -o nounset -set -o pipefail - -echo "Note: This assumes that swagger spec has been updated. Please run hack/update-federation-swagger-spec.sh to ensure that." - -KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. -source "${KUBE_ROOT}/hack/lib/init.sh" -source "${KUBE_ROOT}/hack/lib/swagger.sh" -kube::golang::setup_env - -REPO_DIR=${REPO_DIR:-"${KUBE_ROOT}"} -DEFAULT_OUTPUT="${REPO_DIR}/federation/docs/api-reference" -OUTPUT=${1:-${DEFAULT_OUTPUT}} - -SWAGGER_SPEC_PATH="${REPO_DIR}/federation/apis/swagger-spec" - -GROUP_VERSIONS=("federation/v1beta1" "v1" "extensions/v1beta1") -GV_DIRS=() -for gv in "${GROUP_VERSIONS[@]}"; do - if [[ ${gv} == "federation/v1beta1" ]]; then - GV_DIRS+=("${REPO_DIR}/$(kube::util::group-version-to-pkg-path "${gv}")") - else - GV_DIRS+=("${REPO_DIR}/$(kube::util::group-version-to-pkg-path "${gv}")") - fi -done - -GROUP_VERSIONS="${GROUP_VERSIONS[@]}" GV_DIRS="${GV_DIRS[@]}" kube::swagger::gen_api_ref_docs "${SWAGGER_SPEC_PATH}" "${OUTPUT}" - -# ex: ts=2 sw=2 et filetype=sh diff --git a/hack/update-federation-generated-swagger-docs.sh b/hack/update-federation-generated-swagger-docs.sh deleted file mode 100755 index c6ff916bdc..0000000000 --- a/hack/update-federation-generated-swagger-docs.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -# Copyright 2016 The Kubernetes Authors. -# -# 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. - -# Generates `types_swagger_doc_generated.go` files for federation API group -# versions. That file contains functions on API structs that return the comments -# that should be surfaced for the corresponding API type in our API docs. - -set -o errexit -set -o nounset -set -o pipefail - -KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. -source "${KUBE_ROOT}/hack/lib/init.sh" -source "${KUBE_ROOT}/hack/lib/swagger.sh" - -kube::golang::setup_env - -GROUP_VERSIONS=(federation/v1beta1) -GV_DIRS=() -for gv in "${GROUP_VERSIONS[@]}"; do - GV_DIRS+=("$(kube::util::group-version-to-pkg-path "${gv}")") -done - -# To avoid compile errors, remove the currently existing files. -for gv_dir in "${GV_DIRS[@]}"; do - rm -f "${gv_dir}/types_swagger_doc_generated.go" -done -for i in "${!GROUP_VERSIONS[@]}"; do - kube::swagger::gen_types_swagger_doc "${GROUP_VERSIONS[i]}" "${GV_DIRS[i]}" -done diff --git a/hack/update-federation-openapi-spec.sh b/hack/update-federation-openapi-spec.sh deleted file mode 100755 index aa9d08981b..0000000000 --- a/hack/update-federation-openapi-spec.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash - -# Copyright 2015 The Kubernetes Authors. -# -# 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. - -# Script to fetch latest openapi spec from federation-apiserver -# Puts the updated spec at federation/apis/openapi-spec/ - -set -o errexit -set -o nounset -set -o pipefail - -KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. -OPENAPI_ROOT_DIR="${KUBE_ROOT}/federation/apis/openapi-spec" -source "${KUBE_ROOT}/hack/lib/init.sh" - -kube::golang::setup_env - -make -C "${KUBE_ROOT}" WHAT="cmd/hyperkube" - -function cleanup() -{ - [[ -n "${APISERVER_PID-}" ]] && kill ${APISERVER_PID} 1>&2 2>/dev/null - - kube::etcd::cleanup - - kube::log::status "Clean up complete" -} - -trap cleanup EXIT SIGINT - -kube::golang::setup_env - -TMP_DIR=$(mktemp -d /tmp/update-federation-openapi-spec.XXXX) -ETCD_HOST=${ETCD_HOST:-127.0.0.1} -ETCD_PORT=${ETCD_PORT:-2379} -API_PORT=${API_PORT:-8050} -API_HOST=${API_HOST:-127.0.0.1} - -kube::etcd::start - -echo "dummy_token,admin,admin" > $TMP_DIR/tokenauth.csv - -# Start federation-apiserver -kube::log::status "Starting federation-apiserver" -"${KUBE_OUTPUT_HOSTBIN}/hyperkube" federation-apiserver \ - --insecure-bind-address="${API_HOST}" \ - --bind-address="${API_HOST}" \ - --insecure-port="${API_PORT}" \ - --etcd-servers="http://${ETCD_HOST}:${ETCD_PORT}" \ - --advertise-address="10.10.10.10" \ - --cert-dir="${TMP_DIR}/certs" \ - --token-auth-file=$TMP_DIR/tokenauth.csv >/tmp/openapi-federation-api-server.log 2>&1 & -APISERVER_PID=$! -kube::util::wait_for_url "${API_HOST}:${API_PORT}/healthz" "apiserver: " - -kube::log::status "Updating " ${OPENAPI_ROOT_DIR} - -curl -w "\n" -fs "${API_HOST}:${API_PORT}/swagger.json" > "${OPENAPI_ROOT_DIR}/swagger.json" - -kube::log::status "SUCCESS" - -# ex: ts=2 sw=2 et filetype=sh diff --git a/hack/update-federation-swagger-spec.sh b/hack/update-federation-swagger-spec.sh deleted file mode 100755 index 7c46a2938a..0000000000 --- a/hack/update-federation-swagger-spec.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash - -# Copyright 2015 The Kubernetes Authors. -# -# 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. - -# Script to fetch latest swagger spec from federation-apiserver -# Puts the updated spec at federation/apis/swagger-spec/ - -set -o errexit -set -o nounset -set -o pipefail - -cat << __EOF__ -Note: This assumes that the 'types_swagger_doc_generated.go' file has been -updated for all API group versions. If you are unsure, please run -hack/update-generated-swagger-docs.sh and -hack/update-federation-generated-swagger-docs.sh first. -__EOF__ - -KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. -SWAGGER_ROOT_DIR="${KUBE_ROOT}/federation/apis/swagger-spec" -source "${KUBE_ROOT}/hack/lib/init.sh" - -kube::golang::setup_env - -make -C "${KUBE_ROOT}" WHAT="cmd/hyperkube" - -function cleanup() -{ - [[ -n ${APISERVER_PID-} ]] && kill ${APISERVER_PID} 1>&2 2>/dev/null - - kube::etcd::cleanup - - kube::log::status "Clean up complete" -} - -trap cleanup EXIT SIGINT - -kube::golang::setup_env - -TMP_DIR=$(mktemp -d /tmp/update-federation-swagger-spec.XXXX) -ETCD_HOST=${ETCD_HOST:-127.0.0.1} -ETCD_PORT=${ETCD_PORT:-2379} -API_PORT=${API_PORT:-8050} -API_HOST=${API_HOST:-127.0.0.1} - -kube::etcd::start - -# Start federation-apiserver -kube::log::status "Starting federation-apiserver" -"${KUBE_OUTPUT_HOSTBIN}/hyperkube" federation-apiserver \ - --insecure-bind-address="${API_HOST}" \ - --bind-address="${API_HOST}" \ - --insecure-port="${API_PORT}" \ - --etcd-servers="http://${ETCD_HOST}:${ETCD_PORT}" \ - --advertise-address="10.10.10.10" \ - --cert-dir="${TMP_DIR}/certs" >/tmp/swagger-federation-api-server.log 2>&1 & -APISERVER_PID=$! - -kube::util::wait_for_url "${API_HOST}:${API_PORT}/" "apiserver: " - -SWAGGER_API_PATH="${API_HOST}:${API_PORT}/swaggerapi/" -DEFAULT_GROUP_VERSIONS="v1 extensions/v1beta1 federation/v1beta1" -VERSIONS=${VERSIONS:-$DEFAULT_GROUP_VERSIONS} - -kube::log::status "Updating " ${SWAGGER_ROOT_DIR} - -SWAGGER_API_PATH="${SWAGGER_API_PATH}" SWAGGER_ROOT_DIR="${SWAGGER_ROOT_DIR}" VERSIONS="${VERSIONS}" kube::util::fetch-swagger-spec - -kube::log::status "SUCCESS" - -# ex: ts=2 sw=2 et filetype=sh diff --git a/hack/update-generated-docs.sh b/hack/update-generated-docs.sh index 38595ff71b..6d5ed939ff 100755 --- a/hack/update-generated-docs.sh +++ b/hack/update-generated-docs.sh @@ -32,7 +32,6 @@ BINS=( cmd/genkubedocs cmd/genman cmd/genyaml - federation/cmd/genfeddocs ) make -C "${KUBE_ROOT}" WHAT="${BINS[*]}" diff --git a/hack/update-generated-protobuf-dockerized.sh b/hack/update-generated-protobuf-dockerized.sh index 3ab8608b36..5b45586a1e 100755 --- a/hack/update-generated-protobuf-dockerized.sh +++ b/hack/update-generated-protobuf-dockerized.sh @@ -72,7 +72,6 @@ PACKAGES=( k8s.io/api/admissionregistration/v1alpha1 k8s.io/api/admission/v1alpha1 k8s.io/api/networking/v1 - k8s.io/kubernetes/federation/apis/federation/v1beta1 k8s.io/metrics/pkg/apis/metrics/v1alpha1 k8s.io/metrics/pkg/apis/metrics/v1beta1 k8s.io/metrics/pkg/apis/custom_metrics/v1beta1 diff --git a/hack/update-generated-swagger-docs.sh b/hack/update-generated-swagger-docs.sh index 44e5458bbc..20aef7fa0f 100755 --- a/hack/update-generated-swagger-docs.sh +++ b/hack/update-generated-swagger-docs.sh @@ -14,9 +14,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Generates `types_swagger_doc_generated.go` files for federation API group -# versions. That file contains functions on API structs that return the comments -# that should be surfaced for the corresponding API type in our API docs. +# Generates `types_swagger_doc_generated.go` files for API group +# versions. That file contains functions on API structs that return +# the comments that should be surfaced for the corresponding API type +# in our API docs. set -o errexit set -o nounset diff --git a/hack/verify-federation-api-reference-docs.sh b/hack/verify-federation-api-reference-docs.sh deleted file mode 100755 index 6cf951866e..0000000000 --- a/hack/verify-federation-api-reference-docs.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -# Copyright 2017 The Kubernetes Authors. -# -# 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. - -# Verifies that api reference docs are up to date. - -set -o errexit -set -o nounset -set -o pipefail - -KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. -source "${KUBE_ROOT}/hack/lib/init.sh" - -kube::golang::setup_env - -API_REFERENCE_DOCS_ROOT="${KUBE_ROOT}/federation/docs/api-reference" -OUTPUT_DIR="${KUBE_ROOT}/_tmp_federation/api-reference" -mkdir -p ${OUTPUT_DIR} -TMP_ROOT="${KUBE_ROOT}/_tmp_federation" -trap "rm -rf ${TMP_ROOT}" EXIT SIGINT - -# Generate API reference docs in tmp. -"./hack/update-federation-api-reference-docs.sh" "${OUTPUT_DIR}" - -echo "diffing ${API_REFERENCE_DOCS_ROOT} against freshly generated docs" -ret=0 -diff -NauprB -I 'Last update' --exclude=*.md "${API_REFERENCE_DOCS_ROOT}" "${OUTPUT_DIR}" || ret=$? -if [[ $ret -eq 0 ]] -then - echo "${API_REFERENCE_DOCS_ROOT} up to date." -else - echo "${API_REFERENCE_DOCS_ROOT} is out of date. Please run hack/update-federation-api-reference-docs.sh" - exit 1 -fi - -# ex: ts=2 sw=2 et filetype=sh diff --git a/hack/verify-federation-generated-swagger-docs.sh b/hack/verify-federation-generated-swagger-docs.sh deleted file mode 100755 index 36e25a970e..0000000000 --- a/hack/verify-federation-generated-swagger-docs.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash - -# Copyright 2017 The Kubernetes Authors. -# -# 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. - -set -o errexit -set -o nounset -set -o pipefail - -KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. -source "${KUBE_ROOT}/hack/lib/init.sh" - -kube::golang::setup_env - -make -C "${KUBE_ROOT}" WHAT=cmd/genswaggertypedocs - -# Find binary -genswaggertypedocs=$(kube::util::find-binary "genswaggertypedocs") - -if [[ ! -x "$genswaggertypedocs" ]]; then - { - echo "It looks as if you don't have a compiled genswaggertypedocs binary" - echo - echo "If you are running from a clone of the git repo, please run" - echo "'make WHAT=cmd/genswaggertypedocs'." - } >&2 - exit 1 -fi - -DIFFROOT="${KUBE_ROOT}/federation" -TMP_DIFFROOT="${KUBE_ROOT}/_tmp/federation" -_tmp="${KUBE_ROOT}/_tmp_federation" - -cleanup() { - rm -rf "${_tmp}" -} -trap "cleanup" EXIT SIGINT - -cleanup - -mkdir -p "${TMP_DIFFROOT}" -cp -a "${DIFFROOT}"/* "${TMP_DIFFROOT}/" - -"${KUBE_ROOT}/hack/update-federation-generated-swagger-docs.sh" -echo "diffing ${DIFFROOT} against freshly generated swagger type documentation" -ret=0 -diff -Naupr -I 'Auto generated by' "${DIFFROOT}" "${TMP_DIFFROOT}" || ret=$? -cp -a "${TMP_DIFFROOT}"/* "${DIFFROOT}/" -if [[ $ret -eq 0 ]] -then - echo "${DIFFROOT} up to date." -else - echo "${DIFFROOT} is out of date. Please run hack/update-federation-generated-swagger-docs.sh" - exit 1 -fi diff --git a/hack/verify-federation-openapi-spec.sh b/hack/verify-federation-openapi-spec.sh deleted file mode 100755 index df407a0842..0000000000 --- a/hack/verify-federation-openapi-spec.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash - -# Copyright 2016 The Kubernetes Authors. -# -# 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. - -set -o errexit -set -o nounset -set -o pipefail - -KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. -source "${KUBE_ROOT}/hack/lib/init.sh" - -kube::golang::setup_env - -SPECROOT="${KUBE_ROOT}/federation/apis/openapi-spec" -TMP_SPECROOT="${KUBE_ROOT}/_tmp_federation/openapi-spec" -_tmp="${KUBE_ROOT}/_tmp_federation" - -mkdir -p "${_tmp}" -cp -a "${SPECROOT}" "${TMP_SPECROOT}" -trap "cp -a ${TMP_SPECROOT} ${SPECROOT}/..; rm -rf ${_tmp}" EXIT SIGINT -rm ${SPECROOT}/* - -"${KUBE_ROOT}/hack/update-federation-openapi-spec.sh" -echo "diffing ${SPECROOT} against freshly generated federation openapi spec" -ret=0 -diff -Naupr -I 'Auto generated by' "${SPECROOT}" "${TMP_SPECROOT}" || ret=$? -if [[ $ret -eq 0 ]] -then - echo "${SPECROOT} up to date." -else - echo "${SPECROOT} is out of date. Please run hack/update-federation-openapi-spec.sh" - exit 1 -fi - -# ex: ts=2 sw=2 et filetype=sh diff --git a/hack/verify-federation-swagger-spec.sh b/hack/verify-federation-swagger-spec.sh deleted file mode 100755 index 0a33f2ffaa..0000000000 --- a/hack/verify-federation-swagger-spec.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash - -# Copyright 2017 The Kubernetes Authors. -# -# 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. - -set -o errexit -set -o nounset -set -o pipefail - -KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. -source "${KUBE_ROOT}/hack/lib/init.sh" - -kube::golang::setup_env - -make -C "${KUBE_ROOT}" WHAT=federation/cmd/federation-apiserver - -apiserver=$(kube::util::find-binary "federation-apiserver") - -SPECROOT="${KUBE_ROOT}/federation/apis/swagger-spec" -TMP_SPECROOT="${KUBE_ROOT}/_tmp_federation/swagger-spec" -_tmp="${KUBE_ROOT}/_tmp_federation" - -mkdir -p "${_tmp}" -trap "rm -rf ${_tmp}" EXIT SIGINT -cp -a "${SPECROOT}" "${TMP_SPECROOT}" - -"${KUBE_ROOT}/hack/update-federation-swagger-spec.sh" -echo "diffing ${SPECROOT} against freshly generated federation swagger spec" -ret=0 -diff -Naupr -I 'Auto generated by' "${SPECROOT}" "${TMP_SPECROOT}" || ret=$? -cp -a ${TMP_SPECROOT} "${KUBE_ROOT}/federation/apis" -if [[ $ret -eq 0 ]] -then - echo "${SPECROOT} up to date." -else - echo "${SPECROOT} is out of date. Please run hack/update-federation-swagger-spec.sh" - exit 1 -fi - -# ex: ts=2 sw=2 et filetype=sh diff --git a/hack/verify-generated-docs.sh b/hack/verify-generated-docs.sh index e2d1899ffd..9331343b1e 100755 --- a/hack/verify-generated-docs.sh +++ b/hack/verify-generated-docs.sh @@ -28,7 +28,6 @@ BINS=( cmd/genkubedocs cmd/genman cmd/genyaml - federation/cmd/genfeddocs ) make -C "${KUBE_ROOT}" WHAT="${BINS[*]}" diff --git a/pkg/api/testapi/BUILD b/pkg/api/testapi/BUILD index 1aabdae0b2..0a386f8832 100644 --- a/pkg/api/testapi/BUILD +++ b/pkg/api/testapi/BUILD @@ -11,8 +11,6 @@ go_library( srcs = ["testapi.go"], importpath = "k8s.io/kubernetes/pkg/api/testapi", deps = [ - "//federation/apis/federation:go_default_library", - "//federation/apis/federation/install:go_default_library", "//pkg/api:go_default_library", "//pkg/api/install:go_default_library", "//pkg/api/legacyscheme:go_default_library", diff --git a/pkg/api/testapi/testapi.go b/pkg/api/testapi/testapi.go index 441f279035..4d2c609429 100644 --- a/pkg/api/testapi/testapi.go +++ b/pkg/api/testapi/testapi.go @@ -34,7 +34,6 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/serializer/recognizer" - "k8s.io/kubernetes/federation/apis/federation" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/legacyscheme" "k8s.io/kubernetes/pkg/apis/admission" @@ -53,7 +52,6 @@ import ( "k8s.io/kubernetes/pkg/apis/settings" "k8s.io/kubernetes/pkg/apis/storage" - _ "k8s.io/kubernetes/federation/apis/federation/install" _ "k8s.io/kubernetes/pkg/api/install" _ "k8s.io/kubernetes/pkg/apis/admission/install" _ "k8s.io/kubernetes/pkg/apis/admissionregistration/install" @@ -83,7 +81,6 @@ var ( Extensions TestGroup Apps TestGroup Policy TestGroup - Federation TestGroup Rbac TestGroup Certificates TestGroup Scheduling TestGroup @@ -227,15 +224,6 @@ func init() { externalTypes: legacyscheme.Scheme.KnownTypes(externalGroupVersion), } } - if _, ok := Groups[federation.GroupName]; !ok { - externalGroupVersion := schema.GroupVersion{Group: federation.GroupName, Version: legacyscheme.Registry.GroupOrDie(federation.GroupName).GroupVersion.Version} - Groups[federation.GroupName] = TestGroup{ - externalGroupVersion: externalGroupVersion, - internalGroupVersion: federation.SchemeGroupVersion, - internalTypes: legacyscheme.Scheme.KnownTypes(federation.SchemeGroupVersion), - externalTypes: legacyscheme.Scheme.KnownTypes(externalGroupVersion), - } - } if _, ok := Groups[rbac.GroupName]; !ok { externalGroupVersion := schema.GroupVersion{Group: rbac.GroupName, Version: legacyscheme.Registry.GroupOrDie(rbac.GroupName).GroupVersion.Version} Groups[rbac.GroupName] = TestGroup{ @@ -334,7 +322,6 @@ func init() { Policy = Groups[policy.GroupName] Certificates = Groups[certificates.GroupName] Extensions = Groups[extensions.GroupName] - Federation = Groups[federation.GroupName] Rbac = Groups[rbac.GroupName] Scheduling = Groups[scheduling.GroupName] Settings = Groups[settings.GroupName] diff --git a/pkg/generated/openapi/BUILD b/pkg/generated/openapi/BUILD index 574aeb24e4..d9f35e289f 100644 --- a/pkg/generated/openapi/BUILD +++ b/pkg/generated/openapi/BUILD @@ -11,7 +11,6 @@ openapi_library( srcs = ["doc.go"], go_prefix = openapi_go_prefix, openapi_targets = [ - "federation/apis/federation/v1beta1", "pkg/apis/abac/v0", "pkg/apis/abac/v1beta1", "pkg/apis/componentconfig/v1alpha1", diff --git a/pkg/kubectl/cmd/cmd.go b/pkg/kubectl/cmd/cmd.go index 8287b19806..1538bb4a50 100644 --- a/pkg/kubectl/cmd/cmd.go +++ b/pkg/kubectl/cmd/cmd.go @@ -210,7 +210,6 @@ __custom_func() { * certificatesigningrequests (aka 'csr') * clusterrolebindings * clusterroles - * clusters (valid only for federation apiservers) * componentstatuses (aka 'cs') * configmaps (aka 'cm') * controllerrevisions diff --git a/pkg/kubectl/cmd/testing/BUILD b/pkg/kubectl/cmd/testing/BUILD index 8327804857..483b7c98c0 100644 --- a/pkg/kubectl/cmd/testing/BUILD +++ b/pkg/kubectl/cmd/testing/BUILD @@ -14,7 +14,6 @@ go_library( "//build/visible_to:pkg_kubectl_cmd_testing_CONSUMERS", ], deps = [ - "//federation/client/clientset_generated/federation_clientset:go_default_library", "//pkg/api:go_default_library", "//pkg/api/legacyscheme:go_default_library", "//pkg/api/testapi:go_default_library", diff --git a/pkg/kubectl/cmd/testing/fake.go b/pkg/kubectl/cmd/testing/fake.go index 80310cc22b..e622b395f2 100644 --- a/pkg/kubectl/cmd/testing/fake.go +++ b/pkg/kubectl/cmd/testing/fake.go @@ -35,7 +35,6 @@ import ( "k8s.io/client-go/kubernetes" restclient "k8s.io/client-go/rest" "k8s.io/client-go/rest/fake" - fedclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/legacyscheme" "k8s.io/kubernetes/pkg/api/testapi" @@ -331,12 +330,6 @@ func (f *FakeFactory) ClientForMapping(mapping *meta.RESTMapping) (resource.REST return f.tf.Client, f.tf.Err } -func (f *FakeFactory) FederationClientSetForVersion(version *schema.GroupVersion) (fedclientset.Interface, error) { - return nil, nil -} -func (f *FakeFactory) FederationClientForVersion(version *schema.GroupVersion) (*restclient.RESTClient, error) { - return nil, nil -} func (f *FakeFactory) ClientSetForVersion(requiredVersion *schema.GroupVersion) (internalclientset.Interface, error) { return nil, nil } diff --git a/pkg/kubectl/cmd/util/BUILD b/pkg/kubectl/cmd/util/BUILD index 9c2874bfb9..f14c501e93 100644 --- a/pkg/kubectl/cmd/util/BUILD +++ b/pkg/kubectl/cmd/util/BUILD @@ -22,8 +22,6 @@ go_library( "//build/visible_to:pkg_kubectl_cmd_util_CONSUMERS", ], deps = [ - "//federation/apis/federation:go_default_library", - "//federation/client/clientset_generated/federation_clientset:go_default_library", "//pkg/api:go_default_library", "//pkg/api/legacyscheme:go_default_library", "//pkg/api/v1:go_default_library", diff --git a/pkg/kubectl/cmd/util/clientcache.go b/pkg/kubectl/cmd/util/clientcache.go index 5312cb3095..124216d2e8 100644 --- a/pkg/kubectl/cmd/util/clientcache.go +++ b/pkg/kubectl/cmd/util/clientcache.go @@ -24,7 +24,6 @@ import ( "k8s.io/client-go/kubernetes" restclient "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" - fedclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" oldclient "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/version" @@ -34,7 +33,6 @@ func NewClientCache(loader clientcmd.ClientConfig, discoveryClientFactory Discov return &ClientCache{ clientsets: make(map[schema.GroupVersion]internalclientset.Interface), configs: make(map[schema.GroupVersion]*restclient.Config), - fedClientSets: make(map[schema.GroupVersion]fedclientset.Interface), loader: loader, discoveryClientFactory: discoveryClientFactory, } @@ -43,10 +41,9 @@ func NewClientCache(loader clientcmd.ClientConfig, discoveryClientFactory Discov // ClientCache caches previously loaded clients for reuse, and ensures MatchServerVersion // is invoked only once type ClientCache struct { - loader clientcmd.ClientConfig - clientsets map[schema.GroupVersion]internalclientset.Interface - fedClientSets map[schema.GroupVersion]fedclientset.Interface - configs map[schema.GroupVersion]*restclient.Config + loader clientcmd.ClientConfig + clientsets map[schema.GroupVersion]internalclientset.Interface + configs map[schema.GroupVersion]*restclient.Config // noVersionConfig provides a cached config for the case of no required version specified noVersionConfig *restclient.Config @@ -211,51 +208,3 @@ func (c *ClientCache) ClientSetForVersion(requiredVersion *schema.GroupVersion) return clientset, nil } - -func (c *ClientCache) FederationClientSetForVersion(version *schema.GroupVersion) (fedclientset.Interface, error) { - c.lock.Lock() - defer c.lock.Unlock() - - return c.federationClientSetForVersion(version) -} - -func (c *ClientCache) federationClientSetForVersion(version *schema.GroupVersion) (fedclientset.Interface, error) { - if version != nil { - if clientSet, found := c.fedClientSets[*version]; found { - return clientSet, nil - } - } - config, err := c.clientConfigForVersion(version) - if err != nil { - return nil, err - } - - // TODO: support multi versions of client with clientset - clientSet, err := fedclientset.NewForConfig(config) - if err != nil { - return nil, err - } - c.fedClientSets[*config.GroupVersion] = clientSet - - if version != nil { - configCopy := *config - clientSet, err := fedclientset.NewForConfig(&configCopy) - if err != nil { - return nil, err - } - c.fedClientSets[*version] = clientSet - } - - return clientSet, nil -} - -func (c *ClientCache) FederationClientForVersion(version *schema.GroupVersion) (*restclient.RESTClient, error) { - c.lock.Lock() - defer c.lock.Unlock() - - fedClientSet, err := c.federationClientSetForVersion(version) - if err != nil { - return nil, err - } - return fedClientSet.Federation().RESTClient().(*restclient.RESTClient), nil -} diff --git a/pkg/kubectl/cmd/util/factory.go b/pkg/kubectl/cmd/util/factory.go index 2191fbc9e0..62dd2b40bf 100644 --- a/pkg/kubectl/cmd/util/factory.go +++ b/pkg/kubectl/cmd/util/factory.go @@ -37,7 +37,6 @@ import ( "k8s.io/client-go/kubernetes" restclient "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" - fedclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" "k8s.io/kubernetes/pkg/api" apiv1 "k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" @@ -103,11 +102,6 @@ type ClientAccessFactory interface { // just directions to the server. People use this to build RESTMappers on top of BareClientConfig() (*restclient.Config, error) - // TODO this should probably be removed and collapsed into whatever we want to use long term - // probably returning a restclient for a version and leaving contruction up to someone else - FederationClientSetForVersion(version *schema.GroupVersion) (fedclientset.Interface, error) - // TODO remove this should be rolled into restclient with the right version - FederationClientForVersion(version *schema.GroupVersion) (*restclient.RESTClient, error) // TODO remove. This should be rolled into `ClientSet` ClientSetForVersion(requiredVersion *schema.GroupVersion) (internalclientset.Interface, error) // TODO remove. This should be rolled into `ClientConfig` diff --git a/pkg/kubectl/cmd/util/factory_client_access.go b/pkg/kubectl/cmd/util/factory_client_access.go index 4219937df2..6c12da8a35 100644 --- a/pkg/kubectl/cmd/util/factory_client_access.go +++ b/pkg/kubectl/cmd/util/factory_client_access.go @@ -45,7 +45,6 @@ import ( restclient "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/util/homedir" - fedclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/legacyscheme" "k8s.io/kubernetes/pkg/apis/apps" @@ -213,14 +212,6 @@ func (f *ring0Factory) RESTClient() (*restclient.RESTClient, error) { return restclient.RESTClientFor(clientConfig) } -func (f *ring0Factory) FederationClientSetForVersion(version *schema.GroupVersion) (fedclientset.Interface, error) { - return f.clientCache.FederationClientSetForVersion(version) -} - -func (f *ring0Factory) FederationClientForVersion(version *schema.GroupVersion) (*restclient.RESTClient, error) { - return f.clientCache.FederationClientForVersion(version) -} - func (f *ring0Factory) Decoder(toInternal bool) runtime.Decoder { var decoder runtime.Decoder if toInternal { diff --git a/pkg/kubectl/cmd/util/factory_object_mapping.go b/pkg/kubectl/cmd/util/factory_object_mapping.go index 35a90f759b..3ebeaacee9 100644 --- a/pkg/kubectl/cmd/util/factory_object_mapping.go +++ b/pkg/kubectl/cmd/util/factory_object_mapping.go @@ -35,7 +35,6 @@ import ( "k8s.io/client-go/discovery" "k8s.io/client-go/dynamic" restclient "k8s.io/client-go/rest" - "k8s.io/kubernetes/federation/apis/federation" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/legacyscheme" "k8s.io/kubernetes/pkg/apis/apps" @@ -143,9 +142,6 @@ func (f *ring1Factory) ClientForMapping(mapping *meta.RESTMapping) (resource.RES } gvk := mapping.GroupVersionKind switch gvk.Group { - case federation.GroupName: - mappingVersion := mapping.GroupVersionKind.GroupVersion() - return f.clientAccessFactory.FederationClientForVersion(&mappingVersion) case api.GroupName: cfg.APIPath = "/api" default: @@ -176,15 +172,6 @@ func (f *ring1Factory) UnstructuredClientForMapping(mapping *meta.RESTMapping) ( func (f *ring1Factory) Describer(mapping *meta.RESTMapping) (printers.Describer, error) { mappingVersion := mapping.GroupVersionKind.GroupVersion() - if mapping.GroupVersionKind.Group == federation.GroupName { - fedClientSet, err := f.clientAccessFactory.FederationClientSetForVersion(&mappingVersion) - if err != nil { - return nil, err - } - if mapping.GroupVersionKind.Kind == "Cluster" { - return &printersinternal.ClusterDescriber{Interface: fedClientSet}, nil - } - } clientset, err := f.clientAccessFactory.ClientSetForVersion(&mappingVersion) if err != nil { diff --git a/pkg/kubectl/resource/categories.go b/pkg/kubectl/resource/categories.go index bee08a05c5..1b1378b937 100644 --- a/pkg/kubectl/resource/categories.go +++ b/pkg/kubectl/resource/categories.go @@ -179,10 +179,3 @@ var LegacyCategoryExpander CategoryExpander = SimpleCategoryExpander{ "all": legacyUserResources, }, } - -// LegacyFederationCategoryExpander is the old hardcoded expansion for federation -var LegacyFederationCategoryExpander CategoryExpander = SimpleCategoryExpander{ - Expansions: map[string][]schema.GroupResource{ - "all": {{Group: "", Resource: "services"}}, - }, -} diff --git a/pkg/master/import_known_versions_test.go b/pkg/master/import_known_versions_test.go index 271cff9f78..fd015504ae 100644 --- a/pkg/master/import_known_versions_test.go +++ b/pkg/master/import_known_versions_test.go @@ -41,12 +41,11 @@ func TestGroupVersions(t *testing.T) { "batch", "componentconfig", "extensions", - "federation", "policy", ) // No new groups should be added to the legacyUnsuffixedGroups exclusion list - if len(legacyUnsuffixedGroups) != 8 { + if len(legacyUnsuffixedGroups) != 7 { t.Errorf("No additional unnamespaced groups should be created") } diff --git a/pkg/printers/internalversion/BUILD b/pkg/printers/internalversion/BUILD index 18966204e4..fa8d3bf662 100644 --- a/pkg/printers/internalversion/BUILD +++ b/pkg/printers/internalversion/BUILD @@ -16,9 +16,6 @@ go_test( importpath = "k8s.io/kubernetes/pkg/printers/internalversion", library = ":go_default_library", deps = [ - "//federation/apis/federation:go_default_library", - "//federation/apis/federation/v1beta1:go_default_library", - "//federation/client/clientset_generated/federation_clientset/fake:go_default_library", "//pkg/api:go_default_library", "//pkg/api/legacyscheme:go_default_library", "//pkg/api/testapi:go_default_library", @@ -59,9 +56,6 @@ go_library( ], importpath = "k8s.io/kubernetes/pkg/printers/internalversion", deps = [ - "//federation/apis/federation:go_default_library", - "//federation/apis/federation/v1beta1:go_default_library", - "//federation/client/clientset_generated/federation_clientset:go_default_library", "//pkg/api:go_default_library", "//pkg/api/events:go_default_library", "//pkg/api/helper:go_default_library", diff --git a/pkg/printers/internalversion/describe.go b/pkg/printers/internalversion/describe.go index 3cb053b9cd..2a4c6a803e 100644 --- a/pkg/printers/internalversion/describe.go +++ b/pkg/printers/internalversion/describe.go @@ -47,8 +47,6 @@ import ( "k8s.io/apimachinery/pkg/util/sets" "k8s.io/client-go/dynamic" clientextensionsv1beta1 "k8s.io/client-go/kubernetes/typed/extensions/v1beta1" - federation "k8s.io/kubernetes/federation/apis/federation/v1beta1" - fedclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/events" "k8s.io/kubernetes/pkg/api/helper" @@ -3073,47 +3071,6 @@ func (d *ConfigMapDescriber) Describe(namespace, name string, describerSettings }) } -type ClusterDescriber struct { - fedclientset.Interface -} - -func (d *ClusterDescriber) Describe(namespace, name string, describerSettings printers.DescriberSettings) (string, error) { - cluster, err := d.Federation().Clusters().Get(name, metav1.GetOptions{}) - if err != nil { - return "", err - } - return describeCluster(cluster) -} - -func describeCluster(cluster *federation.Cluster) (string, error) { - return tabbedString(func(out io.Writer) error { - w := NewPrefixWriter(out) - w.Write(LEVEL_0, "Name:\t%s\n", cluster.Name) - w.Write(LEVEL_0, "Labels:\t%s\n", labels.FormatLabels(cluster.Labels)) - - w.Write(LEVEL_0, "ServerAddressByClientCIDRs:\n ClientCIDR\tServerAddress\n") - w.Write(LEVEL_1, "----\t----\n") - for _, cidrAddr := range cluster.Spec.ServerAddressByClientCIDRs { - w.Write(LEVEL_1, "%v \t%v\n\n", cidrAddr.ClientCIDR, cidrAddr.ServerAddress) - } - - if len(cluster.Status.Conditions) > 0 { - w.Write(LEVEL_0, "Conditions:\n Type\tStatus\tLastUpdateTime\tLastTransitionTime\tReason\tMessage\n") - w.Write(LEVEL_1, "----\t------\t-----------------\t------------------\t------\t-------\n") - for _, c := range cluster.Status.Conditions { - w.Write(LEVEL_1, "%v \t%v \t%s \t%s \t%v \t%v\n", - c.Type, - c.Status, - c.LastProbeTime.Time.Format(time.RFC1123Z), - c.LastTransitionTime.Time.Format(time.RFC1123Z), - c.Reason, - c.Message) - } - } - return nil - }) -} - // NetworkPolicyDescriber generates information about a networking.NetworkPolicy type NetworkPolicyDescriber struct { clientset.Interface diff --git a/pkg/printers/internalversion/describe_test.go b/pkg/printers/internalversion/describe_test.go index f18df80979..432a27e070 100644 --- a/pkg/printers/internalversion/describe_test.go +++ b/pkg/printers/internalversion/describe_test.go @@ -33,8 +33,6 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/util/intstr" versionedfake "k8s.io/client-go/kubernetes/fake" - federation "k8s.io/kubernetes/federation/apis/federation/v1beta1" - fedfake "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/fake" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/apis/autoscaling" "k8s.io/kubernetes/pkg/apis/extensions" @@ -848,40 +846,6 @@ func TestDescribeDeployment(t *testing.T) { } } -func TestDescribeCluster(t *testing.T) { - cluster := federation.Cluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: "foo", - ResourceVersion: "4", - Labels: map[string]string{ - "name": "foo", - }, - }, - Spec: federation.ClusterSpec{ - ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{ - { - ClientCIDR: "0.0.0.0/0", - ServerAddress: "localhost:8888", - }, - }, - }, - Status: federation.ClusterStatus{ - Conditions: []federation.ClusterCondition{ - {Type: federation.ClusterReady, Status: v1.ConditionTrue}, - }, - }, - } - fake := fedfake.NewSimpleClientset(&cluster) - d := ClusterDescriber{Interface: fake} - out, err := d.Describe("any", "foo", printers.DescriberSettings{ShowEvents: true}) - if err != nil { - t.Errorf("unexpected error: %v", err) - } - if !strings.Contains(out, "foo") { - t.Errorf("unexpected out: %s", out) - } -} - func TestDescribeStorageClass(t *testing.T) { reclaimPolicy := api.PersistentVolumeReclaimRetain f := fake.NewSimpleClientset(&storage.StorageClass{ diff --git a/pkg/printers/internalversion/printers.go b/pkg/printers/internalversion/printers.go index f442c40899..5b564ed728 100644 --- a/pkg/printers/internalversion/printers.go +++ b/pkg/printers/internalversion/printers.go @@ -41,7 +41,6 @@ import ( "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/kubernetes/federation/apis/federation" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/events" "k8s.io/kubernetes/pkg/api/helper" @@ -361,15 +360,6 @@ func AddHandlers(h printers.PrintHandler) { h.TableHandler(podSecurityPolicyColumnDefinitions, printPodSecurityPolicy) h.TableHandler(podSecurityPolicyColumnDefinitions, printPodSecurityPolicyList) - clusterColumnDefinitions := []metav1alpha1.TableColumnDefinition{ - {Name: "Name", Type: "string", Format: "name", Description: metav1.ObjectMeta{}.SwaggerDoc()["name"]}, - {Name: "Status", Type: "string", Description: "Status of the cluster"}, - {Name: "Age", Type: "string", Description: metav1.ObjectMeta{}.SwaggerDoc()["creationTimestamp"]}, - {Name: "Labels", Type: "string", Description: "The labels of the cluster"}, - } - h.TableHandler(clusterColumnDefinitions, printCluster) - h.TableHandler(clusterColumnDefinitions, printClusterList) - networkPolicyColumnDefinitioins := []metav1alpha1.TableColumnDefinition{ {Name: "Name", Type: "string", Format: "name", Description: metav1.ObjectMeta{}.SwaggerDoc()["name"]}, {Name: "Pod-Selector", Type: "string", Description: extensionsv1beta1.NetworkPolicySpec{}.SwaggerDoc()["podSelector"]}, @@ -748,41 +738,6 @@ func printReplicaSetList(list *extensions.ReplicaSetList, options printers.Print return rows, nil } -func printCluster(obj *federation.Cluster, options printers.PrintOptions) ([]metav1alpha1.TableRow, error) { - row := metav1alpha1.TableRow{ - Object: runtime.RawExtension{Object: obj}, - } - - var statuses []string - for _, condition := range obj.Status.Conditions { - if condition.Status == api.ConditionTrue { - statuses = append(statuses, string(condition.Type)) - } else { - statuses = append(statuses, "Not"+string(condition.Type)) - } - } - if len(statuses) == 0 { - statuses = append(statuses, "Unknown") - } - row.Cells = append(row.Cells, obj.Name, strings.Join(statuses, ","), translateTimestamp(obj.CreationTimestamp)) - if options.ShowLabels { - row.Cells = append(row.Cells, labels.FormatLabels(obj.Labels)) - } - return []metav1alpha1.TableRow{row}, nil -} - -func printClusterList(list *federation.ClusterList, options printers.PrintOptions) ([]metav1alpha1.TableRow, error) { - rows := make([]metav1alpha1.TableRow, 0, len(list.Items)) - for i := range list.Items { - r, err := printCluster(&list.Items[i], options) - if err != nil { - return nil, err - } - rows = append(rows, r...) - } - return rows, nil -} - func printJob(obj *batch.Job, options printers.PrintOptions) ([]metav1alpha1.TableRow, error) { row := metav1alpha1.TableRow{ Object: runtime.RawExtension{Object: obj}, diff --git a/pkg/printers/internalversion/printers_test.go b/pkg/printers/internalversion/printers_test.go index f15250dfb0..269caa26db 100644 --- a/pkg/printers/internalversion/printers_test.go +++ b/pkg/printers/internalversion/printers_test.go @@ -41,7 +41,6 @@ import ( "k8s.io/apimachinery/pkg/util/diff" "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/kubernetes/federation/apis/federation" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/legacyscheme" "k8s.io/kubernetes/pkg/api/testapi" @@ -3134,124 +3133,3 @@ func TestPrintStorageClass(t *testing.T) { buf.Reset() } } - -func TestPrintCluster(t *testing.T) { - tests := []struct { - cluster federation.Cluster - expect []metav1alpha1.TableRow - showLabels bool - }{ - { - federation.Cluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cluster1", - CreationTimestamp: metav1.Time{Time: time.Now().Add(1.9e9)}, - }, - }, - []metav1alpha1.TableRow{{Cells: []interface{}{"cluster1", "Unknown", "0s"}}}, - false, - }, - { - federation.Cluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cluster2", - CreationTimestamp: metav1.Time{Time: time.Now().Add(1.9e9)}, - Labels: map[string]string{"label1": "", "label2": "cluster"}, - }, - Status: federation.ClusterStatus{ - Conditions: []federation.ClusterCondition{ - { - Status: api.ConditionTrue, - Type: federation.ClusterReady, - }, - { - Status: api.ConditionFalse, - Type: federation.ClusterOffline, - }, - }, - }, - }, - []metav1alpha1.TableRow{{Cells: []interface{}{"cluster2", "Ready,NotOffline", "0s", "label1=,label2=cluster"}}}, - true, - }, - } - - for i, test := range tests { - rows, err := printCluster(&test.cluster, printers.PrintOptions{ShowLabels: test.showLabels}) - if err != nil { - t.Fatal(err) - } - for i := range rows { - rows[i].Object.Object = nil - } - if !reflect.DeepEqual(test.expect, rows) { - t.Errorf("%d mismatch: %s", i, diff.ObjectReflectDiff(test.expect, rows)) - } - } -} - -func TestPrintClusterList(t *testing.T) { - tests := []struct { - clusters federation.ClusterList - expect []metav1alpha1.TableRow - showLabels bool - }{ - // Test podList's pod: name, num of containers, restarts, container ready status - { - federation.ClusterList{ - Items: []federation.Cluster{ - { - ObjectMeta: metav1.ObjectMeta{ - Name: "cluster1", - CreationTimestamp: metav1.Time{Time: time.Now().Add(1.9e9)}, - }, - Status: federation.ClusterStatus{ - Conditions: []federation.ClusterCondition{ - { - Status: api.ConditionTrue, - Type: federation.ClusterReady, - }, - }, - }, - }, - { - ObjectMeta: metav1.ObjectMeta{ - Name: "cluster2", - CreationTimestamp: metav1.Time{Time: time.Now().Add(1.9e9)}, - Labels: map[string]string{"label1": "", "label2": "cluster2"}, - }, - Status: federation.ClusterStatus{ - Conditions: []federation.ClusterCondition{ - { - Status: api.ConditionTrue, - Type: federation.ClusterReady, - }, - { - Status: api.ConditionFalse, - Type: federation.ClusterOffline, - }, - }, - }, - }, - }, - }, - []metav1alpha1.TableRow{{Cells: []interface{}{"cluster1", "Ready", "0s", ""}}, - {Cells: []interface{}{"cluster2", "Ready,NotOffline", "0s", "label1=,label2=cluster2"}}}, - true, - }, - } - - for _, test := range tests { - rows, err := printClusterList(&test.clusters, printers.PrintOptions{ShowLabels: test.showLabels}) - - if err != nil { - t.Fatal(err) - } - for i := range rows { - rows[i].Object.Object = nil - } - if !reflect.DeepEqual(test.expect, rows) { - t.Errorf("mismatch: %s", diff.ObjectReflectDiff(test.expect, rows)) - } - } -} diff --git a/test/e2e/BUILD b/test/e2e/BUILD index aa2ba4237c..0f7633e98c 100644 --- a/test/e2e/BUILD +++ b/test/e2e/BUILD @@ -51,7 +51,6 @@ go_library( ], importpath = "k8s.io/kubernetes/test/e2e", deps = [ - "//federation/test/e2e:go_default_library", "//pkg/api:go_default_library", "//pkg/api/testapi:go_default_library", "//pkg/api/v1/pod:go_default_library", diff --git a/test/e2e/common/util.go b/test/e2e/common/util.go index c65e9199bb..59daf6c81a 100644 --- a/test/e2e/common/util.go +++ b/test/e2e/common/util.go @@ -35,9 +35,8 @@ import ( type Suite string const ( - E2E Suite = "e2e" - NodeE2E Suite = "node e2e" - FederationE2E Suite = "federation e2e" + E2E Suite = "e2e" + NodeE2E Suite = "node e2e" ) var ( diff --git a/test/e2e/e2e.go b/test/e2e/e2e.go index 28ecfd1871..3e837595a0 100644 --- a/test/e2e/e2e.go +++ b/test/e2e/e2e.go @@ -34,7 +34,6 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtimeutils "k8s.io/apimachinery/pkg/util/runtime" clientset "k8s.io/client-go/kubernetes" - federationtest "k8s.io/kubernetes/federation/test/e2e" "k8s.io/kubernetes/pkg/cloudprovider/providers/azure" gcecloud "k8s.io/kubernetes/pkg/cloudprovider/providers/gce" "k8s.io/kubernetes/pkg/kubectl/util/logs" @@ -161,7 +160,6 @@ var _ = ginkgo.SynchronizedBeforeSuite(func() []byte { metav1.NamespaceSystem, metav1.NamespaceDefault, metav1.NamespacePublic, - framework.FederationSystemNamespace(), }) if err != nil { framework.Failf("Error deleting orphaned namespaces: %v", err) @@ -239,9 +237,6 @@ var _ = ginkgo.SynchronizedBeforeSuite(func() []byte { // Reference common test to make the import valid. commontest.CurrentSuite = commontest.E2E - // Reference federation test to make the import valid. - federationtest.FederationSuite = commontest.FederationE2E - return nil }, func(data []byte) { diff --git a/test/e2e/framework/BUILD b/test/e2e/framework/BUILD index ac5d5de47a..92f6295d4e 100644 --- a/test/e2e/framework/BUILD +++ b/test/e2e/framework/BUILD @@ -12,7 +12,6 @@ go_library( "cleanup.go", "deployment_util.go", "exec_util.go", - "federation_util.go", "firewall_util.go", "framework.go", "get-kubemark-resource-usage.go", @@ -41,7 +40,6 @@ go_library( ], importpath = "k8s.io/kubernetes/test/e2e/framework", deps = [ - "//federation/apis/federation/v1beta1:go_default_library", "//pkg/api:go_default_library", "//pkg/api/legacyscheme:go_default_library", "//pkg/api/testapi:go_default_library", diff --git a/test/e2e/framework/federation_util.go b/test/e2e/framework/federation_util.go deleted file mode 100644 index 552473fab8..0000000000 --- a/test/e2e/framework/federation_util.go +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -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. -*/ - -package framework - -import ( - "os" - - federationapi "k8s.io/kubernetes/federation/apis/federation/v1beta1" -) - -// FederationSystemNamespace returns the namespace in which -// the federation system components are hosted. -func FederationSystemNamespace() string { - federationNS := os.Getenv("FEDERATION_NAMESPACE") - if federationNS != "" { - return federationNS - } - return federationapi.FederationNamespaceSystem -} diff --git a/test/e2e/framework/test_context.go b/test/e2e/framework/test_context.go index cda164b140..528bb54952 100644 --- a/test/e2e/framework/test_context.go +++ b/test/e2e/framework/test_context.go @@ -102,12 +102,6 @@ type TestContextType struct { FeatureGates string // Node e2e specific test context NodeTestContextType - // Federation e2e context - FederatedKubeContext string - // Federation control plane version to upgrade to while doing upgrade tests - FederationUpgradeTarget string - // Whether configuration for accessing federation member clusters should be sourced from the host cluster - FederationConfigFromCluster bool // Indicates what path the kubernetes-anywhere is installed on KubernetesAnywherePath string @@ -217,8 +211,6 @@ func RegisterClusterFlags() { flag.StringVar(&TestContext.KubemarkExternalKubeConfig, fmt.Sprintf("%s-%s", "kubemark-external", clientcmd.RecommendedConfigPathFlag), "", "Path to kubeconfig containing embedded authinfo for external cluster.") flag.StringVar(&TestContext.KubeContext, clientcmd.FlagContext, "", "kubeconfig context to use/override. If unset, will use value from 'current-context'") flag.StringVar(&TestContext.KubeAPIContentType, "kube-api-content-type", "application/vnd.kubernetes.protobuf", "ContentType used to communicate with apiserver") - flag.StringVar(&TestContext.FederatedKubeContext, "federated-kube-context", "e2e-federation", "kubeconfig context for federation.") - flag.BoolVar(&TestContext.FederationConfigFromCluster, "federation-config-from-cluster", false, "whether to source configuration for member clusters from the hosting cluster.") flag.StringVar(&TestContext.KubeVolumeDir, "volume-dir", "/var/lib/kubelet", "Path to the directory containing the kubelet volumes.") flag.StringVar(&TestContext.CertDir, "cert-dir", "", "Path to the directory containing the certs. Default is empty, which doesn't use certs.") @@ -256,7 +248,6 @@ func RegisterClusterFlags() { flag.StringVar(&TestContext.EtcdUpgradeVersion, "etcd-upgrade-version", "", "The etcd binary version to upgrade to (e.g., '3.0.14', '2.3.7') if doing an etcd upgrade test.") flag.StringVar(&TestContext.UpgradeImage, "upgrade-image", "", "Image to upgrade to (e.g. 'container_vm' or 'gci') if doing an upgrade test.") flag.StringVar(&TestContext.GCEUpgradeScript, "gce-upgrade-script", "", "Script to use to upgrade a GCE cluster.") - flag.StringVar(&TestContext.FederationUpgradeTarget, "federation-upgrade-target", "ci/latest", "Version to upgrade to (e.g. 'release/stable', 'release/latest', 'ci/latest', '0.19.1', '0.19.1-669-gabac8c8') if doing an federation upgrade test.") flag.BoolVar(&TestContext.CleanStart, "clean-start", false, "If true, purge all namespaces except default and system before running tests. This serves to Cleanup test namespaces from failed/interrupted e2e runs in a long-lived cluster.") flag.BoolVar(&TestContext.GarbageCollectorEnabled, "garbage-collector-enabled", true, "Set to true if the garbage collector is enabled in the kube-apiserver and kube-controller-manager, then some tests will rely on the garbage collector to delete dependent resources.") } diff --git a/test/integration/etcd/etcd_storage_path_test.go b/test/integration/etcd/etcd_storage_path_test.go index 4f74da2a8a..2f0235f09b 100644 --- a/test/integration/etcd/etcd_storage_path_test.go +++ b/test/integration/etcd/etcd_storage_path_test.go @@ -378,9 +378,6 @@ var etcdStorageData = map[schema.GroupVersionResource]struct { // Be very careful when whitelisting an object as ephemeral. // Doing so removes the safety we gain from this test by skipping that object. var ephemeralWhiteList = createEphemeralWhiteList( - // k8s.io/kubernetes/federation/apis/federation/v1beta1 - gvr("federation", "v1beta1", "clusters"), // we cannot create this - // -- // k8s.io/kubernetes/pkg/api/v1 gvr("", "v1", "bindings"), // annotation on pod, not stored in etcd diff --git a/test/test_owners.csv b/test/test_owners.csv index 80883884ce..cb49be6353 100644 --- a/test/test_owners.csv +++ b/test/test_owners.csv @@ -145,48 +145,6 @@ EmptyDir wrapper volumes should not conflict,deads2k,1,node Etcd failure should recover from SIGKILL,pmorie,1,api-machinery Etcd failure should recover from network partition with master,justinsb,1,api-machinery Events should be sent by kubelets and the scheduler about pods scheduling and running,zmerlynn,1,node -Federated ReplicaSet Features CRUD should be deleted from underlying clusters when OrphanDependents is false,perotinus,0,federation -Federated ReplicaSet Features CRUD should create and update matching replicasets in underlying clusters,perotinus,0,federation -Federated ReplicaSet Features CRUD should not be deleted from underlying clusters when OrphanDependents is nil,perotinus,0,federation -Federated ReplicaSet Features CRUD should not be deleted from underlying clusters when OrphanDependents is true,perotinus,0,federation -Federated ReplicaSet Features Preferences should create replicasets with max replicas preference,perotinus,0,federation -Federated ReplicaSet Features Preferences should create replicasets with min replicas preference,perotinus,0,federation -Federated ReplicaSet Features Preferences should create replicasets with weight preference,perotinus,0,federation -Federated ReplicaSet ReplicaSet objects should be created and deleted successfully,perotinus,0,federation -Federated Services Without Clusters should succeed when a service is created,shashidharatd,0,federation -Federated Services with clusters DNS non-local federated service missing local service should never find DNS entries for a missing local service,shashidharatd,0,federation -Federated Services with clusters DNS should be able to discover a federated service,shashidharatd,0,federation -Federated Services with clusters Federated Service should be deleted from underlying clusters when OrphanDependents is false,shashidharatd,0,federation -Federated Services with clusters Federated Service should create and update matching services in underlying clusters,shashidharatd,0,federation -Federated Services with clusters Federated Service should not be deleted from underlying clusters when OrphanDependents is nil,shashidharatd,0,federation -Federated Services with clusters Federated Service should not be deleted from underlying clusters when OrphanDependents is true,shashidharatd,0,federation -Federated Services with clusters Federated Service should recreate service shard in underlying clusters when service shard is deleted,shashidharatd,0,federation -Federated ingresses Federated Ingresses should be created and deleted successfully,madhusudancs,0,federation -Federated ingresses Federated Ingresses should be deleted from underlying clusters when OrphanDependents is false,madhusudancs,0,federation -Federated ingresses Federated Ingresses should create and update matching ingresses in underlying clusters,madhusudancs,0,federation -Federated ingresses Federated Ingresses should not be deleted from underlying clusters when OrphanDependents is nil,madhusudancs,0,federation -Federated ingresses Federated Ingresses should not be deleted from underlying clusters when OrphanDependents is true,madhusudancs,0,federation -"Federated types Federated %q resources should be created, read, updated and deleted successfully",marun,0,federation -Federation API server authentication should accept cluster resources when the client has HTTP Basic authentication credentials,nikhiljindal,0,federation -Federation API server authentication should accept cluster resources when the client has certificate authentication credentials,nikhiljindal,0,federation -Federation API server authentication should accept cluster resources when the client has token authentication credentials,nikhiljindal,0,federation -Federation API server authentication should not accept cluster resources when the client has invalid HTTP Basic authentication credentials,nikhiljindal,0,federation -Federation API server authentication should not accept cluster resources when the client has invalid token authentication credentials,nikhiljindal,0,federation -Federation API server authentication should not accept cluster resources when the client has no authentication credentials,nikhiljindal,0,federation -Federation apiserver Admission control should not be able to create resources if namespace does not exist,nikhiljindal,0,federation -Federation apiserver Cluster objects should be created and deleted successfully,nikhiljindal,0,federation -Federation deployments Deployment objects should be created and deleted successfully,nikhiljindal,0,federation -Federation deployments Federated Deployment should be deleted from underlying clusters when OrphanDependents is false,nikhiljindal,0,federation -Federation deployments Federated Deployment should create and update matching deployments in underlying clusters,nikhiljindal,0,federation -Federation deployments Federated Deployment should not be deleted from underlying clusters when OrphanDependents is nil,nikhiljindal,0,federation -Federation deployments Federated Deployment should not be deleted from underlying clusters when OrphanDependents is true,nikhiljindal,0,federation -Federation events Event objects should be created and deleted successfully,shashidharatd,0,federation -Federation namespace Namespace objects all resources in the namespace should be deleted when namespace is deleted,nikhiljindal,0,federation -Federation namespace Namespace objects deletes replicasets in the namespace when the namespace is deleted,nikhiljindal,0,federation -Federation namespace Namespace objects should be created and deleted successfully,nikhiljindal,0,federation -Federation namespace Namespace objects should be deleted from underlying clusters when OrphanDependents is false,nikhiljindal,0,federation -Federation namespace Namespace objects should not be deleted from underlying clusters when OrphanDependents is nil,nikhiljindal,0,federation -Federation namespace Namespace objects should not be deleted from underlying clusters when OrphanDependents is true,nikhiljindal,0,federation Firewall rule should create valid firewall rules for LoadBalancer type service,MrHohn,0,network Firewall rule should have correct firewall rules for e2e cluster,MrHohn,0,network GCP Volumes GlusterFS should be mountable,nikhiljindal,0,storage @@ -587,27 +545,6 @@ k8s.io/kubernetes/cmd/libs/go2idl/client-gen/types,caesarxuchao,0, k8s.io/kubernetes/cmd/libs/go2idl/go-to-protobuf/protobuf,smarterclayton,0, k8s.io/kubernetes/cmd/libs/go2idl/openapi-gen/generators,davidopp,1, k8s.io/kubernetes/examples,Random-Liu,0, -k8s.io/kubernetes/federation/apis/federation/install,nikhiljindal,0, -k8s.io/kubernetes/federation/apis/federation/validation,nikhiljindal,0, -k8s.io/kubernetes/federation/cmd/federation-controller-manager/app,kzwang,0, -k8s.io/kubernetes/federation/pkg/dnsprovider,sttts,1, -k8s.io/kubernetes/federation/pkg/dnsprovider/providers/aws/route53,cjcullen,1, -k8s.io/kubernetes/federation/pkg/dnsprovider/providers/coredns,brendandburns,0, -k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns,madhusudancs,1, -k8s.io/kubernetes/federation/pkg/federation-controller/cluster,nikhiljindal,0, -k8s.io/kubernetes/federation/pkg/federation-controller/deployment,zmerlynn,1, -k8s.io/kubernetes/federation/pkg/federation-controller/ingress,vishh,1, -k8s.io/kubernetes/federation/pkg/federation-controller/replicaset,roberthbailey,1, -k8s.io/kubernetes/federation/pkg/federation-controller/secret,apelisse,1, -k8s.io/kubernetes/federation/pkg/federation-controller/service,pmorie,1, -k8s.io/kubernetes/federation/pkg/federation-controller/util,bgrant0607,1, -k8s.io/kubernetes/federation/pkg/federation-controller/util/eventsink,luxas,1, -k8s.io/kubernetes/federation/pkg/federation-controller/util/planner,Q-Lee,1, -k8s.io/kubernetes/federation/pkg/federation-controller/util/podanalyzer,caesarxuchao,1, -k8s.io/kubernetes/federation/pkg/kubefed,madhusudancs,0, -k8s.io/kubernetes/federation/pkg/kubefed/init,madhusudancs,0, -k8s.io/kubernetes/federation/registry/cluster,nikhiljindal,0, -k8s.io/kubernetes/federation/registry/cluster/etcd,nikhiljindal,0, k8s.io/kubernetes/hack,thockin,1, k8s.io/kubernetes/hack/cmd/teststale,thockin,1, k8s.io/kubernetes/pkg/api,Q-Lee,1, @@ -944,7 +881,6 @@ k8s.io/kubernetes/test/integration/client,Q-Lee,1, k8s.io/kubernetes/test/integration/configmap,Q-Lee,1, k8s.io/kubernetes/test/integration/evictions,brendandburns,0, k8s.io/kubernetes/test/integration/examples,maisem,1, -k8s.io/kubernetes/test/integration/federation,rrati,0, k8s.io/kubernetes/test/integration/garbagecollector,jlowdermilk,1, k8s.io/kubernetes/test/integration/kubeaggregator,deads2k,1, k8s.io/kubernetes/test/integration/kubectl,rrati,0, diff --git a/test/test_owners.json b/test/test_owners.json index 02f4fed723..805efcdcbd 100644 --- a/test/test_owners.json +++ b/test/test_owners.json @@ -1,122 +1,118 @@ { "api-machinery": [ - "Etcd", - "Generated", - "HA-master", - "Multi-AZ", - "Namespaces", - "ResourceQuota", - "Staging", - "Summary", + "Etcd", + "Generated", + "HA-master", + "Multi-AZ", + "Namespaces", + "ResourceQuota", + "Staging", + "Summary", "ThirdParty" - ], + ], "apps": [ - "Cassandra", - "ConfigMap", - "CronJob", - "Daemon", - "Deployment", - "Job", - "Mesos", - "Pet", - "Redis", - "ReplicaSet", - "ReplicationController", - "Rescheduler", - "RethinkDB", - "Secret", - "Security", - "Spark", - "StatefulSet", + "Cassandra", + "ConfigMap", + "CronJob", + "Daemon", + "Deployment", + "Job", + "Mesos", + "Pet", + "Redis", + "ReplicaSet", + "ReplicationController", + "Rescheduler", + "RethinkDB", + "Secret", + "Security", + "Spark", + "StatefulSet", "Storm" - ], + ], "autoscaling": [ - "Cluster size", + "Cluster size", "Horizontal" - ], + ], "big-data": [ "Hazelcast" - ], + ], "cli": [ "Kubectl" - ], + ], "cluster-lifecycle": [ - "GKE node", - "Garbage", - "Nodes", + "GKE node", + "Garbage", + "Nodes", "Upgrade" - ], - "federation": [ - "Federated", - "Federation" - ], + ], "instrumentation": [ - "Cluster level", - "Kibana", - "MetricsGrabber", + "Cluster level", + "Kibana", + "MetricsGrabber", "Monitoring" - ], + ], "network": [ - "ClusterDns", - "DNS", - "ESIPP", - "Firewall", - "Load", - "Network", + "ClusterDns", + "DNS", + "ESIPP", + "Firewall", + "Load", + "Network", "Service" - ], + ], "node": [ - "AppArmor", - "Cadvisor", - "Container", - "Docker", - "Downward", - "EmptyDir", - "Events", - "HostPath", - "ImageID", - "InitContainer", - "Initial", - "Kubelet", - "LimitRange", - "Liveness", - "Logging", - "MemoryEviction", - "MirrorPod", - "NodeProblemDetector", - "Opaque", - "Pod garbage", - "Pods", - "Port", - "PreStop", - "PrivilegedPod", - "Probing", - "Proxy", - "Reboot", - "Restart", - "SimpleMount", - "Sysctls", - "Variable", - "kubelet", + "AppArmor", + "Cadvisor", + "Container", + "Docker", + "Downward", + "EmptyDir", + "Events", + "HostPath", + "ImageID", + "InitContainer", + "Initial", + "Kubelet", + "LimitRange", + "Liveness", + "Logging", + "MemoryEviction", + "MirrorPod", + "NodeProblemDetector", + "Opaque", + "Pod garbage", + "Pods", + "Port", + "PreStop", + "PrivilegedPod", + "Probing", + "Proxy", + "Reboot", + "Restart", + "SimpleMount", + "Sysctls", + "Variable", + "kubelet", "when" - ], + ], "scalability": [ "Density" - ], + ], "scheduling": [ - "DisruptionController", - "NoExecuteTaintManager", + "DisruptionController", + "NoExecuteTaintManager", "SchedulerPredicates" - ], + ], "storage": [ - "Dynamic", - "GCP", - "GKE local", - "PersistentVolumes", - "Pod Disks", - "Projected", + "Dynamic", + "GCP", + "GKE local", + "PersistentVolumes", + "Pod Disks", + "Projected", "Volume" - ], + ], "ui": [ "Kubernetes" ]