From ec68839a268c8c04dd34cc3124a2afd8da8295bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20K=C3=A4ldstr=C3=B6m?= Date: Fri, 4 Jan 2019 22:01:39 +0200 Subject: [PATCH 1/6] Create an initial skeleton k8s.io/component-base staging repo. Co-authored-by: @Klaven --- .../.github/PULL_REQUEST_TEMPLATE.md | 2 + .../src/k8s.io/component-base/CONTRIBUTING.md | 7 + .../src/k8s.io/component-base/Godeps/OWNERS | 2 + .../src/k8s.io/component-base/Godeps/Readme | 5 + staging/src/k8s.io/component-base/LICENSE | 202 ++++++++++++++++++ staging/src/k8s.io/component-base/OWNERS | 15 ++ staging/src/k8s.io/component-base/README.md | 34 +++ .../k8s.io/component-base/SECURITY_CONTACTS | 17 ++ .../k8s.io/component-base/code-of-conduct.md | 3 + vendor/k8s.io/component-base | 1 + 10 files changed, 288 insertions(+) create mode 100644 staging/src/k8s.io/component-base/.github/PULL_REQUEST_TEMPLATE.md create mode 100644 staging/src/k8s.io/component-base/CONTRIBUTING.md create mode 100644 staging/src/k8s.io/component-base/Godeps/OWNERS create mode 100644 staging/src/k8s.io/component-base/Godeps/Readme create mode 100644 staging/src/k8s.io/component-base/LICENSE create mode 100644 staging/src/k8s.io/component-base/OWNERS create mode 100644 staging/src/k8s.io/component-base/README.md create mode 100644 staging/src/k8s.io/component-base/SECURITY_CONTACTS create mode 100644 staging/src/k8s.io/component-base/code-of-conduct.md create mode 120000 vendor/k8s.io/component-base diff --git a/staging/src/k8s.io/component-base/.github/PULL_REQUEST_TEMPLATE.md b/staging/src/k8s.io/component-base/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000..e7e5eb834b --- /dev/null +++ b/staging/src/k8s.io/component-base/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,2 @@ +Sorry, we do not accept changes directly against this repository. Please see +CONTRIBUTING.md for information on where and how to contribute instead. diff --git a/staging/src/k8s.io/component-base/CONTRIBUTING.md b/staging/src/k8s.io/component-base/CONTRIBUTING.md new file mode 100644 index 0000000000..3b98c63f6b --- /dev/null +++ b/staging/src/k8s.io/component-base/CONTRIBUTING.md @@ -0,0 +1,7 @@ +# Contributing guidelines + +Do not open pull requests directly against this repository, they will be ignored. Instead, please open pull requests against [kubernetes/kubernetes](https://git.k8s.io/kubernetes/). Please follow the same [contributing guide](https://git.k8s.io/kubernetes/CONTRIBUTING.md) you would follow for any other pull request made to kubernetes/kubernetes. + +This repository is published from [kubernetes/kubernetes/staging/src/k8s.io/component-base](https://git.k8s.io/kubernetes/staging/src/k8s.io/component-base) by the [kubernetes publishing-bot](https://git.k8s.io/publishing-bot). + +Please see [Staging Directory and Publishing](https://git.k8s.io/community/contributors/devel/staging.md) for more information diff --git a/staging/src/k8s.io/component-base/Godeps/OWNERS b/staging/src/k8s.io/component-base/Godeps/OWNERS new file mode 100644 index 0000000000..3d49f30605 --- /dev/null +++ b/staging/src/k8s.io/component-base/Godeps/OWNERS @@ -0,0 +1,2 @@ +approvers: +- dep-approvers diff --git a/staging/src/k8s.io/component-base/Godeps/Readme b/staging/src/k8s.io/component-base/Godeps/Readme new file mode 100644 index 0000000000..4cdaa53d56 --- /dev/null +++ b/staging/src/k8s.io/component-base/Godeps/Readme @@ -0,0 +1,5 @@ +This directory tree is generated automatically by godep. + +Please do not edit. + +See https://github.com/tools/godep for more information. diff --git a/staging/src/k8s.io/component-base/LICENSE b/staging/src/k8s.io/component-base/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/staging/src/k8s.io/component-base/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/staging/src/k8s.io/component-base/OWNERS b/staging/src/k8s.io/component-base/OWNERS new file mode 100644 index 0000000000..45b975e4de --- /dev/null +++ b/staging/src/k8s.io/component-base/OWNERS @@ -0,0 +1,15 @@ +approvers: +- luxas +- sttts +- jbeda +- lavalamp +reviewers: +- luxas +- sttts +- stewart-yu +- dims +- dixudx +- rosti +labels: +- sig/cluster-lifecycle +- sig/api-machinery diff --git a/staging/src/k8s.io/component-base/README.md b/staging/src/k8s.io/component-base/README.md new file mode 100644 index 0000000000..59d6c704a4 --- /dev/null +++ b/staging/src/k8s.io/component-base/README.md @@ -0,0 +1,34 @@ +## component-base + +## Purpose + +Implement KEP 32: https://github.com/kubernetes/enhancements/blob/master/keps/sig-cluster-lifecycle/0032-create-a-k8s-io-component-repo.md + +The proposal is essentially about refactoring the Kubernetes core package structure in a way that all core components may share common code around: + - ComponentConfig implementation + - flag and command handling + - HTTPS serving + - delegated authn/z + - logging. + +## Compatibility + +There are *NO compatibility guarantees* for this repository, yet. It is in direct support of Kubernetes, so branches +will track Kubernetes and be compatible with that repo. As we more cleanly separate the layers, we will review the +compatibility guarantee. We have a goal to make this easier to use in the future. + + +## Where does it come from? + +This repository is synced from https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/component-base. +Code changes are made in that location, merged into `k8s.io/kubernetes` and later synced here. + +## Things you should *NOT* do + + 1. Directly modify any files in this repo. Those are driven from `k8s.io/kubernetes/staging/src/k8s.io/component-base`. + 2. Expect compatibility. This repo is changing quickly in direct support of Kubernetes. + +### OWNERS + +WG Component Standard is working on this refactoring process, which is happening incrementally, starting in the v1.14 cycle. +SIG API Machinery and SIG Cluster Lifecycle owns the code. diff --git a/staging/src/k8s.io/component-base/SECURITY_CONTACTS b/staging/src/k8s.io/component-base/SECURITY_CONTACTS new file mode 100644 index 0000000000..69eea9ee8e --- /dev/null +++ b/staging/src/k8s.io/component-base/SECURITY_CONTACTS @@ -0,0 +1,17 @@ +# Defined below are the security contacts for this repo. +# +# They are the contact point for the Product Security Team to reach out +# to for triaging and handling of incoming issues. +# +# The below names agree to abide by the +# [Embargo Policy](https://github.com/kubernetes/sig-release/blob/master/security-release-process-documentation/security-release-process.md#embargo-policy) +# and will be removed and replaced if they violate that agreement. +# +# DO NOT REPORT SECURITY VULNERABILITIES DIRECTLY TO THESE NAMES, FOLLOW THE +# INSTRUCTIONS AT https://kubernetes.io/security/ + +cjcullen +liggitt +luxas +sttts +tallclair diff --git a/staging/src/k8s.io/component-base/code-of-conduct.md b/staging/src/k8s.io/component-base/code-of-conduct.md new file mode 100644 index 0000000000..0d15c00cf3 --- /dev/null +++ b/staging/src/k8s.io/component-base/code-of-conduct.md @@ -0,0 +1,3 @@ +# Kubernetes Community Code of Conduct + +Please refer to our [Kubernetes Community Code of Conduct](https://git.k8s.io/community/code-of-conduct.md) diff --git a/vendor/k8s.io/component-base b/vendor/k8s.io/component-base new file mode 120000 index 0000000000..8c549e4d2d --- /dev/null +++ b/vendor/k8s.io/component-base @@ -0,0 +1 @@ +../../staging/src/k8s.io/component-base \ No newline at end of file From 2e52d5c3311d3dcfd042e81570ef138645de529a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20K=C3=A4ldstr=C3=B6m?= Date: Sun, 6 Jan 2019 13:57:47 +0200 Subject: [PATCH 2/6] Move k8s.io/{apiserver,apimachinery}/pkg/apis/config to k8s.io/component-base/config. Co-authored-by @Klaven --- .../apimachinery/pkg/apis/config/OWNERS | 7 -- .../apimachinery/pkg/apis/config/types.go | 33 -------- .../pkg/apis/config/v1alpha1/BUILD | 36 --------- .../pkg/apis/config/v1alpha1/conversion.go | 37 --------- .../pkg/apis/config/v1alpha1/defaults.go | 38 ---------- .../pkg/apis/config/v1alpha1/doc.go | 20 ----- .../pkg/apis/config/v1alpha1/types.go | 33 -------- .../v1alpha1/zz_generated.conversion.go | 75 ------------------- .../config/v1alpha1/zz_generated.deepcopy.go | 37 --------- .../pkg/apis/config/validation/BUILD | 37 --------- .../pkg/apis/config/validation/validation.go | 31 -------- .../apis/config/validation/validation_test.go | 66 ---------------- .../k8s.io/apiserver/pkg/apis/config/BUILD | 2 - .../k8s.io/apiserver/pkg/apis/config/types.go | 37 --------- .../pkg/apis/config/v1alpha1/register.go | 31 -------- .../pkg/apis/config/zz_generated.deepcopy.go | 35 --------- .../pkg/apis => component-base}/config/BUILD | 9 ++- .../src/k8s.io/component-base/config/OWNERS | 12 +++ .../pkg/apis => component-base}/config/doc.go | 2 +- .../src/k8s.io/component-base/config/types.go | 74 ++++++++++++++++++ .../config/v1alpha1/BUILD | 6 +- .../config/v1alpha1/conversion.go | 10 ++- .../config/v1alpha1/defaults.go | 21 ++++++ .../config/v1alpha1/doc.go | 4 +- .../config/v1alpha1/register.go | 0 .../config/v1alpha1/types.go | 16 ++++ .../v1alpha1/zz_generated.conversion.go | 40 +++++++++- .../config/v1alpha1/zz_generated.deepcopy.go | 16 ++++ .../config/validation/BUILD | 8 +- .../config/validation/validation.go | 11 ++- .../config/validation/validation_test.go | 50 ++++++++++++- .../config/zz_generated.deepcopy.go | 35 +++++++++ 32 files changed, 294 insertions(+), 575 deletions(-) delete mode 100644 staging/src/k8s.io/apimachinery/pkg/apis/config/OWNERS delete mode 100644 staging/src/k8s.io/apimachinery/pkg/apis/config/types.go delete mode 100644 staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/BUILD delete mode 100644 staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/conversion.go delete mode 100644 staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/defaults.go delete mode 100644 staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/doc.go delete mode 100644 staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/types.go delete mode 100644 staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/zz_generated.conversion.go delete mode 100644 staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/zz_generated.deepcopy.go delete mode 100644 staging/src/k8s.io/apimachinery/pkg/apis/config/validation/BUILD delete mode 100644 staging/src/k8s.io/apimachinery/pkg/apis/config/validation/validation.go delete mode 100644 staging/src/k8s.io/apimachinery/pkg/apis/config/validation/validation_test.go delete mode 100644 staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1/register.go rename staging/src/k8s.io/{apimachinery/pkg/apis => component-base}/config/BUILD (59%) create mode 100644 staging/src/k8s.io/component-base/config/OWNERS rename staging/src/k8s.io/{apimachinery/pkg/apis => component-base}/config/doc.go (90%) create mode 100644 staging/src/k8s.io/component-base/config/types.go rename staging/src/k8s.io/{apiserver/pkg/apis => component-base}/config/v1alpha1/BUILD (80%) rename staging/src/k8s.io/{apiserver/pkg/apis => component-base}/config/v1alpha1/conversion.go (77%) rename staging/src/k8s.io/{apiserver/pkg/apis => component-base}/config/v1alpha1/defaults.go (66%) rename staging/src/k8s.io/{apiserver/pkg/apis => component-base}/config/v1alpha1/doc.go (82%) rename staging/src/k8s.io/{apimachinery/pkg/apis => component-base}/config/v1alpha1/register.go (100%) rename staging/src/k8s.io/{apiserver/pkg/apis => component-base}/config/v1alpha1/types.go (75%) rename staging/src/k8s.io/{apiserver/pkg/apis => component-base}/config/v1alpha1/zz_generated.conversion.go (70%) rename staging/src/k8s.io/{apiserver/pkg/apis => component-base}/config/v1alpha1/zz_generated.deepcopy.go (77%) rename staging/src/k8s.io/{apiserver/pkg/apis => component-base}/config/validation/BUILD (74%) rename staging/src/k8s.io/{apiserver/pkg/apis => component-base}/config/validation/validation.go (80%) rename staging/src/k8s.io/{apiserver/pkg/apis => component-base}/config/validation/validation_test.go (75%) rename staging/src/k8s.io/{apimachinery/pkg/apis => component-base}/config/zz_generated.deepcopy.go (51%) diff --git a/staging/src/k8s.io/apimachinery/pkg/apis/config/OWNERS b/staging/src/k8s.io/apimachinery/pkg/apis/config/OWNERS deleted file mode 100644 index 2f7b10df4b..0000000000 --- a/staging/src/k8s.io/apimachinery/pkg/apis/config/OWNERS +++ /dev/null @@ -1,7 +0,0 @@ -approvers: -- api-approvers -- sttts -- luxas -reviewers: -- api-reviewers -- hanxiaoshuai diff --git a/staging/src/k8s.io/apimachinery/pkg/apis/config/types.go b/staging/src/k8s.io/apimachinery/pkg/apis/config/types.go deleted file mode 100644 index b32fc8a281..0000000000 --- a/staging/src/k8s.io/apimachinery/pkg/apis/config/types.go +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright 2018 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 config - -// ClientConnectionConfiguration contains details for constructing a client. -type ClientConnectionConfiguration struct { - // kubeconfig is the path to a KubeConfig file. - Kubeconfig string - // acceptContentTypes defines the Accept header sent by clients when connecting to a server, overriding the - // default value of 'application/json'. This field will control all connections to the server used by a particular - // client. - AcceptContentTypes string - // contentType is the content type used when sending data to the server from this client. - ContentType string - // qps controls the number of queries per second allowed for this connection. - QPS float32 - // burst allows extra queries to accumulate when a client is exceeding its rate. - Burst int32 -} diff --git a/staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/BUILD b/staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/BUILD deleted file mode 100644 index 576f861b27..0000000000 --- a/staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/BUILD +++ /dev/null @@ -1,36 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = [ - "conversion.go", - "defaults.go", - "doc.go", - "register.go", - "types.go", - "zz_generated.conversion.go", - "zz_generated.deepcopy.go", - ], - importmap = "k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/apis/config/v1alpha1", - importpath = "k8s.io/apimachinery/pkg/apis/config/v1alpha1", - visibility = ["//visibility:public"], - deps = [ - "//staging/src/k8s.io/apimachinery/pkg/apis/config:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/conversion:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], - visibility = ["//visibility:public"], -) diff --git a/staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/conversion.go b/staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/conversion.go deleted file mode 100644 index 7e7d34795e..0000000000 --- a/staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/conversion.go +++ /dev/null @@ -1,37 +0,0 @@ -/* -Copyright 2018 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 v1alpha1 - -import ( - "k8s.io/apimachinery/pkg/apis/config" - "k8s.io/apimachinery/pkg/conversion" -) - -// Important! The public back-and-forth conversion functions for the types in this generic -// package with ComponentConfig types need to be manually exposed like this in order for -// other packages that reference this package to be able to call these conversion functions -// in an autogenerated manner. -// TODO: Fix the bug in conversion-gen so it automatically discovers these Convert_* functions -// in autogenerated code as well. - -func Convert_v1alpha1_ClientConnectionConfiguration_To_config_ClientConnectionConfiguration(in *ClientConnectionConfiguration, out *config.ClientConnectionConfiguration, s conversion.Scope) error { - return autoConvert_v1alpha1_ClientConnectionConfiguration_To_config_ClientConnectionConfiguration(in, out, s) -} - -func Convert_config_ClientConnectionConfiguration_To_v1alpha1_ClientConnectionConfiguration(in *config.ClientConnectionConfiguration, out *ClientConnectionConfiguration, s conversion.Scope) error { - return autoConvert_config_ClientConnectionConfiguration_To_v1alpha1_ClientConnectionConfiguration(in, out, s) -} diff --git a/staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/defaults.go b/staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/defaults.go deleted file mode 100644 index 37971fcc5c..0000000000 --- a/staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/defaults.go +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright 2018 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 v1alpha1 - -// RecommendedDefaultClientConnectionConfiguration defaults a pointer to a -// ClientConnectionConfiguration struct. This will set the recommended default -// values, but they may be subject to change between API versions. This function -// is intentionally not registered in the scheme as a "normal" `SetDefaults_Foo` -// function to allow consumers of this type to set whatever defaults for their -// embedded configs. Forcing consumers to use these defaults would be problematic -// as defaulting in the scheme is done as part of the conversion, and there would -// be no easy way to opt-out. Instead, if you want to use this defaulting method -// run it in your wrapper struct of this type in its `SetDefaults_` method. -func RecommendedDefaultClientConnectionConfiguration(obj *ClientConnectionConfiguration) { - if len(obj.ContentType) == 0 { - obj.ContentType = "application/vnd.kubernetes.protobuf" - } - if obj.QPS == 0.0 { - obj.QPS = 50.0 - } - if obj.Burst == 0 { - obj.Burst = 100 - } -} diff --git a/staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/doc.go b/staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/doc.go deleted file mode 100644 index ce0a58a571..0000000000 --- a/staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 2018 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. -*/ - -// +k8s:deepcopy-gen=package -// +k8s:conversion-gen=k8s.io/apimachinery/pkg/apis/config - -package v1alpha1 // import "k8s.io/apimachinery/pkg/apis/config/v1alpha1" diff --git a/staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/types.go b/staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/types.go deleted file mode 100644 index b762c4f0bb..0000000000 --- a/staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/types.go +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright 2018 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 v1alpha1 - -// ClientConnectionConfiguration contains details for constructing a client. -type ClientConnectionConfiguration struct { - // kubeconfig is the path to a KubeConfig file. - Kubeconfig string `json:"kubeconfig"` - // acceptContentTypes defines the Accept header sent by clients when connecting to a server, overriding the - // default value of 'application/json'. This field will control all connections to the server used by a particular - // client. - AcceptContentTypes string `json:"acceptContentTypes"` - // contentType is the content type used when sending data to the server from this client. - ContentType string `json:"contentType"` - // qps controls the number of queries per second allowed for this connection. - QPS float32 `json:"qps"` - // burst allows extra queries to accumulate when a client is exceeding its rate. - Burst int32 `json:"burst"` -} diff --git a/staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/zz_generated.conversion.go b/staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/zz_generated.conversion.go deleted file mode 100644 index 4cea203cc4..0000000000 --- a/staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/zz_generated.conversion.go +++ /dev/null @@ -1,75 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright 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. -*/ - -// Code generated by conversion-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - config "k8s.io/apimachinery/pkg/apis/config" - conversion "k8s.io/apimachinery/pkg/conversion" - runtime "k8s.io/apimachinery/pkg/runtime" -) - -func init() { - localSchemeBuilder.Register(RegisterConversions) -} - -// RegisterConversions adds conversion functions to the given scheme. -// Public to allow building arbitrary schemes. -func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*ClientConnectionConfiguration)(nil), (*config.ClientConnectionConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_ClientConnectionConfiguration_To_config_ClientConnectionConfiguration(a.(*ClientConnectionConfiguration), b.(*config.ClientConnectionConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*config.ClientConnectionConfiguration)(nil), (*ClientConnectionConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_config_ClientConnectionConfiguration_To_v1alpha1_ClientConnectionConfiguration(a.(*config.ClientConnectionConfiguration), b.(*ClientConnectionConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*config.ClientConnectionConfiguration)(nil), (*ClientConnectionConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_config_ClientConnectionConfiguration_To_v1alpha1_ClientConnectionConfiguration(a.(*config.ClientConnectionConfiguration), b.(*ClientConnectionConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*ClientConnectionConfiguration)(nil), (*config.ClientConnectionConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_ClientConnectionConfiguration_To_config_ClientConnectionConfiguration(a.(*ClientConnectionConfiguration), b.(*config.ClientConnectionConfiguration), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_v1alpha1_ClientConnectionConfiguration_To_config_ClientConnectionConfiguration(in *ClientConnectionConfiguration, out *config.ClientConnectionConfiguration, s conversion.Scope) error { - out.Kubeconfig = in.Kubeconfig - out.AcceptContentTypes = in.AcceptContentTypes - out.ContentType = in.ContentType - out.QPS = in.QPS - out.Burst = in.Burst - return nil -} - -func autoConvert_config_ClientConnectionConfiguration_To_v1alpha1_ClientConnectionConfiguration(in *config.ClientConnectionConfiguration, out *ClientConnectionConfiguration, s conversion.Scope) error { - out.Kubeconfig = in.Kubeconfig - out.AcceptContentTypes = in.AcceptContentTypes - out.ContentType = in.ContentType - out.QPS = in.QPS - out.Burst = in.Burst - return nil -} diff --git a/staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/zz_generated.deepcopy.go b/staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/zz_generated.deepcopy.go deleted file mode 100644 index d03adfbff9..0000000000 --- a/staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/zz_generated.deepcopy.go +++ /dev/null @@ -1,37 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright 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. -*/ - -// Code generated by deepcopy-gen. DO NOT EDIT. - -package v1alpha1 - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClientConnectionConfiguration) DeepCopyInto(out *ClientConnectionConfiguration) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClientConnectionConfiguration. -func (in *ClientConnectionConfiguration) DeepCopy() *ClientConnectionConfiguration { - if in == nil { - return nil - } - out := new(ClientConnectionConfiguration) - in.DeepCopyInto(out) - return out -} diff --git a/staging/src/k8s.io/apimachinery/pkg/apis/config/validation/BUILD b/staging/src/k8s.io/apimachinery/pkg/apis/config/validation/BUILD deleted file mode 100644 index f84ca74498..0000000000 --- a/staging/src/k8s.io/apimachinery/pkg/apis/config/validation/BUILD +++ /dev/null @@ -1,37 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "go_default_library", - srcs = ["validation.go"], - importmap = "k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/apis/config/validation", - importpath = "k8s.io/apimachinery/pkg/apis/config/validation", - visibility = ["//visibility:public"], - deps = [ - "//staging/src/k8s.io/apimachinery/pkg/apis/config:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/util/validation/field:go_default_library", - ], -) - -go_test( - name = "go_default_test", - srcs = ["validation_test.go"], - embed = [":go_default_library"], - deps = [ - "//staging/src/k8s.io/apimachinery/pkg/apis/config:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/util/validation/field:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], - visibility = ["//visibility:public"], -) diff --git a/staging/src/k8s.io/apimachinery/pkg/apis/config/validation/validation.go b/staging/src/k8s.io/apimachinery/pkg/apis/config/validation/validation.go deleted file mode 100644 index dba3767744..0000000000 --- a/staging/src/k8s.io/apimachinery/pkg/apis/config/validation/validation.go +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright 2018 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 validation - -import ( - "k8s.io/apimachinery/pkg/apis/config" - "k8s.io/apimachinery/pkg/util/validation/field" -) - -// ValidateClientConnectionConfiguration ensures validation of the ClientConnectionConfiguration struct -func ValidateClientConnectionConfiguration(cc *config.ClientConnectionConfiguration, fldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - if cc.Burst < 0 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("burst"), cc.Burst, "must be non-negative")) - } - return allErrs -} diff --git a/staging/src/k8s.io/apimachinery/pkg/apis/config/validation/validation_test.go b/staging/src/k8s.io/apimachinery/pkg/apis/config/validation/validation_test.go deleted file mode 100644 index dfa0376740..0000000000 --- a/staging/src/k8s.io/apimachinery/pkg/apis/config/validation/validation_test.go +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright 2018 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 validation - -import ( - "k8s.io/apimachinery/pkg/apis/config" - "k8s.io/apimachinery/pkg/util/validation/field" - "testing" -) - -func TestValidateClientConnectionConfiguration(t *testing.T) { - validConfig := &config.ClientConnectionConfiguration{ - AcceptContentTypes: "application/json", - ContentType: "application/json", - QPS: 10, - Burst: 10, - } - - qpsLessThanZero := validConfig.DeepCopy() - qpsLessThanZero.QPS = -1 - - burstLessThanZero := validConfig.DeepCopy() - burstLessThanZero.Burst = -1 - - scenarios := map[string]struct { - expectedToFail bool - config *config.ClientConnectionConfiguration - }{ - "good": { - expectedToFail: false, - config: validConfig, - }, - "good-qps-less-than-zero": { - expectedToFail: false, - config: qpsLessThanZero, - }, - "bad-burst-less-then-zero": { - expectedToFail: true, - config: burstLessThanZero, - }, - } - - for name, scenario := range scenarios { - errs := ValidateClientConnectionConfiguration(scenario.config, field.NewPath("clientConnectionConfiguration")) - if len(errs) == 0 && scenario.expectedToFail { - t.Errorf("Unexpected success for scenario: %s", name) - } - if len(errs) > 0 && !scenario.expectedToFail { - t.Errorf("Unexpected failure for scenario: %s - %+v", name, errs) - } - } -} diff --git a/staging/src/k8s.io/apiserver/pkg/apis/config/BUILD b/staging/src/k8s.io/apiserver/pkg/apis/config/BUILD index feaa8a3c37..ce25409aaa 100644 --- a/staging/src/k8s.io/apiserver/pkg/apis/config/BUILD +++ b/staging/src/k8s.io/apiserver/pkg/apis/config/BUILD @@ -30,8 +30,6 @@ filegroup( srcs = [ ":package-srcs", "//staging/src/k8s.io/apiserver/pkg/apis/config/v1:all-srcs", - "//staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1:all-srcs", - "//staging/src/k8s.io/apiserver/pkg/apis/config/validation:all-srcs", ], tags = ["automanaged"], visibility = ["//visibility:public"], diff --git a/staging/src/k8s.io/apiserver/pkg/apis/config/types.go b/staging/src/k8s.io/apiserver/pkg/apis/config/types.go index 822806d7e5..0b0d8254c0 100644 --- a/staging/src/k8s.io/apiserver/pkg/apis/config/types.go +++ b/staging/src/k8s.io/apiserver/pkg/apis/config/types.go @@ -20,43 +20,6 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// LeaderElectionConfiguration defines the configuration of leader election -// clients for components that can run with leader election enabled. -type LeaderElectionConfiguration struct { - // leaderElect enables a leader election client to gain leadership - // before executing the main loop. Enable this when running replicated - // components for high availability. - LeaderElect bool - // leaseDuration is the duration that non-leader candidates will wait - // after observing a leadership renewal until attempting to acquire - // leadership of a led but unrenewed leader slot. This is effectively the - // maximum duration that a leader can be stopped before it is replaced - // by another candidate. This is only applicable if leader election is - // enabled. - LeaseDuration metav1.Duration - // renewDeadline is the interval between attempts by the acting master to - // renew a leadership slot before it stops leading. This must be less - // than or equal to the lease duration. This is only applicable if leader - // election is enabled. - RenewDeadline metav1.Duration - // retryPeriod is the duration the clients should wait between attempting - // acquisition and renewal of a leadership. This is only applicable if - // leader election is enabled. - RetryPeriod metav1.Duration - // resourceLock indicates the resource object type that will be used to lock - // during leader election cycles. - ResourceLock string -} - -// DebuggingConfiguration holds configuration for Debugging related features. -type DebuggingConfiguration struct { - // enableProfiling enables profiling via web interface host:port/debug/pprof/ - EnableProfiling bool - // enableContentionProfiling enables lock contention profiling, if - // enableProfiling is true. - EnableContentionProfiling bool -} - // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // EncryptionConfiguration stores the complete configuration for encryption providers. diff --git a/staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1/register.go b/staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1/register.go deleted file mode 100644 index ddc186c9aa..0000000000 --- a/staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1/register.go +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright 2018 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 v1alpha1 - -import ( - "k8s.io/apimachinery/pkg/runtime" -) - -var ( - // SchemeBuilder is the scheme builder with scheme init functions to run for this API package - SchemeBuilder runtime.SchemeBuilder - // localSchemeBuilder extends the SchemeBuilder instance with the external types. In this package, - // defaulting and conversion init funcs are registered as well. - localSchemeBuilder = &SchemeBuilder - // AddToScheme is a global function that registers this API group & version to a scheme - AddToScheme = localSchemeBuilder.AddToScheme -) diff --git a/staging/src/k8s.io/apiserver/pkg/apis/config/zz_generated.deepcopy.go b/staging/src/k8s.io/apiserver/pkg/apis/config/zz_generated.deepcopy.go index 438dff997d..f5a16a51c4 100644 --- a/staging/src/k8s.io/apiserver/pkg/apis/config/zz_generated.deepcopy.go +++ b/staging/src/k8s.io/apiserver/pkg/apis/config/zz_generated.deepcopy.go @@ -45,22 +45,6 @@ func (in *AESConfiguration) DeepCopy() *AESConfiguration { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DebuggingConfiguration) DeepCopyInto(out *DebuggingConfiguration) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DebuggingConfiguration. -func (in *DebuggingConfiguration) DeepCopy() *DebuggingConfiguration { - if in == nil { - return nil - } - out := new(DebuggingConfiguration) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *EncryptionConfiguration) DeepCopyInto(out *EncryptionConfiguration) { *out = *in @@ -141,25 +125,6 @@ func (in *Key) DeepCopy() *Key { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LeaderElectionConfiguration) DeepCopyInto(out *LeaderElectionConfiguration) { - *out = *in - out.LeaseDuration = in.LeaseDuration - out.RenewDeadline = in.RenewDeadline - out.RetryPeriod = in.RetryPeriod - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LeaderElectionConfiguration. -func (in *LeaderElectionConfiguration) DeepCopy() *LeaderElectionConfiguration { - if in == nil { - return nil - } - out := new(LeaderElectionConfiguration) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ProviderConfiguration) DeepCopyInto(out *ProviderConfiguration) { *out = *in diff --git a/staging/src/k8s.io/apimachinery/pkg/apis/config/BUILD b/staging/src/k8s.io/component-base/config/BUILD similarity index 59% rename from staging/src/k8s.io/apimachinery/pkg/apis/config/BUILD rename to staging/src/k8s.io/component-base/config/BUILD index 45016d21ac..7301ed294d 100644 --- a/staging/src/k8s.io/apimachinery/pkg/apis/config/BUILD +++ b/staging/src/k8s.io/component-base/config/BUILD @@ -7,9 +7,10 @@ go_library( "types.go", "zz_generated.deepcopy.go", ], - importmap = "k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/apis/config", - importpath = "k8s.io/apimachinery/pkg/apis/config", + importmap = "k8s.io/kubernetes/vendor/k8s.io/component-base/config", + importpath = "k8s.io/component-base/config", visibility = ["//visibility:public"], + deps = ["//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library"], ) filegroup( @@ -23,8 +24,8 @@ filegroup( name = "all-srcs", srcs = [ ":package-srcs", - "//staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1:all-srcs", - "//staging/src/k8s.io/apimachinery/pkg/apis/config/validation:all-srcs", + "//staging/src/k8s.io/component-base/config/v1alpha1:all-srcs", + "//staging/src/k8s.io/component-base/config/validation:all-srcs", ], tags = ["automanaged"], visibility = ["//visibility:public"], diff --git a/staging/src/k8s.io/component-base/config/OWNERS b/staging/src/k8s.io/component-base/config/OWNERS new file mode 100644 index 0000000000..e0c2557b84 --- /dev/null +++ b/staging/src/k8s.io/component-base/config/OWNERS @@ -0,0 +1,12 @@ +# Disable inheritance as this is an api owners file +options: + no_parent_owners: true +approvers: +- api-approvers +reviewers: +- api-reviewers +- luxas +- mtaufen +- sttts +labels: +- kind/api-change diff --git a/staging/src/k8s.io/apimachinery/pkg/apis/config/doc.go b/staging/src/k8s.io/component-base/config/doc.go similarity index 90% rename from staging/src/k8s.io/apimachinery/pkg/apis/config/doc.go rename to staging/src/k8s.io/component-base/config/doc.go index d849c7aa3b..dd0a5a53a7 100644 --- a/staging/src/k8s.io/apimachinery/pkg/apis/config/doc.go +++ b/staging/src/k8s.io/component-base/config/doc.go @@ -16,4 +16,4 @@ limitations under the License. // +k8s:deepcopy-gen=package -package config // import "k8s.io/apimachinery/pkg/apis/config" +package config // import "k8s.io/component-base/config" diff --git a/staging/src/k8s.io/component-base/config/types.go b/staging/src/k8s.io/component-base/config/types.go new file mode 100644 index 0000000000..f0a20915cc --- /dev/null +++ b/staging/src/k8s.io/component-base/config/types.go @@ -0,0 +1,74 @@ +/* +Copyright 2018 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 config + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// ClientConnectionConfiguration contains details for constructing a client. +type ClientConnectionConfiguration struct { + // kubeconfig is the path to a KubeConfig file. + Kubeconfig string + // acceptContentTypes defines the Accept header sent by clients when connecting to a server, overriding the + // default value of 'application/json'. This field will control all connections to the server used by a particular + // client. + AcceptContentTypes string + // contentType is the content type used when sending data to the server from this client. + ContentType string + // qps controls the number of queries per second allowed for this connection. + QPS float32 + // burst allows extra queries to accumulate when a client is exceeding its rate. + Burst int32 +} + +// LeaderElectionConfiguration defines the configuration of leader election +// clients for components that can run with leader election enabled. +type LeaderElectionConfiguration struct { + // leaderElect enables a leader election client to gain leadership + // before executing the main loop. Enable this when running replicated + // components for high availability. + LeaderElect bool + // leaseDuration is the duration that non-leader candidates will wait + // after observing a leadership renewal until attempting to acquire + // leadership of a led but unrenewed leader slot. This is effectively the + // maximum duration that a leader can be stopped before it is replaced + // by another candidate. This is only applicable if leader election is + // enabled. + LeaseDuration metav1.Duration + // renewDeadline is the interval between attempts by the acting master to + // renew a leadership slot before it stops leading. This must be less + // than or equal to the lease duration. This is only applicable if leader + // election is enabled. + RenewDeadline metav1.Duration + // retryPeriod is the duration the clients should wait between attempting + // acquisition and renewal of a leadership. This is only applicable if + // leader election is enabled. + RetryPeriod metav1.Duration + // resourceLock indicates the resource object type that will be used to lock + // during leader election cycles. + ResourceLock string +} + +// DebuggingConfiguration holds configuration for Debugging related features. +type DebuggingConfiguration struct { + // enableProfiling enables profiling via web interface host:port/debug/pprof/ + EnableProfiling bool + // enableContentionProfiling enables lock contention profiling, if + // enableProfiling is true. + EnableContentionProfiling bool +} diff --git a/staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1/BUILD b/staging/src/k8s.io/component-base/config/v1alpha1/BUILD similarity index 80% rename from staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1/BUILD rename to staging/src/k8s.io/component-base/config/v1alpha1/BUILD index 067f019c66..d6deae7a9b 100644 --- a/staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1/BUILD +++ b/staging/src/k8s.io/component-base/config/v1alpha1/BUILD @@ -11,14 +11,14 @@ go_library( "zz_generated.conversion.go", "zz_generated.deepcopy.go", ], - importmap = "k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/apis/config/v1alpha1", - importpath = "k8s.io/apiserver/pkg/apis/config/v1alpha1", + importmap = "k8s.io/kubernetes/vendor/k8s.io/component-base/config/v1alpha1", + importpath = "k8s.io/component-base/config/v1alpha1", visibility = ["//visibility:public"], deps = [ "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/conversion:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", - "//staging/src/k8s.io/apiserver/pkg/apis/config:go_default_library", + "//staging/src/k8s.io/component-base/config:go_default_library", "//vendor/k8s.io/utils/pointer:go_default_library", ], ) diff --git a/staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1/conversion.go b/staging/src/k8s.io/component-base/config/v1alpha1/conversion.go similarity index 77% rename from staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1/conversion.go rename to staging/src/k8s.io/component-base/config/v1alpha1/conversion.go index 75190ad161..e2951e310d 100644 --- a/staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1/conversion.go +++ b/staging/src/k8s.io/component-base/config/v1alpha1/conversion.go @@ -18,7 +18,7 @@ package v1alpha1 import ( "k8s.io/apimachinery/pkg/conversion" - "k8s.io/apiserver/pkg/apis/config" + "k8s.io/component-base/config" ) // Important! The public back-and-forth conversion functions for the types in this generic @@ -28,6 +28,14 @@ import ( // TODO: Fix the bug in conversion-gen so it automatically discovers these Convert_* functions // in autogenerated code as well. +func Convert_v1alpha1_ClientConnectionConfiguration_To_config_ClientConnectionConfiguration(in *ClientConnectionConfiguration, out *config.ClientConnectionConfiguration, s conversion.Scope) error { + return autoConvert_v1alpha1_ClientConnectionConfiguration_To_config_ClientConnectionConfiguration(in, out, s) +} + +func Convert_config_ClientConnectionConfiguration_To_v1alpha1_ClientConnectionConfiguration(in *config.ClientConnectionConfiguration, out *ClientConnectionConfiguration, s conversion.Scope) error { + return autoConvert_config_ClientConnectionConfiguration_To_v1alpha1_ClientConnectionConfiguration(in, out, s) +} + func Convert_v1alpha1_DebuggingConfiguration_To_config_DebuggingConfiguration(in *DebuggingConfiguration, out *config.DebuggingConfiguration, s conversion.Scope) error { return autoConvert_v1alpha1_DebuggingConfiguration_To_config_DebuggingConfiguration(in, out, s) } diff --git a/staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1/defaults.go b/staging/src/k8s.io/component-base/config/v1alpha1/defaults.go similarity index 66% rename from staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1/defaults.go rename to staging/src/k8s.io/component-base/config/v1alpha1/defaults.go index caee3d8e49..caeb869a37 100644 --- a/staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1/defaults.go +++ b/staging/src/k8s.io/component-base/config/v1alpha1/defaults.go @@ -50,3 +50,24 @@ func RecommendedDefaultLeaderElectionConfiguration(obj *LeaderElectionConfigurat obj.LeaderElect = utilpointer.BoolPtr(true) } } + +// RecommendedDefaultClientConnectionConfiguration defaults a pointer to a +// ClientConnectionConfiguration struct. This will set the recommended default +// values, but they may be subject to change between API versions. This function +// is intentionally not registered in the scheme as a "normal" `SetDefaults_Foo` +// function to allow consumers of this type to set whatever defaults for their +// embedded configs. Forcing consumers to use these defaults would be problematic +// as defaulting in the scheme is done as part of the conversion, and there would +// be no easy way to opt-out. Instead, if you want to use this defaulting method +// run it in your wrapper struct of this type in its `SetDefaults_` method. +func RecommendedDefaultClientConnectionConfiguration(obj *ClientConnectionConfiguration) { + if len(obj.ContentType) == 0 { + obj.ContentType = "application/vnd.kubernetes.protobuf" + } + if obj.QPS == 0.0 { + obj.QPS = 50.0 + } + if obj.Burst == 0 { + obj.Burst = 100 + } +} diff --git a/staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1/doc.go b/staging/src/k8s.io/component-base/config/v1alpha1/doc.go similarity index 82% rename from staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1/doc.go rename to staging/src/k8s.io/component-base/config/v1alpha1/doc.go index a7492964ef..3cd4f4292e 100644 --- a/staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1/doc.go +++ b/staging/src/k8s.io/component-base/config/v1alpha1/doc.go @@ -15,6 +15,6 @@ limitations under the License. */ // +k8s:deepcopy-gen=package -// +k8s:conversion-gen=k8s.io/apiserver/pkg/apis/config +// +k8s:conversion-gen=k8s.io/component-base/config -package v1alpha1 // import "k8s.io/apiserver/pkg/apis/config/v1alpha1" +package v1alpha1 // import "k8s.io/component-base/config/v1alpha1" diff --git a/staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/register.go b/staging/src/k8s.io/component-base/config/v1alpha1/register.go similarity index 100% rename from staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/register.go rename to staging/src/k8s.io/component-base/config/v1alpha1/register.go diff --git a/staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1/types.go b/staging/src/k8s.io/component-base/config/v1alpha1/types.go similarity index 75% rename from staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1/types.go rename to staging/src/k8s.io/component-base/config/v1alpha1/types.go index f5ca97151a..d5a0391a20 100644 --- a/staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1/types.go +++ b/staging/src/k8s.io/component-base/config/v1alpha1/types.go @@ -58,3 +58,19 @@ type DebuggingConfiguration struct { // enableProfiling is true. EnableContentionProfiling bool `json:"enableContentionProfiling"` } + +// ClientConnectionConfiguration contains details for constructing a client. +type ClientConnectionConfiguration struct { + // kubeconfig is the path to a KubeConfig file. + Kubeconfig string `json:"kubeconfig"` + // acceptContentTypes defines the Accept header sent by clients when connecting to a server, overriding the + // default value of 'application/json'. This field will control all connections to the server used by a particular + // client. + AcceptContentTypes string `json:"acceptContentTypes"` + // contentType is the content type used when sending data to the server from this client. + ContentType string `json:"contentType"` + // qps controls the number of queries per second allowed for this connection. + QPS float32 `json:"qps"` + // burst allows extra queries to accumulate when a client is exceeding its rate. + Burst int32 `json:"burst"` +} diff --git a/staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1/zz_generated.conversion.go b/staging/src/k8s.io/component-base/config/v1alpha1/zz_generated.conversion.go similarity index 70% rename from staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1/zz_generated.conversion.go rename to staging/src/k8s.io/component-base/config/v1alpha1/zz_generated.conversion.go index eaf2076ac4..55f0dac039 100644 --- a/staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1/zz_generated.conversion.go +++ b/staging/src/k8s.io/component-base/config/v1alpha1/zz_generated.conversion.go @@ -24,7 +24,7 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" - config "k8s.io/apiserver/pkg/apis/config" + config "k8s.io/component-base/config" ) func init() { @@ -34,6 +34,16 @@ func init() { // RegisterConversions adds conversion functions to the given scheme. // Public to allow building arbitrary schemes. func RegisterConversions(s *runtime.Scheme) error { + if err := s.AddGeneratedConversionFunc((*ClientConnectionConfiguration)(nil), (*config.ClientConnectionConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_ClientConnectionConfiguration_To_config_ClientConnectionConfiguration(a.(*ClientConnectionConfiguration), b.(*config.ClientConnectionConfiguration), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*config.ClientConnectionConfiguration)(nil), (*ClientConnectionConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_config_ClientConnectionConfiguration_To_v1alpha1_ClientConnectionConfiguration(a.(*config.ClientConnectionConfiguration), b.(*ClientConnectionConfiguration), scope) + }); err != nil { + return err + } if err := s.AddGeneratedConversionFunc((*DebuggingConfiguration)(nil), (*config.DebuggingConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha1_DebuggingConfiguration_To_config_DebuggingConfiguration(a.(*DebuggingConfiguration), b.(*config.DebuggingConfiguration), scope) }); err != nil { @@ -54,6 +64,11 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddConversionFunc((*config.ClientConnectionConfiguration)(nil), (*ClientConnectionConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_config_ClientConnectionConfiguration_To_v1alpha1_ClientConnectionConfiguration(a.(*config.ClientConnectionConfiguration), b.(*ClientConnectionConfiguration), scope) + }); err != nil { + return err + } if err := s.AddConversionFunc((*config.DebuggingConfiguration)(nil), (*DebuggingConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_config_DebuggingConfiguration_To_v1alpha1_DebuggingConfiguration(a.(*config.DebuggingConfiguration), b.(*DebuggingConfiguration), scope) }); err != nil { @@ -64,6 +79,11 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddConversionFunc((*ClientConnectionConfiguration)(nil), (*config.ClientConnectionConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_ClientConnectionConfiguration_To_config_ClientConnectionConfiguration(a.(*ClientConnectionConfiguration), b.(*config.ClientConnectionConfiguration), scope) + }); err != nil { + return err + } if err := s.AddConversionFunc((*DebuggingConfiguration)(nil), (*config.DebuggingConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha1_DebuggingConfiguration_To_config_DebuggingConfiguration(a.(*DebuggingConfiguration), b.(*config.DebuggingConfiguration), scope) }); err != nil { @@ -77,6 +97,24 @@ func RegisterConversions(s *runtime.Scheme) error { return nil } +func autoConvert_v1alpha1_ClientConnectionConfiguration_To_config_ClientConnectionConfiguration(in *ClientConnectionConfiguration, out *config.ClientConnectionConfiguration, s conversion.Scope) error { + out.Kubeconfig = in.Kubeconfig + out.AcceptContentTypes = in.AcceptContentTypes + out.ContentType = in.ContentType + out.QPS = in.QPS + out.Burst = in.Burst + return nil +} + +func autoConvert_config_ClientConnectionConfiguration_To_v1alpha1_ClientConnectionConfiguration(in *config.ClientConnectionConfiguration, out *ClientConnectionConfiguration, s conversion.Scope) error { + out.Kubeconfig = in.Kubeconfig + out.AcceptContentTypes = in.AcceptContentTypes + out.ContentType = in.ContentType + out.QPS = in.QPS + out.Burst = in.Burst + return nil +} + func autoConvert_v1alpha1_DebuggingConfiguration_To_config_DebuggingConfiguration(in *DebuggingConfiguration, out *config.DebuggingConfiguration, s conversion.Scope) error { out.EnableProfiling = in.EnableProfiling out.EnableContentionProfiling = in.EnableContentionProfiling diff --git a/staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1/zz_generated.deepcopy.go b/staging/src/k8s.io/component-base/config/v1alpha1/zz_generated.deepcopy.go similarity index 77% rename from staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1/zz_generated.deepcopy.go rename to staging/src/k8s.io/component-base/config/v1alpha1/zz_generated.deepcopy.go index f40bbe19af..e747afa99b 100644 --- a/staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1/zz_generated.deepcopy.go +++ b/staging/src/k8s.io/component-base/config/v1alpha1/zz_generated.deepcopy.go @@ -20,6 +20,22 @@ limitations under the License. package v1alpha1 +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClientConnectionConfiguration) DeepCopyInto(out *ClientConnectionConfiguration) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClientConnectionConfiguration. +func (in *ClientConnectionConfiguration) DeepCopy() *ClientConnectionConfiguration { + if in == nil { + return nil + } + out := new(ClientConnectionConfiguration) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DebuggingConfiguration) DeepCopyInto(out *DebuggingConfiguration) { *out = *in diff --git a/staging/src/k8s.io/apiserver/pkg/apis/config/validation/BUILD b/staging/src/k8s.io/component-base/config/validation/BUILD similarity index 74% rename from staging/src/k8s.io/apiserver/pkg/apis/config/validation/BUILD rename to staging/src/k8s.io/component-base/config/validation/BUILD index e66a553c3c..fe29ae9c5b 100644 --- a/staging/src/k8s.io/apiserver/pkg/apis/config/validation/BUILD +++ b/staging/src/k8s.io/component-base/config/validation/BUILD @@ -3,12 +3,12 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", srcs = ["validation.go"], - importmap = "k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/apis/config/validation", - importpath = "k8s.io/apiserver/pkg/apis/config/validation", + importmap = "k8s.io/kubernetes/vendor/k8s.io/component-base/config/validation", + importpath = "k8s.io/component-base/config/validation", visibility = ["//visibility:public"], deps = [ "//staging/src/k8s.io/apimachinery/pkg/util/validation/field:go_default_library", - "//staging/src/k8s.io/apiserver/pkg/apis/config:go_default_library", + "//staging/src/k8s.io/component-base/config:go_default_library", ], ) @@ -19,7 +19,7 @@ go_test( deps = [ "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/validation/field:go_default_library", - "//staging/src/k8s.io/apiserver/pkg/apis/config:go_default_library", + "//staging/src/k8s.io/component-base/config:go_default_library", ], ) diff --git a/staging/src/k8s.io/apiserver/pkg/apis/config/validation/validation.go b/staging/src/k8s.io/component-base/config/validation/validation.go similarity index 80% rename from staging/src/k8s.io/apiserver/pkg/apis/config/validation/validation.go rename to staging/src/k8s.io/component-base/config/validation/validation.go index 00cadf1013..6e66c0cec2 100644 --- a/staging/src/k8s.io/apiserver/pkg/apis/config/validation/validation.go +++ b/staging/src/k8s.io/component-base/config/validation/validation.go @@ -18,9 +18,18 @@ package validation import ( "k8s.io/apimachinery/pkg/util/validation/field" - "k8s.io/apiserver/pkg/apis/config" + "k8s.io/component-base/config" ) +// ValidateClientConnectionConfiguration ensures validation of the ClientConnectionConfiguration struct +func ValidateClientConnectionConfiguration(cc *config.ClientConnectionConfiguration, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + if cc.Burst < 0 { + allErrs = append(allErrs, field.Invalid(fldPath.Child("burst"), cc.Burst, "must be non-negative")) + } + return allErrs +} + // ValidateLeaderElectionConfiguration ensures validation of the LeaderElectionConfiguration struct func ValidateLeaderElectionConfiguration(cc *config.LeaderElectionConfiguration, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} diff --git a/staging/src/k8s.io/apiserver/pkg/apis/config/validation/validation_test.go b/staging/src/k8s.io/component-base/config/validation/validation_test.go similarity index 75% rename from staging/src/k8s.io/apiserver/pkg/apis/config/validation/validation_test.go rename to staging/src/k8s.io/component-base/config/validation/validation_test.go index b55c9fb1ba..628fc1094f 100644 --- a/staging/src/k8s.io/apiserver/pkg/apis/config/validation/validation_test.go +++ b/staging/src/k8s.io/component-base/config/validation/validation_test.go @@ -17,13 +17,57 @@ limitations under the License. package validation import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/validation/field" - "k8s.io/apiserver/pkg/apis/config" "testing" "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/validation/field" + "k8s.io/component-base/config" ) +func TestValidateClientConnectionConfiguration(t *testing.T) { + validConfig := &config.ClientConnectionConfiguration{ + AcceptContentTypes: "application/json", + ContentType: "application/json", + QPS: 10, + Burst: 10, + } + + qpsLessThanZero := validConfig.DeepCopy() + qpsLessThanZero.QPS = -1 + + burstLessThanZero := validConfig.DeepCopy() + burstLessThanZero.Burst = -1 + + scenarios := map[string]struct { + expectedToFail bool + config *config.ClientConnectionConfiguration + }{ + "good": { + expectedToFail: false, + config: validConfig, + }, + "good-qps-less-than-zero": { + expectedToFail: false, + config: qpsLessThanZero, + }, + "bad-burst-less-then-zero": { + expectedToFail: true, + config: burstLessThanZero, + }, + } + + for name, scenario := range scenarios { + errs := ValidateClientConnectionConfiguration(scenario.config, field.NewPath("clientConnectionConfiguration")) + if len(errs) == 0 && scenario.expectedToFail { + t.Errorf("Unexpected success for scenario: %s", name) + } + if len(errs) > 0 && !scenario.expectedToFail { + t.Errorf("Unexpected failure for scenario: %s - %+v", name, errs) + } + } +} + func TestValidateLeaderElectionConfiguration(t *testing.T) { validConfig := &config.LeaderElectionConfiguration{ ResourceLock: "configmap", diff --git a/staging/src/k8s.io/apimachinery/pkg/apis/config/zz_generated.deepcopy.go b/staging/src/k8s.io/component-base/config/zz_generated.deepcopy.go similarity index 51% rename from staging/src/k8s.io/apimachinery/pkg/apis/config/zz_generated.deepcopy.go rename to staging/src/k8s.io/component-base/config/zz_generated.deepcopy.go index f09beb0e38..9812234f13 100644 --- a/staging/src/k8s.io/apimachinery/pkg/apis/config/zz_generated.deepcopy.go +++ b/staging/src/k8s.io/component-base/config/zz_generated.deepcopy.go @@ -35,3 +35,38 @@ func (in *ClientConnectionConfiguration) DeepCopy() *ClientConnectionConfigurati in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DebuggingConfiguration) DeepCopyInto(out *DebuggingConfiguration) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DebuggingConfiguration. +func (in *DebuggingConfiguration) DeepCopy() *DebuggingConfiguration { + if in == nil { + return nil + } + out := new(DebuggingConfiguration) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LeaderElectionConfiguration) DeepCopyInto(out *LeaderElectionConfiguration) { + *out = *in + out.LeaseDuration = in.LeaseDuration + out.RenewDeadline = in.RenewDeadline + out.RetryPeriod = in.RetryPeriod + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LeaderElectionConfiguration. +func (in *LeaderElectionConfiguration) DeepCopy() *LeaderElectionConfiguration { + if in == nil { + return nil + } + out := new(LeaderElectionConfiguration) + in.DeepCopyInto(out) + return out +} From 0140c82c16ebd87a771393a4d39f47435b40c12d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20K=C3=A4ldstr=C3=B6m?= Date: Sun, 6 Jan 2019 14:01:26 +0200 Subject: [PATCH 3/6] Updated references from k8s.io/{apiserver,apimachinery} to the new k8s.io/component-base repo. Co-authored-by @Klaven --- .../app/apis/config/v1alpha1/doc.go | 3 +-- .../app/options/options_test.go | 11 +++++------ cmd/controller-manager/app/options/debugging.go | 4 ++-- cmd/controller-manager/app/options/generic.go | 7 +++---- cmd/controller-manager/app/serve.go | 4 ++-- .../app/options/options_test.go | 7 +++---- cmd/kube-proxy/app/server.go | 6 +++--- cmd/kube-proxy/app/server_test.go | 4 ++-- cmd/kube-scheduler/app/options/options.go | 4 ++-- cmd/kube-scheduler/app/options/options_test.go | 11 +++++------ pkg/client/leaderelectionconfig/config.go | 5 +++-- pkg/controller/apis/config/types.go | 9 ++++----- pkg/controller/apis/config/v1alpha1/defaults.go | 9 ++++----- pkg/proxy/apis/config/types.go | 4 ++-- pkg/proxy/apis/config/validation/validation.go | 4 ++-- pkg/proxy/apis/config/validation/validation_test.go | 8 ++++---- pkg/scheduler/apis/config/types.go | 11 +++++------ pkg/scheduler/apis/config/v1alpha1/defaults.go | 4 ++-- pkg/scheduler/apis/config/validation/validation.go | 7 +++---- .../apis/config/validation/validation_test.go | 7 +++---- .../kube-controller-manager/config/v1alpha1/types.go | 9 ++++----- .../src/k8s.io/kube-proxy/config/v1alpha1/types.go | 4 ++-- .../k8s.io/kube-scheduler/config/v1alpha1/types.go | 11 +++++------ 23 files changed, 71 insertions(+), 82 deletions(-) diff --git a/cmd/cloud-controller-manager/app/apis/config/v1alpha1/doc.go b/cmd/cloud-controller-manager/app/apis/config/v1alpha1/doc.go index 1779b1fad0..6522975cc1 100644 --- a/cmd/cloud-controller-manager/app/apis/config/v1alpha1/doc.go +++ b/cmd/cloud-controller-manager/app/apis/config/v1alpha1/doc.go @@ -21,8 +21,7 @@ limitations under the License. // +k8s:deepcopy-gen=package // +k8s:conversion-gen=k8s.io/kubernetes/cmd/cloud-controller-manager/app/apis/config -// +k8s:conversion-gen=k8s.io/apimachinery/pkg/apis/config/v1alpha1 -// +k8s:conversion-gen=k8s.io/apiserver/pkg/apis/config/v1alpha1 +// +k8s:conversion-gen=k8s.io/component-base/config/v1alpha1 // +k8s:conversion-gen=k8s.io/kubernetes/pkg/controller/apis/config/v1alpha1 // +k8s:openapi-gen=true // +k8s:defaulter-gen=TypeMeta diff --git a/cmd/cloud-controller-manager/app/options/options_test.go b/cmd/cloud-controller-manager/app/options/options_test.go index b9825bb235..fce64bb959 100644 --- a/cmd/cloud-controller-manager/app/options/options_test.go +++ b/cmd/cloud-controller-manager/app/options/options_test.go @@ -24,11 +24,10 @@ import ( "github.com/spf13/pflag" - apimachineryconfig "k8s.io/apimachinery/pkg/apis/config" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/diff" - apiserverconfig "k8s.io/apiserver/pkg/apis/config" apiserveroptions "k8s.io/apiserver/pkg/server/options" + componentbaseconfig "k8s.io/component-base/config" cmoptions "k8s.io/kubernetes/cmd/controller-manager/app/options" ) @@ -40,13 +39,13 @@ func TestDefaultFlags(t *testing.T) { Port: DefaultInsecureCloudControllerManagerPort, // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config Address: "0.0.0.0", // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config MinResyncPeriod: metav1.Duration{Duration: 12 * time.Hour}, - ClientConnection: apimachineryconfig.ClientConnectionConfiguration{ + ClientConnection: componentbaseconfig.ClientConnectionConfiguration{ ContentType: "application/vnd.kubernetes.protobuf", QPS: 20.0, Burst: 30, }, ControllerStartInterval: metav1.Duration{Duration: 0}, - LeaderElection: apiserverconfig.LeaderElectionConfiguration{ + LeaderElection: componentbaseconfig.LeaderElectionConfiguration{ ResourceLock: "endpoints", LeaderElect: true, LeaseDuration: metav1.Duration{Duration: 15 * time.Second}, @@ -158,13 +157,13 @@ func TestAddFlags(t *testing.T) { Port: DefaultInsecureCloudControllerManagerPort, // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config Address: "0.0.0.0", // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config MinResyncPeriod: metav1.Duration{Duration: 100 * time.Minute}, - ClientConnection: apimachineryconfig.ClientConnectionConfiguration{ + ClientConnection: componentbaseconfig.ClientConnectionConfiguration{ ContentType: "application/vnd.kubernetes.protobuf", QPS: 50.0, Burst: 100, }, ControllerStartInterval: metav1.Duration{Duration: 2 * time.Minute}, - LeaderElection: apiserverconfig.LeaderElectionConfiguration{ + LeaderElection: componentbaseconfig.LeaderElectionConfiguration{ ResourceLock: "configmap", LeaderElect: false, LeaseDuration: metav1.Duration{Duration: 30 * time.Second}, diff --git a/cmd/controller-manager/app/options/debugging.go b/cmd/controller-manager/app/options/debugging.go index e459b6d452..10271eabd2 100644 --- a/cmd/controller-manager/app/options/debugging.go +++ b/cmd/controller-manager/app/options/debugging.go @@ -19,7 +19,7 @@ package options import ( "github.com/spf13/pflag" - apiserverconfig "k8s.io/apiserver/pkg/apis/config" + componentbaseconfig "k8s.io/component-base/config" ) // DebuggingOptions holds the Debugging options. @@ -41,7 +41,7 @@ func (o *DebuggingOptions) AddFlags(fs *pflag.FlagSet) { } // ApplyTo fills up Debugging config with options. -func (o *DebuggingOptions) ApplyTo(cfg *apiserverconfig.DebuggingConfiguration) error { +func (o *DebuggingOptions) ApplyTo(cfg *componentbaseconfig.DebuggingConfiguration) error { if o == nil { return nil } diff --git a/cmd/controller-manager/app/options/generic.go b/cmd/controller-manager/app/options/generic.go index 3056038f40..2089c7179f 100644 --- a/cmd/controller-manager/app/options/generic.go +++ b/cmd/controller-manager/app/options/generic.go @@ -20,11 +20,10 @@ import ( "fmt" "strings" - apimachineryconfig "k8s.io/apimachinery/pkg/apis/config" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/sets" - apiserverconfig "k8s.io/apiserver/pkg/apis/config" apiserverflag "k8s.io/apiserver/pkg/util/flag" + componentbaseconfig "k8s.io/component-base/config" "k8s.io/kubernetes/pkg/client/leaderelectionconfig" kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config" ) @@ -34,9 +33,9 @@ type GenericControllerManagerConfigurationOptions struct { Port int32 Address string MinResyncPeriod metav1.Duration - ClientConnection apimachineryconfig.ClientConnectionConfiguration + ClientConnection componentbaseconfig.ClientConnectionConfiguration ControllerStartInterval metav1.Duration - LeaderElection apiserverconfig.LeaderElectionConfiguration + LeaderElection componentbaseconfig.LeaderElectionConfiguration Debugging *DebuggingOptions Controllers []string } diff --git a/cmd/controller-manager/app/serve.go b/cmd/controller-manager/app/serve.go index 37fd22199d..c0e507b7ac 100644 --- a/cmd/controller-manager/app/serve.go +++ b/cmd/controller-manager/app/serve.go @@ -21,7 +21,6 @@ import ( "net/http" goruntime "runtime" - apiserverconfig "k8s.io/apiserver/pkg/apis/config" genericapifilters "k8s.io/apiserver/pkg/endpoints/filters" apirequest "k8s.io/apiserver/pkg/endpoints/request" apiserver "k8s.io/apiserver/pkg/server" @@ -29,6 +28,7 @@ import ( "k8s.io/apiserver/pkg/server/healthz" "k8s.io/apiserver/pkg/server/mux" "k8s.io/apiserver/pkg/server/routes" + componentbaseconfig "k8s.io/component-base/config" "k8s.io/kubernetes/pkg/api/legacyscheme" "k8s.io/kubernetes/pkg/util/configz" ) @@ -52,7 +52,7 @@ func BuildHandlerChain(apiHandler http.Handler, authorizationInfo *apiserver.Aut } // NewBaseHandler takes in CompletedConfig and returns a handler. -func NewBaseHandler(c *apiserverconfig.DebuggingConfiguration, checks ...healthz.HealthzChecker) *mux.PathRecorderMux { +func NewBaseHandler(c *componentbaseconfig.DebuggingConfiguration, checks ...healthz.HealthzChecker) *mux.PathRecorderMux { mux := mux.NewPathRecorderMux("controller-manager") healthz.InstallHandler(mux, checks...) if c.EnableProfiling { diff --git a/cmd/kube-controller-manager/app/options/options_test.go b/cmd/kube-controller-manager/app/options/options_test.go index 4129038be7..f47431ec0e 100644 --- a/cmd/kube-controller-manager/app/options/options_test.go +++ b/cmd/kube-controller-manager/app/options/options_test.go @@ -25,11 +25,10 @@ import ( "github.com/spf13/pflag" - apimachineryconfig "k8s.io/apimachinery/pkg/apis/config" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/diff" - apiserverconfig "k8s.io/apiserver/pkg/apis/config" apiserveroptions "k8s.io/apiserver/pkg/server/options" + componentbaseconfig "k8s.io/component-base/config" cmoptions "k8s.io/kubernetes/cmd/controller-manager/app/options" kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config" ) @@ -128,13 +127,13 @@ func TestAddFlags(t *testing.T) { Port: 10252, // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config Address: "0.0.0.0", // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config MinResyncPeriod: metav1.Duration{Duration: 8 * time.Hour}, - ClientConnection: apimachineryconfig.ClientConnectionConfiguration{ + ClientConnection: componentbaseconfig.ClientConnectionConfiguration{ ContentType: "application/json", QPS: 50.0, Burst: 100, }, ControllerStartInterval: metav1.Duration{Duration: 2 * time.Minute}, - LeaderElection: apiserverconfig.LeaderElectionConfiguration{ + LeaderElection: componentbaseconfig.LeaderElectionConfiguration{ ResourceLock: "configmap", LeaderElect: false, LeaseDuration: metav1.Duration{Duration: 30 * time.Second}, diff --git a/cmd/kube-proxy/app/server.go b/cmd/kube-proxy/app/server.go index f0edc12c75..17872f63c9 100644 --- a/cmd/kube-proxy/app/server.go +++ b/cmd/kube-proxy/app/server.go @@ -28,8 +28,7 @@ import ( "strings" "time" - "k8s.io/api/core/v1" - apimachineryconfig "k8s.io/apimachinery/pkg/apis/config" + v1 "k8s.io/api/core/v1" v1meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/serializer" @@ -48,6 +47,7 @@ import ( "k8s.io/client-go/tools/clientcmd" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" "k8s.io/client-go/tools/record" + componentbaseconfig "k8s.io/component-base/config" "k8s.io/kube-proxy/config/v1alpha1" api "k8s.io/kubernetes/pkg/apis/core" "k8s.io/kubernetes/pkg/kubelet/qos" @@ -422,7 +422,7 @@ type ProxyServer struct { // createClients creates a kube client and an event client from the given config and masterOverride. // TODO remove masterOverride when CLI flags are removed. -func createClients(config apimachineryconfig.ClientConnectionConfiguration, masterOverride string) (clientset.Interface, v1core.EventsGetter, error) { +func createClients(config componentbaseconfig.ClientConnectionConfiguration, masterOverride string) (clientset.Interface, v1core.EventsGetter, error) { var kubeConfig *rest.Config var err error diff --git a/cmd/kube-proxy/app/server_test.go b/cmd/kube-proxy/app/server_test.go index 7eee58376b..b45066f86f 100644 --- a/cmd/kube-proxy/app/server_test.go +++ b/cmd/kube-proxy/app/server_test.go @@ -26,9 +26,9 @@ import ( "github.com/stretchr/testify/assert" - apimachineryconfig "k8s.io/apimachinery/pkg/apis/config" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/diff" + componentbaseconfig "k8s.io/component-base/config" api "k8s.io/kubernetes/pkg/apis/core" kubeproxyconfig "k8s.io/kubernetes/pkg/proxy/apis/config" "k8s.io/kubernetes/pkg/util/configz" @@ -289,7 +289,7 @@ nodePortAddresses: } expected := &kubeproxyconfig.KubeProxyConfiguration{ BindAddress: expBindAddr, - ClientConnection: apimachineryconfig.ClientConnectionConfiguration{ + ClientConnection: componentbaseconfig.ClientConnectionConfiguration{ AcceptContentTypes: "abc", Burst: 100, ContentType: "content-type", diff --git a/cmd/kube-scheduler/app/options/options.go b/cmd/kube-scheduler/app/options/options.go index 972a6b7f09..4db4502d7b 100644 --- a/cmd/kube-scheduler/app/options/options.go +++ b/cmd/kube-scheduler/app/options/options.go @@ -24,7 +24,6 @@ import ( "time" corev1 "k8s.io/api/core/v1" - apimachineryconfig "k8s.io/apimachinery/pkg/apis/config" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/uuid" apiserveroptions "k8s.io/apiserver/pkg/server/options" @@ -39,6 +38,7 @@ import ( "k8s.io/client-go/tools/leaderelection" "k8s.io/client-go/tools/leaderelection/resourcelock" "k8s.io/client-go/tools/record" + componentbaseconfig "k8s.io/component-base/config" "k8s.io/klog" kubeschedulerconfigv1alpha1 "k8s.io/kube-scheduler/config/v1alpha1" schedulerappconfig "k8s.io/kubernetes/cmd/kube-scheduler/app/config" @@ -294,7 +294,7 @@ func makeLeaderElectionConfig(config kubeschedulerconfig.KubeSchedulerLeaderElec // createClients creates a kube client and an event client from the given config and masterOverride. // TODO remove masterOverride when CLI flags are removed. -func createClients(config apimachineryconfig.ClientConnectionConfiguration, masterOverride string, timeout time.Duration) (clientset.Interface, clientset.Interface, v1core.EventsGetter, error) { +func createClients(config componentbaseconfig.ClientConnectionConfiguration, masterOverride string, timeout time.Duration) (clientset.Interface, clientset.Interface, v1core.EventsGetter, error) { if len(config.Kubeconfig) == 0 && len(masterOverride) == 0 { klog.Warningf("Neither --kubeconfig nor --master was specified. Using default API client. This might not work.") } diff --git a/cmd/kube-scheduler/app/options/options_test.go b/cmd/kube-scheduler/app/options/options_test.go index b20fb0b0f8..730b5e7b41 100644 --- a/cmd/kube-scheduler/app/options/options_test.go +++ b/cmd/kube-scheduler/app/options/options_test.go @@ -28,11 +28,10 @@ import ( "testing" "time" - apimachineryconfig "k8s.io/apimachinery/pkg/apis/config" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/diff" - apiserverconfig "k8s.io/apiserver/pkg/apis/config" apiserveroptions "k8s.io/apiserver/pkg/server/options" + componentbaseconfig "k8s.io/component-base/config" kubeschedulerconfig "k8s.io/kubernetes/pkg/scheduler/apis/config" ) @@ -209,7 +208,7 @@ users: MetricsBindAddress: "0.0.0.0:10251", FailureDomains: "kubernetes.io/hostname,failure-domain.beta.kubernetes.io/zone,failure-domain.beta.kubernetes.io/region", LeaderElection: kubeschedulerconfig.KubeSchedulerLeaderElectionConfiguration{ - LeaderElectionConfiguration: apiserverconfig.LeaderElectionConfiguration{ + LeaderElectionConfiguration: componentbaseconfig.LeaderElectionConfiguration{ LeaderElect: true, LeaseDuration: metav1.Duration{Duration: 15 * time.Second}, RenewDeadline: metav1.Duration{Duration: 10 * time.Second}, @@ -219,7 +218,7 @@ users: LockObjectNamespace: "kube-system", LockObjectName: "kube-scheduler", }, - ClientConnection: apimachineryconfig.ClientConnectionConfiguration{ + ClientConnection: componentbaseconfig.ClientConnectionConfiguration{ Kubeconfig: configKubeconfig, QPS: 50, Burst: 100, @@ -289,7 +288,7 @@ users: MetricsBindAddress: "", // defaults empty when not running from config file FailureDomains: "kubernetes.io/hostname,failure-domain.beta.kubernetes.io/zone,failure-domain.beta.kubernetes.io/region", LeaderElection: kubeschedulerconfig.KubeSchedulerLeaderElectionConfiguration{ - LeaderElectionConfiguration: apiserverconfig.LeaderElectionConfiguration{ + LeaderElectionConfiguration: componentbaseconfig.LeaderElectionConfiguration{ LeaderElect: true, LeaseDuration: metav1.Duration{Duration: 15 * time.Second}, RenewDeadline: metav1.Duration{Duration: 10 * time.Second}, @@ -299,7 +298,7 @@ users: LockObjectNamespace: "kube-system", LockObjectName: "kube-scheduler", }, - ClientConnection: apimachineryconfig.ClientConnectionConfiguration{ + ClientConnection: componentbaseconfig.ClientConnectionConfiguration{ Kubeconfig: flagKubeconfig, QPS: 50, Burst: 100, diff --git a/pkg/client/leaderelectionconfig/config.go b/pkg/client/leaderelectionconfig/config.go index cc9ae7efac..7be3d5aa59 100644 --- a/pkg/client/leaderelectionconfig/config.go +++ b/pkg/client/leaderelectionconfig/config.go @@ -20,16 +20,17 @@ import ( "time" "github.com/spf13/pflag" - apiserverconfig "k8s.io/apiserver/pkg/apis/config" + componentbaseconfig "k8s.io/component-base/config" ) const ( // DefaultLeaseDuration defines a default duration of lease. + // TODO: This constant should move to the k8s.io/component-base/config package DefaultLeaseDuration = 15 * time.Second ) // BindFlags binds the LeaderElectionConfiguration struct fields to a flagset -func BindFlags(l *apiserverconfig.LeaderElectionConfiguration, fs *pflag.FlagSet) { +func BindFlags(l *componentbaseconfig.LeaderElectionConfiguration, fs *pflag.FlagSet) { fs.BoolVar(&l.LeaderElect, "leader-elect", l.LeaderElect, ""+ "Start a leader election client and gain leadership before "+ "executing the main loop. Enable this when running replicated "+ diff --git a/pkg/controller/apis/config/types.go b/pkg/controller/apis/config/types.go index c04a1b3552..c7a3190ddf 100644 --- a/pkg/controller/apis/config/types.go +++ b/pkg/controller/apis/config/types.go @@ -17,9 +17,8 @@ limitations under the License. package config import ( - apimachineryconfig "k8s.io/apimachinery/pkg/apis/config" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - apiserverconfig "k8s.io/apiserver/pkg/apis/config" + componentbaseconfig "k8s.io/component-base/config" ) // GroupResource describes an group resource. @@ -112,11 +111,11 @@ type GenericControllerManagerConfiguration struct { MinResyncPeriod metav1.Duration // ClientConnection specifies the kubeconfig file and client connection // settings for the proxy server to use when communicating with the apiserver. - ClientConnection apimachineryconfig.ClientConnectionConfiguration + ClientConnection componentbaseconfig.ClientConnectionConfiguration // How long to wait between starting controller managers ControllerStartInterval metav1.Duration // leaderElection defines the configuration of leader election client. - LeaderElection apiserverconfig.LeaderElectionConfiguration + LeaderElection componentbaseconfig.LeaderElectionConfiguration // Controllers is the list of controllers to enable or disable // '*' means "all enabled by default controllers" // 'foo' means "enable 'foo'" @@ -124,7 +123,7 @@ type GenericControllerManagerConfiguration struct { // first item for a particular name wins Controllers []string // DebuggingConfiguration holds configuration for Debugging related features. - Debugging apiserverconfig.DebuggingConfiguration + Debugging componentbaseconfig.DebuggingConfiguration } // KubeCloudSharedConfiguration contains elements shared by both kube-controller manager diff --git a/pkg/controller/apis/config/v1alpha1/defaults.go b/pkg/controller/apis/config/v1alpha1/defaults.go index af96572566..ccefd0a955 100644 --- a/pkg/controller/apis/config/v1alpha1/defaults.go +++ b/pkg/controller/apis/config/v1alpha1/defaults.go @@ -19,10 +19,9 @@ package v1alpha1 import ( "time" - apimachineryconfigv1alpha1 "k8s.io/apimachinery/pkg/apis/config/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" kruntime "k8s.io/apimachinery/pkg/runtime" - apiserverconfigv1alpha1 "k8s.io/apiserver/pkg/apis/config/v1alpha1" + componentbaseconfigv1alpha1 "k8s.io/component-base/config/v1alpha1" kubectrlmgrconfigv1alpha1 "k8s.io/kube-controller-manager/config/v1alpha1" utilpointer "k8s.io/utils/pointer" ) @@ -52,7 +51,7 @@ func SetDefaults_KubeControllerManagerConfiguration(obj *kubectrlmgrconfigv1alph obj.TTLAfterFinishedController.ConcurrentTTLSyncs = 5 } - // These defaults override the recommended defaults from the apimachineryconfigv1alpha1 package that are applied automatically + // These defaults override the recommended defaults from the componentbaseconfigv1alpha1 package that are applied automatically // These client-connection defaults are specific to the kube-controller-manager if obj.Generic.ClientConnection.QPS == 0.0 { obj.Generic.ClientConnection.QPS = 20.0 @@ -81,8 +80,8 @@ func RecommendedDefaultGenericControllerManagerConfiguration(obj *kubectrlmgrcon } // Use the default ClientConnectionConfiguration and LeaderElectionConfiguration options - apimachineryconfigv1alpha1.RecommendedDefaultClientConnectionConfiguration(&obj.ClientConnection) - apiserverconfigv1alpha1.RecommendedDefaultLeaderElectionConfiguration(&obj.LeaderElection) + componentbaseconfigv1alpha1.RecommendedDefaultClientConnectionConfiguration(&obj.ClientConnection) + componentbaseconfigv1alpha1.RecommendedDefaultLeaderElectionConfiguration(&obj.LeaderElection) } func SetDefaults_KubeCloudSharedConfiguration(obj *kubectrlmgrconfigv1alpha1.KubeCloudSharedConfiguration) { diff --git a/pkg/proxy/apis/config/types.go b/pkg/proxy/apis/config/types.go index dacee32bb3..2c79debd69 100644 --- a/pkg/proxy/apis/config/types.go +++ b/pkg/proxy/apis/config/types.go @@ -21,8 +21,8 @@ import ( "sort" "strings" - apimachineryconfig "k8s.io/apimachinery/pkg/apis/config" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + componentbaseconfig "k8s.io/component-base/config" ) // KubeProxyIPTablesConfiguration contains iptables-related configuration @@ -108,7 +108,7 @@ type KubeProxyConfiguration struct { HostnameOverride string // clientConnection specifies the kubeconfig file and client connection settings for the proxy // server to use when communicating with the apiserver. - ClientConnection apimachineryconfig.ClientConnectionConfiguration + ClientConnection componentbaseconfig.ClientConnectionConfiguration // iptables contains iptables-related configuration options. IPTables KubeProxyIPTablesConfiguration // ipvs contains ipvs-related configuration options. diff --git a/pkg/proxy/apis/config/validation/validation.go b/pkg/proxy/apis/config/validation/validation.go index 04d9e5ed9e..2637196530 100644 --- a/pkg/proxy/apis/config/validation/validation.go +++ b/pkg/proxy/apis/config/validation/validation.go @@ -23,10 +23,10 @@ import ( "strconv" "strings" - apimachineryconfig "k8s.io/apimachinery/pkg/apis/config" utilnet "k8s.io/apimachinery/pkg/util/net" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/validation/field" + componentbaseconfig "k8s.io/component-base/config" apivalidation "k8s.io/kubernetes/pkg/apis/core/validation" kubeproxyconfig "k8s.io/kubernetes/pkg/proxy/apis/config" ) @@ -187,7 +187,7 @@ func validateProxyModeWindows(mode kubeproxyconfig.ProxyMode, fldPath *field.Pat return field.ErrorList{field.Invalid(fldPath.Child("ProxyMode"), string(mode), errMsg)} } -func validateClientConnectionConfiguration(config apimachineryconfig.ClientConnectionConfiguration, fldPath *field.Path) field.ErrorList { +func validateClientConnectionConfiguration(config componentbaseconfig.ClientConnectionConfiguration, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} allErrs = append(allErrs, apivalidation.ValidateNonnegativeField(int64(config.Burst), fldPath.Child("Burst"))...) return allErrs diff --git a/pkg/proxy/apis/config/validation/validation_test.go b/pkg/proxy/apis/config/validation/validation_test.go index 9a054683d4..a241142329 100644 --- a/pkg/proxy/apis/config/validation/validation_test.go +++ b/pkg/proxy/apis/config/validation/validation_test.go @@ -23,9 +23,9 @@ import ( "testing" "time" - apimachineryconfig "k8s.io/apimachinery/pkg/apis/config" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/validation/field" + componentbaseconfig "k8s.io/component-base/config" kubeproxyconfig "k8s.io/kubernetes/pkg/proxy/apis/config" "k8s.io/utils/pointer" ) @@ -575,7 +575,7 @@ func TestValidateProxyMode(t *testing.T) { func TestValidateClientConnectionConfiguration(t *testing.T) { newPath := field.NewPath("KubeProxyConfiguration") - successCases := []apimachineryconfig.ClientConnectionConfiguration{ + successCases := []componentbaseconfig.ClientConnectionConfiguration{ { Burst: 0, }, @@ -591,11 +591,11 @@ func TestValidateClientConnectionConfiguration(t *testing.T) { } errorCases := []struct { - ccc apimachineryconfig.ClientConnectionConfiguration + ccc componentbaseconfig.ClientConnectionConfiguration msg string }{ { - ccc: apimachineryconfig.ClientConnectionConfiguration{Burst: -5}, + ccc: componentbaseconfig.ClientConnectionConfiguration{Burst: -5}, msg: "must be greater than or equal to 0", }, } diff --git a/pkg/scheduler/apis/config/types.go b/pkg/scheduler/apis/config/types.go index b0d36cd31b..f855b7c34a 100644 --- a/pkg/scheduler/apis/config/types.go +++ b/pkg/scheduler/apis/config/types.go @@ -17,9 +17,8 @@ limitations under the License. package config import ( - apimachineryconfig "k8s.io/apimachinery/pkg/apis/config" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - apiserverconfig "k8s.io/apiserver/pkg/apis/config" + componentbaseconfig "k8s.io/component-base/config" ) const ( @@ -58,7 +57,7 @@ type KubeSchedulerConfiguration struct { // ClientConnection specifies the kubeconfig file and client connection // settings for the proxy server to use when communicating with the apiserver. - ClientConnection apimachineryconfig.ClientConnectionConfiguration + ClientConnection componentbaseconfig.ClientConnectionConfiguration // HealthzBindAddress is the IP address and port for the health check server to serve on, // defaulting to 0.0.0.0:10251 HealthzBindAddress string @@ -67,8 +66,8 @@ type KubeSchedulerConfiguration struct { MetricsBindAddress string // DebuggingConfiguration holds configuration for Debugging related features - // TODO: We might wanna make this a substruct like Debugging apiserverconfig.DebuggingConfiguration - apiserverconfig.DebuggingConfiguration + // TODO: We might wanna make this a substruct like Debugging componentbaseconfig.DebuggingConfiguration + componentbaseconfig.DebuggingConfiguration // DisablePreemption disables the pod preemption feature. DisablePreemption bool @@ -130,7 +129,7 @@ type SchedulerPolicyConfigMapSource struct { // KubeSchedulerLeaderElectionConfiguration expands LeaderElectionConfiguration // to include scheduler specific configuration. type KubeSchedulerLeaderElectionConfiguration struct { - apiserverconfig.LeaderElectionConfiguration + componentbaseconfig.LeaderElectionConfiguration // LockObjectNamespace defines the namespace of the lock object LockObjectNamespace string // LockObjectName defines the lock object name diff --git a/pkg/scheduler/apis/config/v1alpha1/defaults.go b/pkg/scheduler/apis/config/v1alpha1/defaults.go index 5768d2334b..f6a08af34a 100644 --- a/pkg/scheduler/apis/config/v1alpha1/defaults.go +++ b/pkg/scheduler/apis/config/v1alpha1/defaults.go @@ -21,7 +21,7 @@ import ( "strconv" "k8s.io/apimachinery/pkg/runtime" - apiserverconfigv1alpha1 "k8s.io/apiserver/pkg/apis/config/v1alpha1" + componentbaseconfigv1alpha1 "k8s.io/component-base/config/v1alpha1" kubescedulerconfigv1alpha1 "k8s.io/kube-scheduler/config/v1alpha1" // this package shouldn't really depend on other k8s.io/kubernetes code @@ -97,7 +97,7 @@ func SetDefaults_KubeSchedulerConfiguration(obj *kubescedulerconfigv1alpha1.Kube } // Use the default LeaderElectionConfiguration options - apiserverconfigv1alpha1.RecommendedDefaultLeaderElectionConfiguration(&obj.LeaderElection.LeaderElectionConfiguration) + componentbaseconfigv1alpha1.RecommendedDefaultLeaderElectionConfiguration(&obj.LeaderElection.LeaderElectionConfiguration) if obj.BindTimeoutSeconds == nil { defaultBindTimeoutSeconds := int64(600) diff --git a/pkg/scheduler/apis/config/validation/validation.go b/pkg/scheduler/apis/config/validation/validation.go index 00fff14b43..0d44db9cd8 100644 --- a/pkg/scheduler/apis/config/validation/validation.go +++ b/pkg/scheduler/apis/config/validation/validation.go @@ -17,17 +17,16 @@ limitations under the License. package validation import ( - apimachinery "k8s.io/apimachinery/pkg/apis/config/validation" "k8s.io/apimachinery/pkg/util/validation" "k8s.io/apimachinery/pkg/util/validation/field" - apiserver "k8s.io/apiserver/pkg/apis/config/validation" + componentbasevalidation "k8s.io/component-base/config/validation" "k8s.io/kubernetes/pkg/scheduler/apis/config" ) // ValidateKubeSchedulerConfiguration ensures validation of the KubeSchedulerConfiguration struct func ValidateKubeSchedulerConfiguration(cc *config.KubeSchedulerConfiguration) field.ErrorList { allErrs := field.ErrorList{} - allErrs = append(allErrs, apimachinery.ValidateClientConnectionConfiguration(&cc.ClientConnection, field.NewPath("clientConnection"))...) + allErrs = append(allErrs, componentbasevalidation.ValidateClientConnectionConfiguration(&cc.ClientConnection, field.NewPath("clientConnection"))...) allErrs = append(allErrs, ValidateKubeSchedulerLeaderElectionConfiguration(&cc.LeaderElection, field.NewPath("leaderElection"))...) if len(cc.SchedulerName) == 0 { allErrs = append(allErrs, field.Required(field.NewPath("schedulerName"), "")) @@ -57,7 +56,7 @@ func ValidateKubeSchedulerLeaderElectionConfiguration(cc *config.KubeSchedulerLe if !cc.LeaderElectionConfiguration.LeaderElect { return allErrs } - allErrs = append(allErrs, apiserver.ValidateLeaderElectionConfiguration(&cc.LeaderElectionConfiguration, field.NewPath("leaderElectionConfiguration"))...) + allErrs = append(allErrs, componentbasevalidation.ValidateLeaderElectionConfiguration(&cc.LeaderElectionConfiguration, field.NewPath("leaderElectionConfiguration"))...) if len(cc.LockObjectNamespace) == 0 { allErrs = append(allErrs, field.Required(fldPath.Child("lockObjectNamespace"), "")) } diff --git a/pkg/scheduler/apis/config/validation/validation_test.go b/pkg/scheduler/apis/config/validation/validation_test.go index 76ca5b4601..4213a1e9eb 100644 --- a/pkg/scheduler/apis/config/validation/validation_test.go +++ b/pkg/scheduler/apis/config/validation/validation_test.go @@ -20,9 +20,8 @@ import ( "testing" "time" - apimachinery "k8s.io/apimachinery/pkg/apis/config" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - apiserver "k8s.io/apiserver/pkg/apis/config" + componentbaseconfig "k8s.io/component-base/config" "k8s.io/kubernetes/pkg/scheduler/apis/config" ) @@ -33,7 +32,7 @@ func TestValidateKubeSchedulerConfiguration(t *testing.T) { HealthzBindAddress: "0.0.0.0:10254", MetricsBindAddress: "0.0.0.0:10254", HardPodAffinitySymmetricWeight: 80, - ClientConnection: apimachinery.ClientConnectionConfiguration{ + ClientConnection: componentbaseconfig.ClientConnectionConfiguration{ AcceptContentTypes: "application/json", ContentType: "application/json", QPS: 10, @@ -50,7 +49,7 @@ func TestValidateKubeSchedulerConfiguration(t *testing.T) { LeaderElection: config.KubeSchedulerLeaderElectionConfiguration{ LockObjectNamespace: "name", LockObjectName: "name", - LeaderElectionConfiguration: apiserver.LeaderElectionConfiguration{ + LeaderElectionConfiguration: componentbaseconfig.LeaderElectionConfiguration{ ResourceLock: "configmap", LeaderElect: true, LeaseDuration: metav1.Duration{Duration: 30 * time.Second}, diff --git a/staging/src/k8s.io/kube-controller-manager/config/v1alpha1/types.go b/staging/src/k8s.io/kube-controller-manager/config/v1alpha1/types.go index 2e9f45b5b4..38d8bf4d3b 100644 --- a/staging/src/k8s.io/kube-controller-manager/config/v1alpha1/types.go +++ b/staging/src/k8s.io/kube-controller-manager/config/v1alpha1/types.go @@ -17,9 +17,8 @@ limitations under the License. package v1alpha1 import ( - apimachineryconfigv1alpha1 "k8s.io/apimachinery/pkg/apis/config/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - apiserverconfigv1alpha1 "k8s.io/apiserver/pkg/apis/config/v1alpha1" + componentbaseconfigv1alpha1 "k8s.io/component-base/config/v1alpha1" ) // PersistentVolumeRecyclerConfiguration contains elements describing persistent volume plugins. @@ -161,11 +160,11 @@ type GenericControllerManagerConfiguration struct { MinResyncPeriod metav1.Duration // ClientConnection specifies the kubeconfig file and client connection // settings for the proxy server to use when communicating with the apiserver. - ClientConnection apimachineryconfigv1alpha1.ClientConnectionConfiguration + ClientConnection componentbaseconfigv1alpha1.ClientConnectionConfiguration // How long to wait between starting controller managers ControllerStartInterval metav1.Duration // leaderElection defines the configuration of leader election client. - LeaderElection apiserverconfigv1alpha1.LeaderElectionConfiguration + LeaderElection componentbaseconfigv1alpha1.LeaderElectionConfiguration // Controllers is the list of controllers to enable or disable // '*' means "all enabled by default controllers" // 'foo' means "enable 'foo'" @@ -173,7 +172,7 @@ type GenericControllerManagerConfiguration struct { // first item for a particular name wins Controllers []string // DebuggingConfiguration holds configuration for Debugging related features. - Debugging apiserverconfigv1alpha1.DebuggingConfiguration + Debugging componentbaseconfigv1alpha1.DebuggingConfiguration } // KubeCloudSharedConfiguration contains elements shared by both kube-controller manager diff --git a/staging/src/k8s.io/kube-proxy/config/v1alpha1/types.go b/staging/src/k8s.io/kube-proxy/config/v1alpha1/types.go index b9c370b0d3..ecf95d68d2 100644 --- a/staging/src/k8s.io/kube-proxy/config/v1alpha1/types.go +++ b/staging/src/k8s.io/kube-proxy/config/v1alpha1/types.go @@ -17,8 +17,8 @@ limitations under the License. package v1alpha1 import ( - apimachineryconfigv1alpha1 "k8s.io/apimachinery/pkg/apis/config/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + componentbaseconfigv1alpha1 "k8s.io/component-base/config/v1alpha1" ) // KubeProxyIPTablesConfiguration contains iptables-related configuration @@ -104,7 +104,7 @@ type KubeProxyConfiguration struct { HostnameOverride string `json:"hostnameOverride"` // clientConnection specifies the kubeconfig file and client connection settings for the proxy // server to use when communicating with the apiserver. - ClientConnection apimachineryconfigv1alpha1.ClientConnectionConfiguration `json:"clientConnection"` + ClientConnection componentbaseconfigv1alpha1.ClientConnectionConfiguration `json:"clientConnection"` // iptables contains iptables-related configuration options. IPTables KubeProxyIPTablesConfiguration `json:"iptables"` // ipvs contains ipvs-related configuration options. diff --git a/staging/src/k8s.io/kube-scheduler/config/v1alpha1/types.go b/staging/src/k8s.io/kube-scheduler/config/v1alpha1/types.go index 6bdb5500d6..e37649ad24 100644 --- a/staging/src/k8s.io/kube-scheduler/config/v1alpha1/types.go +++ b/staging/src/k8s.io/kube-scheduler/config/v1alpha1/types.go @@ -17,9 +17,8 @@ limitations under the License. package v1alpha1 import ( - apimachineryconfigv1alpha1 "k8s.io/apimachinery/pkg/apis/config/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - apiserverconfigv1alpha1 "k8s.io/apiserver/pkg/apis/config/v1alpha1" + componentbaseconfigv1alpha1 "k8s.io/component-base/config/v1alpha1" ) const ( @@ -54,7 +53,7 @@ type KubeSchedulerConfiguration struct { // ClientConnection specifies the kubeconfig file and client connection // settings for the proxy server to use when communicating with the apiserver. - ClientConnection apimachineryconfigv1alpha1.ClientConnectionConfiguration `json:"clientConnection"` + ClientConnection componentbaseconfigv1alpha1.ClientConnectionConfiguration `json:"clientConnection"` // HealthzBindAddress is the IP address and port for the health check server to serve on, // defaulting to 0.0.0.0:10251 HealthzBindAddress string `json:"healthzBindAddress"` @@ -63,8 +62,8 @@ type KubeSchedulerConfiguration struct { MetricsBindAddress string `json:"metricsBindAddress"` // DebuggingConfiguration holds configuration for Debugging related features - // TODO: We might wanna make this a substruct like Debugging apiserverconfig.DebuggingConfiguration - apiserverconfigv1alpha1.DebuggingConfiguration `json:",inline"` + // TODO: We might wanna make this a substruct like Debugging componentbaseconfigv1alpha1.DebuggingConfiguration + componentbaseconfigv1alpha1.DebuggingConfiguration `json:",inline"` // DisablePreemption disables the pod preemption feature. DisablePreemption bool `json:"disablePreemption"` @@ -126,7 +125,7 @@ type SchedulerPolicyConfigMapSource struct { // KubeSchedulerLeaderElectionConfiguration expands LeaderElectionConfiguration // to include scheduler specific configuration. type KubeSchedulerLeaderElectionConfiguration struct { - apiserverconfigv1alpha1.LeaderElectionConfiguration `json:",inline"` + componentbaseconfigv1alpha1.LeaderElectionConfiguration `json:",inline"` // LockObjectNamespace defines the namespace of the lock object LockObjectNamespace string `json:"lockObjectNamespace"` // LockObjectName defines the lock object name From 15e22ff4c437d4f63f5bc35fef618b561e62f875 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20K=C3=A4ldstr=C3=B6m?= Date: Sun, 6 Jan 2019 15:48:21 +0200 Subject: [PATCH 4/6] Update various policy files wrt the new staging repo --- hack/.golint_failures | 3 +-- hack/import-restrictions.yaml | 17 +++++++++++++++-- pkg/controller/.import-restrictions | 8 +++----- staging/README.md | 1 + 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/hack/.golint_failures b/hack/.golint_failures index b7d0181f74..50d19681a7 100644 --- a/hack/.golint_failures +++ b/hack/.golint_failures @@ -475,7 +475,6 @@ staging/src/k8s.io/apimachinery/pkg/api/meta staging/src/k8s.io/apimachinery/pkg/api/resource staging/src/k8s.io/apimachinery/pkg/api/validation staging/src/k8s.io/apimachinery/pkg/api/validation/path -staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1 staging/src/k8s.io/apimachinery/pkg/apis/meta/fuzzer staging/src/k8s.io/apimachinery/pkg/apis/meta/internalversion staging/src/k8s.io/apimachinery/pkg/apis/meta/v1 @@ -532,7 +531,6 @@ staging/src/k8s.io/apiserver/pkg/apis/audit staging/src/k8s.io/apiserver/pkg/apis/audit/v1 staging/src/k8s.io/apiserver/pkg/apis/audit/v1alpha1 staging/src/k8s.io/apiserver/pkg/apis/audit/v1beta1 -staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1 staging/src/k8s.io/apiserver/pkg/apis/example staging/src/k8s.io/apiserver/pkg/apis/example/v1 staging/src/k8s.io/apiserver/pkg/apis/example2 @@ -662,6 +660,7 @@ staging/src/k8s.io/code-generator/cmd/client-gen/types staging/src/k8s.io/code-generator/cmd/conversion-gen/generators staging/src/k8s.io/code-generator/cmd/go-to-protobuf/protobuf staging/src/k8s.io/code-generator/cmd/lister-gen/generators +staging/src/k8s.io/component-base/config/v1alpha1 staging/src/k8s.io/kube-aggregator/pkg/apis/apiregistration staging/src/k8s.io/kube-aggregator/pkg/apis/apiregistration/v1 staging/src/k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1 diff --git a/hack/import-restrictions.yaml b/hack/import-restrictions.yaml index 1ffa5ef096..3cfc3847f4 100644 --- a/hack/import-restrictions.yaml +++ b/hack/import-restrictions.yaml @@ -50,6 +50,13 @@ - k8s.io/kube-openapi - k8s.io/klog +- baseImportPath: "./vendor/k8s.io/component-base/" + allowedImports: + - k8s.io/apimachinery + - k8s.io/component-base + - k8s.io/klog + - k8s.io/utils + - baseImportPath: "./vendor/k8s.io/client-go/" allowedImports: - k8s.io/api @@ -142,23 +149,29 @@ - baseImportPath: "./vendor/k8s.io/kube-controller-manager/" allowedImports: - k8s.io/apimachinery - - k8s.io/apiserver + - k8s.io/component-base + - k8s.io/klog - k8s.io/utils - baseImportPath: "./vendor/k8s.io/kube-proxy/" allowedImports: - k8s.io/apimachinery + - k8s.io/component-base + - k8s.io/klog + - k8s.io/utils - baseImportPath: "./vendor/k8s.io/kube-scheduler/" allowedImports: - k8s.io/apimachinery - - k8s.io/apiserver + - k8s.io/component-base + - k8s.io/klog - k8s.io/utils - baseImportPath: "./vendor/k8s.io/kubelet/" allowedImports: - k8s.io/api - k8s.io/apimachinery + - k8s.io/klog - baseImportPath: "./vendor/k8s.io/cluster-bootstrap/" allowedImports: diff --git a/pkg/controller/.import-restrictions b/pkg/controller/.import-restrictions index c96ccd7dce..db246c010a 100644 --- a/pkg/controller/.import-restrictions +++ b/pkg/controller/.import-restrictions @@ -39,8 +39,6 @@ "k8s.io/apimachinery/pkg/api/meta", "k8s.io/apimachinery/pkg/api/meta/testrestmapper", "k8s.io/apimachinery/pkg/api/resource", - "k8s.io/apimachinery/pkg/apis/config", - "k8s.io/apimachinery/pkg/apis/config/v1alpha1", "k8s.io/apimachinery/pkg/apis/meta/v1", "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured", "k8s.io/apimachinery/pkg/conversion", @@ -63,8 +61,6 @@ "k8s.io/apimachinery/pkg/util/wait", "k8s.io/apimachinery/pkg/util/version", "k8s.io/apimachinery/pkg/watch", - "k8s.io/apiserver/pkg/apis/config", - "k8s.io/apiserver/pkg/apis/config/v1alpha1", "k8s.io/apiserver/pkg/authentication/serviceaccount", "k8s.io/apiserver/pkg/storage/names", "k8s.io/apiserver/pkg/util/feature", @@ -91,7 +87,9 @@ "k8s.io/api/settings/v1alpha1", "k8s.io/api/admission/v1beta1", "k8s.io/api/networking/v1", - "k8s.io/api/admissionregistration/v1alpha1" + "k8s.io/api/admissionregistration/v1alpha1", + "k8s.io/component-base/config", + "k8s.io/component-base/config/v1alpha1" ] }, { diff --git a/staging/README.md b/staging/README.md index c33acbcfa9..61b1bb374f 100644 --- a/staging/README.md +++ b/staging/README.md @@ -15,6 +15,7 @@ Repositories currently staged here: - [`k8s.io/cloud-provider`](https://github.com/kubernetes/cloud-provider) - [`k8s.io/cluster-bootstrap`](https://github.com/kubernetes/cluster-bootstrap) - [`k8s.io/code-generator`](https://github.com/kubernetes/code-generator) +- [`k8s.io/component-base`](https://github.com/kubernetes/component-base) - [`k8s.io/csi-api`](https://github.com/kubernetes/csi-api) - [`k8s.io/kube-aggregator`](https://github.com/kubernetes/kube-aggregator) - [`k8s.io/kube-controller-manager`](https://github.com/kubernetes/kube-controller-manager) From d92c96267db65e4250d6ec372133af50ec7fc2fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20K=C3=A4ldstr=C3=B6m?= Date: Sun, 6 Jan 2019 15:48:44 +0200 Subject: [PATCH 5/6] autogenerated godeps --- .../k8s.io/component-base/Godeps/Godeps.json | 150 ++++++++++++++++++ .../Godeps/Godeps.json | 12 +- .../src/k8s.io/kube-proxy/Godeps/Godeps.json | 20 ++- .../k8s.io/kube-scheduler/Godeps/Godeps.json | 12 +- 4 files changed, 166 insertions(+), 28 deletions(-) create mode 100644 staging/src/k8s.io/component-base/Godeps/Godeps.json diff --git a/staging/src/k8s.io/component-base/Godeps/Godeps.json b/staging/src/k8s.io/component-base/Godeps/Godeps.json new file mode 100644 index 0000000000..ad0610ba59 --- /dev/null +++ b/staging/src/k8s.io/component-base/Godeps/Godeps.json @@ -0,0 +1,150 @@ +{ + "ImportPath": "k8s.io/component-base", + "GoVersion": "go1.11", + "GodepVersion": "v80-k8s-r1", + "Packages": [ + "./..." + ], + "Deps": [ + { + "ImportPath": "github.com/gogo/protobuf/proto", + "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" + }, + { + "ImportPath": "github.com/gogo/protobuf/sortkeys", + "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" + }, + { + "ImportPath": "github.com/google/gofuzz", + "Rev": "44d81051d367757e1c7c6a5a86423ece9afcf63c" + }, + { + "ImportPath": "golang.org/x/net/http2", + "Rev": "0ed95abb35c445290478a5348a7b38bb154135fd" + }, + { + "ImportPath": "golang.org/x/net/http2/hpack", + "Rev": "0ed95abb35c445290478a5348a7b38bb154135fd" + }, + { + "ImportPath": "golang.org/x/net/idna", + "Rev": "0ed95abb35c445290478a5348a7b38bb154135fd" + }, + { + "ImportPath": "golang.org/x/net/lex/httplex", + "Rev": "0ed95abb35c445290478a5348a7b38bb154135fd" + }, + { + "ImportPath": "golang.org/x/text/secure/bidirule", + "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" + }, + { + "ImportPath": "golang.org/x/text/transform", + "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" + }, + { + "ImportPath": "golang.org/x/text/unicode/bidi", + "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" + }, + { + "ImportPath": "golang.org/x/text/unicode/norm", + "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" + }, + { + "ImportPath": "gopkg.in/inf.v0", + "Rev": "3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/api/resource", + "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1", + "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/conversion", + "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams", + "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/fields", + "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/labels", + "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/runtime", + "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/runtime/schema", + "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/selection", + "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/types", + "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/errors", + "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/intstr", + "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/json", + "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/naming", + "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/net", + "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/runtime", + "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/sets", + "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/validation", + "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/validation/field", + "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/watch", + "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect", + "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "ImportPath": "k8s.io/klog", + "Rev": "8139d8cb77af419532b33dfa7dd09fbc5f1d344f" + }, + { + "ImportPath": "k8s.io/utils/pointer", + "Rev": "8e7ff06bf0e2d3289061230af203e430a15b6dcc" + } + ] +} diff --git a/staging/src/k8s.io/kube-controller-manager/Godeps/Godeps.json b/staging/src/k8s.io/kube-controller-manager/Godeps/Godeps.json index 3df12ff4c0..9a685bd046 100644 --- a/staging/src/k8s.io/kube-controller-manager/Godeps/Godeps.json +++ b/staging/src/k8s.io/kube-controller-manager/Godeps/Godeps.json @@ -58,14 +58,6 @@ "ImportPath": "k8s.io/apimachinery/pkg/api/resource", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, - { - "ImportPath": "k8s.io/apimachinery/pkg/apis/config", - "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/apis/config/v1alpha1", - "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" @@ -147,11 +139,11 @@ "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, { - "ImportPath": "k8s.io/apiserver/pkg/apis/config", + "ImportPath": "k8s.io/component-base/config", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, { - "ImportPath": "k8s.io/apiserver/pkg/apis/config/v1alpha1", + "ImportPath": "k8s.io/component-base/config/v1alpha1", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, { diff --git a/staging/src/k8s.io/kube-proxy/Godeps/Godeps.json b/staging/src/k8s.io/kube-proxy/Godeps/Godeps.json index c0ec78d039..e95e34a677 100644 --- a/staging/src/k8s.io/kube-proxy/Godeps/Godeps.json +++ b/staging/src/k8s.io/kube-proxy/Godeps/Godeps.json @@ -58,14 +58,6 @@ "ImportPath": "k8s.io/apimachinery/pkg/api/resource", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, - { - "ImportPath": "k8s.io/apimachinery/pkg/apis/config", - "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/apis/config/v1alpha1", - "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" @@ -146,9 +138,21 @@ "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, + { + "ImportPath": "k8s.io/component-base/config", + "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "ImportPath": "k8s.io/component-base/config/v1alpha1", + "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, { "ImportPath": "k8s.io/klog", "Rev": "8139d8cb77af419532b33dfa7dd09fbc5f1d344f" + }, + { + "ImportPath": "k8s.io/utils/pointer", + "Rev": "8e7ff06bf0e2d3289061230af203e430a15b6dcc" } ] } diff --git a/staging/src/k8s.io/kube-scheduler/Godeps/Godeps.json b/staging/src/k8s.io/kube-scheduler/Godeps/Godeps.json index 422e30596b..a2d2fa638e 100644 --- a/staging/src/k8s.io/kube-scheduler/Godeps/Godeps.json +++ b/staging/src/k8s.io/kube-scheduler/Godeps/Godeps.json @@ -58,14 +58,6 @@ "ImportPath": "k8s.io/apimachinery/pkg/api/resource", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, - { - "ImportPath": "k8s.io/apimachinery/pkg/apis/config", - "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/apis/config/v1alpha1", - "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" @@ -147,11 +139,11 @@ "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, { - "ImportPath": "k8s.io/apiserver/pkg/apis/config", + "ImportPath": "k8s.io/component-base/config", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, { - "ImportPath": "k8s.io/apiserver/pkg/apis/config/v1alpha1", + "ImportPath": "k8s.io/component-base/config/v1alpha1", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, { From 1edd2723f89cc42591c8aa11903ba812f947fd73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20K=C3=A4ldstr=C3=B6m?= Date: Sun, 6 Jan 2019 15:48:53 +0200 Subject: [PATCH 6/6] autogenerated files --- cmd/cloud-controller-manager/app/options/BUILD | 3 +-- cmd/controller-manager/app/BUILD | 2 +- cmd/controller-manager/app/options/BUILD | 3 +-- cmd/kube-controller-manager/app/options/BUILD | 3 +-- cmd/kube-proxy/app/BUILD | 4 ++-- cmd/kube-scheduler/app/options/BUILD | 5 ++--- pkg/client/leaderelectionconfig/BUILD | 2 +- pkg/controller/apis/config/BUILD | 3 +-- pkg/controller/apis/config/v1alpha1/BUILD | 3 +-- .../config/v1alpha1/zz_generated.conversion.go | 15 +++++++-------- pkg/proxy/apis/config/BUILD | 2 +- pkg/proxy/apis/config/v1alpha1/BUILD | 2 +- .../config/v1alpha1/zz_generated.conversion.go | 2 +- pkg/proxy/apis/config/validation/BUILD | 4 ++-- pkg/scheduler/apis/config/BUILD | 3 +-- pkg/scheduler/apis/config/v1alpha1/BUILD | 3 +-- .../config/v1alpha1/zz_generated.conversion.go | 11 +++++------ pkg/scheduler/apis/config/validation/BUILD | 6 ++---- staging/src/BUILD | 2 +- .../kube-controller-manager/config/v1alpha1/BUILD | 3 +-- .../src/k8s.io/kube-proxy/config/v1alpha1/BUILD | 2 +- .../k8s.io/kube-scheduler/config/v1alpha1/BUILD | 3 +-- 22 files changed, 36 insertions(+), 50 deletions(-) diff --git a/cmd/cloud-controller-manager/app/options/BUILD b/cmd/cloud-controller-manager/app/options/BUILD index c2707eb973..cf89ebf4bc 100644 --- a/cmd/cloud-controller-manager/app/options/BUILD +++ b/cmd/cloud-controller-manager/app/options/BUILD @@ -55,11 +55,10 @@ go_test( embed = [":go_default_library"], deps = [ "//cmd/controller-manager/app/options:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/apis/config:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/diff:go_default_library", - "//staging/src/k8s.io/apiserver/pkg/apis/config:go_default_library", "//staging/src/k8s.io/apiserver/pkg/server/options:go_default_library", + "//staging/src/k8s.io/component-base/config:go_default_library", "//vendor/github.com/spf13/pflag:go_default_library", ], ) diff --git a/cmd/controller-manager/app/BUILD b/cmd/controller-manager/app/BUILD index 4f75ca22f4..e88a11f4b7 100644 --- a/cmd/controller-manager/app/BUILD +++ b/cmd/controller-manager/app/BUILD @@ -12,7 +12,6 @@ go_library( "//pkg/api/legacyscheme:go_default_library", "//pkg/util/configz:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/wait:go_default_library", - "//staging/src/k8s.io/apiserver/pkg/apis/config:go_default_library", "//staging/src/k8s.io/apiserver/pkg/endpoints/filters:go_default_library", "//staging/src/k8s.io/apiserver/pkg/endpoints/request:go_default_library", "//staging/src/k8s.io/apiserver/pkg/server:go_default_library", @@ -21,6 +20,7 @@ go_library( "//staging/src/k8s.io/apiserver/pkg/server/mux:go_default_library", "//staging/src/k8s.io/apiserver/pkg/server/routes:go_default_library", "//staging/src/k8s.io/client-go/kubernetes:go_default_library", + "//staging/src/k8s.io/component-base/config:go_default_library", "//vendor/github.com/prometheus/client_golang/prometheus:go_default_library", "//vendor/k8s.io/klog:go_default_library", ], diff --git a/cmd/controller-manager/app/options/BUILD b/cmd/controller-manager/app/options/BUILD index aa5744e335..afe3eb9086 100644 --- a/cmd/controller-manager/app/options/BUILD +++ b/cmd/controller-manager/app/options/BUILD @@ -16,12 +16,11 @@ go_library( "//pkg/client/leaderelectionconfig:go_default_library", "//pkg/cloudprovider/providers:go_default_library", "//pkg/controller/apis/config:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/apis/config:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library", - "//staging/src/k8s.io/apiserver/pkg/apis/config:go_default_library", "//staging/src/k8s.io/apiserver/pkg/util/flag:go_default_library", "//staging/src/k8s.io/apiserver/pkg/util/globalflag:go_default_library", + "//staging/src/k8s.io/component-base/config:go_default_library", "//vendor/github.com/spf13/pflag:go_default_library", ], ) diff --git a/cmd/kube-controller-manager/app/options/BUILD b/cmd/kube-controller-manager/app/options/BUILD index 3f3330f7df..0b3d209577 100644 --- a/cmd/kube-controller-manager/app/options/BUILD +++ b/cmd/kube-controller-manager/app/options/BUILD @@ -78,11 +78,10 @@ go_test( deps = [ "//cmd/controller-manager/app/options:go_default_library", "//pkg/controller/apis/config:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/apis/config:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/diff:go_default_library", - "//staging/src/k8s.io/apiserver/pkg/apis/config:go_default_library", "//staging/src/k8s.io/apiserver/pkg/server/options:go_default_library", + "//staging/src/k8s.io/component-base/config:go_default_library", "//vendor/github.com/spf13/pflag:go_default_library", ], ) diff --git a/cmd/kube-proxy/app/BUILD b/cmd/kube-proxy/app/BUILD index f76d454296..acc9a87d6c 100644 --- a/cmd/kube-proxy/app/BUILD +++ b/cmd/kube-proxy/app/BUILD @@ -42,7 +42,6 @@ go_library( "//pkg/version:go_default_library", "//pkg/version/verflag:go_default_library", "//staging/src/k8s.io/api/core/v1:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/apis/config:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library", @@ -61,6 +60,7 @@ go_library( "//staging/src/k8s.io/client-go/tools/clientcmd:go_default_library", "//staging/src/k8s.io/client-go/tools/clientcmd/api:go_default_library", "//staging/src/k8s.io/client-go/tools/record:go_default_library", + "//staging/src/k8s.io/component-base/config:go_default_library", "//staging/src/k8s.io/kube-proxy/config/v1alpha1:go_default_library", "//vendor/github.com/prometheus/client_golang/prometheus:go_default_library", "//vendor/github.com/spf13/cobra:go_default_library", @@ -163,9 +163,9 @@ go_test( "//pkg/apis/core:go_default_library", "//pkg/proxy/apis/config:go_default_library", "//pkg/util/configz:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/apis/config:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/diff:go_default_library", + "//staging/src/k8s.io/component-base/config:go_default_library", "//vendor/github.com/stretchr/testify/assert:go_default_library", "//vendor/k8s.io/utils/pointer:go_default_library", ] + select({ diff --git a/cmd/kube-scheduler/app/options/BUILD b/cmd/kube-scheduler/app/options/BUILD index 65050784ee..a2460f4a4f 100644 --- a/cmd/kube-scheduler/app/options/BUILD +++ b/cmd/kube-scheduler/app/options/BUILD @@ -21,7 +21,6 @@ go_library( "//pkg/scheduler/apis/config/validation:go_default_library", "//pkg/scheduler/factory:go_default_library", "//staging/src/k8s.io/api/core/v1:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/apis/config:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime/serializer/json:go_default_library", @@ -39,6 +38,7 @@ go_library( "//staging/src/k8s.io/client-go/tools/leaderelection:go_default_library", "//staging/src/k8s.io/client-go/tools/leaderelection/resourcelock:go_default_library", "//staging/src/k8s.io/client-go/tools/record:go_default_library", + "//staging/src/k8s.io/component-base/config:go_default_library", "//staging/src/k8s.io/kube-scheduler/config/v1alpha1:go_default_library", "//vendor/github.com/spf13/pflag:go_default_library", "//vendor/k8s.io/klog:go_default_library", @@ -70,11 +70,10 @@ go_test( deps = [ "//cmd/kube-scheduler/app/config:go_default_library", "//pkg/scheduler/apis/config:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/apis/config:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/diff:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/rand:go_default_library", - "//staging/src/k8s.io/apiserver/pkg/apis/config:go_default_library", "//staging/src/k8s.io/apiserver/pkg/server/options:go_default_library", + "//staging/src/k8s.io/component-base/config:go_default_library", ], ) diff --git a/pkg/client/leaderelectionconfig/BUILD b/pkg/client/leaderelectionconfig/BUILD index e5e7ec9b6b..a5d29965c3 100644 --- a/pkg/client/leaderelectionconfig/BUILD +++ b/pkg/client/leaderelectionconfig/BUILD @@ -10,7 +10,7 @@ go_library( srcs = ["config.go"], importpath = "k8s.io/kubernetes/pkg/client/leaderelectionconfig", deps = [ - "//staging/src/k8s.io/apiserver/pkg/apis/config:go_default_library", + "//staging/src/k8s.io/component-base/config:go_default_library", "//vendor/github.com/spf13/pflag:go_default_library", ], ) diff --git a/pkg/controller/apis/config/BUILD b/pkg/controller/apis/config/BUILD index 57c9f74fb1..835040c479 100644 --- a/pkg/controller/apis/config/BUILD +++ b/pkg/controller/apis/config/BUILD @@ -11,11 +11,10 @@ go_library( importpath = "k8s.io/kubernetes/pkg/controller/apis/config", visibility = ["//visibility:public"], deps = [ - "//staging/src/k8s.io/apimachinery/pkg/apis/config:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", - "//staging/src/k8s.io/apiserver/pkg/apis/config:go_default_library", + "//staging/src/k8s.io/component-base/config:go_default_library", ], ) diff --git a/pkg/controller/apis/config/v1alpha1/BUILD b/pkg/controller/apis/config/v1alpha1/BUILD index 9eeef54bd8..77afbe4c4e 100644 --- a/pkg/controller/apis/config/v1alpha1/BUILD +++ b/pkg/controller/apis/config/v1alpha1/BUILD @@ -15,12 +15,11 @@ go_library( visibility = ["//visibility:public"], deps = [ "//pkg/controller/apis/config:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/conversion:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", - "//staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1:go_default_library", + "//staging/src/k8s.io/component-base/config/v1alpha1:go_default_library", "//staging/src/k8s.io/kube-controller-manager/config/v1alpha1:go_default_library", "//vendor/k8s.io/utils/pointer:go_default_library", ], diff --git a/pkg/controller/apis/config/v1alpha1/zz_generated.conversion.go b/pkg/controller/apis/config/v1alpha1/zz_generated.conversion.go index 1e7718d084..57cd312283 100644 --- a/pkg/controller/apis/config/v1alpha1/zz_generated.conversion.go +++ b/pkg/controller/apis/config/v1alpha1/zz_generated.conversion.go @@ -23,11 +23,10 @@ package v1alpha1 import ( unsafe "unsafe" - apisconfigv1alpha1 "k8s.io/apimachinery/pkg/apis/config/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" - pkgapisconfigv1alpha1 "k8s.io/apiserver/pkg/apis/config/v1alpha1" + componentbaseconfigv1alpha1 "k8s.io/component-base/config/v1alpha1" v1alpha1 "k8s.io/kube-controller-manager/config/v1alpha1" config "k8s.io/kubernetes/pkg/controller/apis/config" ) @@ -528,15 +527,15 @@ func autoConvert_v1alpha1_GenericControllerManagerConfiguration_To_config_Generi out.Port = in.Port out.Address = in.Address out.MinResyncPeriod = in.MinResyncPeriod - if err := apisconfigv1alpha1.Convert_v1alpha1_ClientConnectionConfiguration_To_config_ClientConnectionConfiguration(&in.ClientConnection, &out.ClientConnection, s); err != nil { + if err := componentbaseconfigv1alpha1.Convert_v1alpha1_ClientConnectionConfiguration_To_config_ClientConnectionConfiguration(&in.ClientConnection, &out.ClientConnection, s); err != nil { return err } out.ControllerStartInterval = in.ControllerStartInterval - if err := pkgapisconfigv1alpha1.Convert_v1alpha1_LeaderElectionConfiguration_To_config_LeaderElectionConfiguration(&in.LeaderElection, &out.LeaderElection, s); err != nil { + if err := componentbaseconfigv1alpha1.Convert_v1alpha1_LeaderElectionConfiguration_To_config_LeaderElectionConfiguration(&in.LeaderElection, &out.LeaderElection, s); err != nil { return err } out.Controllers = *(*[]string)(unsafe.Pointer(&in.Controllers)) - if err := pkgapisconfigv1alpha1.Convert_v1alpha1_DebuggingConfiguration_To_config_DebuggingConfiguration(&in.Debugging, &out.Debugging, s); err != nil { + if err := componentbaseconfigv1alpha1.Convert_v1alpha1_DebuggingConfiguration_To_config_DebuggingConfiguration(&in.Debugging, &out.Debugging, s); err != nil { return err } return nil @@ -546,15 +545,15 @@ func autoConvert_config_GenericControllerManagerConfiguration_To_v1alpha1_Generi out.Port = in.Port out.Address = in.Address out.MinResyncPeriod = in.MinResyncPeriod - if err := apisconfigv1alpha1.Convert_config_ClientConnectionConfiguration_To_v1alpha1_ClientConnectionConfiguration(&in.ClientConnection, &out.ClientConnection, s); err != nil { + if err := componentbaseconfigv1alpha1.Convert_config_ClientConnectionConfiguration_To_v1alpha1_ClientConnectionConfiguration(&in.ClientConnection, &out.ClientConnection, s); err != nil { return err } out.ControllerStartInterval = in.ControllerStartInterval - if err := pkgapisconfigv1alpha1.Convert_config_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration(&in.LeaderElection, &out.LeaderElection, s); err != nil { + if err := componentbaseconfigv1alpha1.Convert_config_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration(&in.LeaderElection, &out.LeaderElection, s); err != nil { return err } out.Controllers = *(*[]string)(unsafe.Pointer(&in.Controllers)) - if err := pkgapisconfigv1alpha1.Convert_config_DebuggingConfiguration_To_v1alpha1_DebuggingConfiguration(&in.Debugging, &out.Debugging, s); err != nil { + if err := componentbaseconfigv1alpha1.Convert_config_DebuggingConfiguration_To_v1alpha1_DebuggingConfiguration(&in.Debugging, &out.Debugging, s); err != nil { return err } return nil diff --git a/pkg/proxy/apis/config/BUILD b/pkg/proxy/apis/config/BUILD index 475d4233b4..bc94d8d062 100644 --- a/pkg/proxy/apis/config/BUILD +++ b/pkg/proxy/apis/config/BUILD @@ -15,10 +15,10 @@ go_library( ], importpath = "k8s.io/kubernetes/pkg/proxy/apis/config", deps = [ - "//staging/src/k8s.io/apimachinery/pkg/apis/config:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", + "//staging/src/k8s.io/component-base/config:go_default_library", ], ) diff --git a/pkg/proxy/apis/config/v1alpha1/BUILD b/pkg/proxy/apis/config/v1alpha1/BUILD index 864bbddcbc..aed068d845 100644 --- a/pkg/proxy/apis/config/v1alpha1/BUILD +++ b/pkg/proxy/apis/config/v1alpha1/BUILD @@ -20,11 +20,11 @@ go_library( "//pkg/kubelet/qos:go_default_library", "//pkg/master/ports:go_default_library", "//pkg/proxy/apis/config:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/conversion:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", + "//staging/src/k8s.io/component-base/config/v1alpha1:go_default_library", "//staging/src/k8s.io/kube-proxy/config/v1alpha1:go_default_library", "//vendor/k8s.io/utils/pointer:go_default_library", ], diff --git a/pkg/proxy/apis/config/v1alpha1/zz_generated.conversion.go b/pkg/proxy/apis/config/v1alpha1/zz_generated.conversion.go index 0cf098cbec..eedc7344fc 100644 --- a/pkg/proxy/apis/config/v1alpha1/zz_generated.conversion.go +++ b/pkg/proxy/apis/config/v1alpha1/zz_generated.conversion.go @@ -23,10 +23,10 @@ package v1alpha1 import ( unsafe "unsafe" - configv1alpha1 "k8s.io/apimachinery/pkg/apis/config/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" + configv1alpha1 "k8s.io/component-base/config/v1alpha1" v1alpha1 "k8s.io/kube-proxy/config/v1alpha1" config "k8s.io/kubernetes/pkg/proxy/apis/config" ) diff --git a/pkg/proxy/apis/config/validation/BUILD b/pkg/proxy/apis/config/validation/BUILD index c99aca3019..063de35c5c 100644 --- a/pkg/proxy/apis/config/validation/BUILD +++ b/pkg/proxy/apis/config/validation/BUILD @@ -13,10 +13,10 @@ go_library( deps = [ "//pkg/apis/core/validation:go_default_library", "//pkg/proxy/apis/config:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/apis/config:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/net:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/validation/field:go_default_library", + "//staging/src/k8s.io/component-base/config:go_default_library", ], ) @@ -39,9 +39,9 @@ go_test( embed = [":go_default_library"], deps = [ "//pkg/proxy/apis/config:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/apis/config:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/validation/field:go_default_library", + "//staging/src/k8s.io/component-base/config:go_default_library", "//vendor/k8s.io/utils/pointer:go_default_library", ], ) diff --git a/pkg/scheduler/apis/config/BUILD b/pkg/scheduler/apis/config/BUILD index f5b97f3946..7abec4f179 100644 --- a/pkg/scheduler/apis/config/BUILD +++ b/pkg/scheduler/apis/config/BUILD @@ -11,11 +11,10 @@ go_library( importpath = "k8s.io/kubernetes/pkg/scheduler/apis/config", visibility = ["//visibility:public"], deps = [ - "//staging/src/k8s.io/apimachinery/pkg/apis/config:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", - "//staging/src/k8s.io/apiserver/pkg/apis/config:go_default_library", + "//staging/src/k8s.io/component-base/config:go_default_library", ], ) diff --git a/pkg/scheduler/apis/config/v1alpha1/BUILD b/pkg/scheduler/apis/config/v1alpha1/BUILD index 7bf49bb794..1d778ff9f6 100644 --- a/pkg/scheduler/apis/config/v1alpha1/BUILD +++ b/pkg/scheduler/apis/config/v1alpha1/BUILD @@ -17,11 +17,10 @@ go_library( "//pkg/kubelet/apis:go_default_library", "//pkg/master/ports:go_default_library", "//pkg/scheduler/apis/config:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/conversion:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", - "//staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1:go_default_library", + "//staging/src/k8s.io/component-base/config/v1alpha1:go_default_library", "//staging/src/k8s.io/kube-scheduler/config/v1alpha1:go_default_library", ], ) diff --git a/pkg/scheduler/apis/config/v1alpha1/zz_generated.conversion.go b/pkg/scheduler/apis/config/v1alpha1/zz_generated.conversion.go index e926bf835f..9eca1a1f25 100644 --- a/pkg/scheduler/apis/config/v1alpha1/zz_generated.conversion.go +++ b/pkg/scheduler/apis/config/v1alpha1/zz_generated.conversion.go @@ -23,10 +23,9 @@ package v1alpha1 import ( unsafe "unsafe" - configv1alpha1 "k8s.io/apimachinery/pkg/apis/config/v1alpha1" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" - apisconfigv1alpha1 "k8s.io/apiserver/pkg/apis/config/v1alpha1" + configv1alpha1 "k8s.io/component-base/config/v1alpha1" v1alpha1 "k8s.io/kube-scheduler/config/v1alpha1" config "k8s.io/kubernetes/pkg/scheduler/apis/config" ) @@ -115,7 +114,7 @@ func autoConvert_v1alpha1_KubeSchedulerConfiguration_To_config_KubeSchedulerConf } out.HealthzBindAddress = in.HealthzBindAddress out.MetricsBindAddress = in.MetricsBindAddress - if err := apisconfigv1alpha1.Convert_v1alpha1_DebuggingConfiguration_To_config_DebuggingConfiguration(&in.DebuggingConfiguration, &out.DebuggingConfiguration, s); err != nil { + if err := configv1alpha1.Convert_v1alpha1_DebuggingConfiguration_To_config_DebuggingConfiguration(&in.DebuggingConfiguration, &out.DebuggingConfiguration, s); err != nil { return err } out.DisablePreemption = in.DisablePreemption @@ -144,7 +143,7 @@ func autoConvert_config_KubeSchedulerConfiguration_To_v1alpha1_KubeSchedulerConf } out.HealthzBindAddress = in.HealthzBindAddress out.MetricsBindAddress = in.MetricsBindAddress - if err := apisconfigv1alpha1.Convert_config_DebuggingConfiguration_To_v1alpha1_DebuggingConfiguration(&in.DebuggingConfiguration, &out.DebuggingConfiguration, s); err != nil { + if err := configv1alpha1.Convert_config_DebuggingConfiguration_To_v1alpha1_DebuggingConfiguration(&in.DebuggingConfiguration, &out.DebuggingConfiguration, s); err != nil { return err } out.DisablePreemption = in.DisablePreemption @@ -160,7 +159,7 @@ func Convert_config_KubeSchedulerConfiguration_To_v1alpha1_KubeSchedulerConfigur } func autoConvert_v1alpha1_KubeSchedulerLeaderElectionConfiguration_To_config_KubeSchedulerLeaderElectionConfiguration(in *v1alpha1.KubeSchedulerLeaderElectionConfiguration, out *config.KubeSchedulerLeaderElectionConfiguration, s conversion.Scope) error { - if err := apisconfigv1alpha1.Convert_v1alpha1_LeaderElectionConfiguration_To_config_LeaderElectionConfiguration(&in.LeaderElectionConfiguration, &out.LeaderElectionConfiguration, s); err != nil { + if err := configv1alpha1.Convert_v1alpha1_LeaderElectionConfiguration_To_config_LeaderElectionConfiguration(&in.LeaderElectionConfiguration, &out.LeaderElectionConfiguration, s); err != nil { return err } out.LockObjectNamespace = in.LockObjectNamespace @@ -174,7 +173,7 @@ func Convert_v1alpha1_KubeSchedulerLeaderElectionConfiguration_To_config_KubeSch } func autoConvert_config_KubeSchedulerLeaderElectionConfiguration_To_v1alpha1_KubeSchedulerLeaderElectionConfiguration(in *config.KubeSchedulerLeaderElectionConfiguration, out *v1alpha1.KubeSchedulerLeaderElectionConfiguration, s conversion.Scope) error { - if err := apisconfigv1alpha1.Convert_config_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration(&in.LeaderElectionConfiguration, &out.LeaderElectionConfiguration, s); err != nil { + if err := configv1alpha1.Convert_config_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration(&in.LeaderElectionConfiguration, &out.LeaderElectionConfiguration, s); err != nil { return err } out.LockObjectNamespace = in.LockObjectNamespace diff --git a/pkg/scheduler/apis/config/validation/BUILD b/pkg/scheduler/apis/config/validation/BUILD index 8af91c1804..2cc049d040 100644 --- a/pkg/scheduler/apis/config/validation/BUILD +++ b/pkg/scheduler/apis/config/validation/BUILD @@ -7,10 +7,9 @@ go_library( visibility = ["//visibility:public"], deps = [ "//pkg/scheduler/apis/config:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/apis/config/validation:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/validation:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/validation/field:go_default_library", - "//staging/src/k8s.io/apiserver/pkg/apis/config/validation:go_default_library", + "//staging/src/k8s.io/component-base/config/validation:go_default_library", ], ) @@ -20,9 +19,8 @@ go_test( embed = [":go_default_library"], deps = [ "//pkg/scheduler/apis/config:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/apis/config:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//staging/src/k8s.io/apiserver/pkg/apis/config:go_default_library", + "//staging/src/k8s.io/component-base/config:go_default_library", ], ) diff --git a/staging/src/BUILD b/staging/src/BUILD index b825bedaa6..a41d8d927e 100644 --- a/staging/src/BUILD +++ b/staging/src/BUILD @@ -23,7 +23,6 @@ filegroup( "//staging/src/k8s.io/apimachinery/pkg/api/meta:all-srcs", "//staging/src/k8s.io/apimachinery/pkg/api/resource:all-srcs", "//staging/src/k8s.io/apimachinery/pkg/api/validation:all-srcs", - "//staging/src/k8s.io/apimachinery/pkg/apis/config:all-srcs", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/fuzzer:all-srcs", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/internalversion:all-srcs", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:all-srcs", @@ -209,6 +208,7 @@ filegroup( "//staging/src/k8s.io/code-generator/pkg/namer:all-srcs", "//staging/src/k8s.io/code-generator/pkg/util:all-srcs", "//staging/src/k8s.io/code-generator/third_party/forked/golang/reflect:all-srcs", + "//staging/src/k8s.io/component-base/config:all-srcs", "//staging/src/k8s.io/csi-api/pkg/apis/csi/v1alpha1:all-srcs", "//staging/src/k8s.io/csi-api/pkg/client/clientset/versioned:all-srcs", "//staging/src/k8s.io/csi-api/pkg/client/informers/externalversions:all-srcs", diff --git a/staging/src/k8s.io/kube-controller-manager/config/v1alpha1/BUILD b/staging/src/k8s.io/kube-controller-manager/config/v1alpha1/BUILD index 8ad6dcdc5d..dc774b1d6e 100644 --- a/staging/src/k8s.io/kube-controller-manager/config/v1alpha1/BUILD +++ b/staging/src/k8s.io/kube-controller-manager/config/v1alpha1/BUILD @@ -12,11 +12,10 @@ go_library( importpath = "k8s.io/kube-controller-manager/config/v1alpha1", visibility = ["//visibility:public"], deps = [ - "//staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", - "//staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1:go_default_library", + "//staging/src/k8s.io/component-base/config/v1alpha1:go_default_library", ], ) diff --git a/staging/src/k8s.io/kube-proxy/config/v1alpha1/BUILD b/staging/src/k8s.io/kube-proxy/config/v1alpha1/BUILD index 93cbf53599..e6f48d8ae4 100644 --- a/staging/src/k8s.io/kube-proxy/config/v1alpha1/BUILD +++ b/staging/src/k8s.io/kube-proxy/config/v1alpha1/BUILD @@ -12,10 +12,10 @@ go_library( importpath = "k8s.io/kube-proxy/config/v1alpha1", visibility = ["//visibility:public"], deps = [ - "//staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", + "//staging/src/k8s.io/component-base/config/v1alpha1:go_default_library", ], ) diff --git a/staging/src/k8s.io/kube-scheduler/config/v1alpha1/BUILD b/staging/src/k8s.io/kube-scheduler/config/v1alpha1/BUILD index 8c86fbeb87..d9ca51ea52 100644 --- a/staging/src/k8s.io/kube-scheduler/config/v1alpha1/BUILD +++ b/staging/src/k8s.io/kube-scheduler/config/v1alpha1/BUILD @@ -12,11 +12,10 @@ go_library( importpath = "k8s.io/kube-scheduler/config/v1alpha1", visibility = ["//visibility:public"], deps = [ - "//staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", - "//staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1:go_default_library", + "//staging/src/k8s.io/component-base/config/v1alpha1:go_default_library", ], )