-
Notifications
You must be signed in to change notification settings - Fork 38.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move k8s.io/metrics to staging/ #45180
Move k8s.io/metrics to staging/ #45180
Conversation
/release-note-none |
a8921af
to
6c4f107
Compare
6c4f107
to
4e93ee5
Compare
@DirectXMan12 PTAL. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: DirectXMan12, caesarxuchao, lavalamp
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
4e93ee5
to
3294200
Compare
Squashed and fixed some failed verification. |
@@ -26,7 +26,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh" | |||
kube::golang::verify_go_version | |||
|
|||
cd "${KUBE_ROOT}" | |||
if git --no-pager grep -E $'^(import |\t)[a-z]+[A-Z_][a-zA-Z]* "[^"]+"$' -- '**/*.go' ':(exclude)vendor/*' ':(exclude)staging/src/k8s.io/client-go/*vendor/*'; then | |||
if git --no-pager grep -E $'^(import |\t)[a-z]+[A-Z_][a-zA-Z]* "[^"]+"$' -- '**/*.go' ':(exclude)vendor/*' ':(exclude)staging/src/k8s.io/client-go/*vendor/*' ':(exclude)staging/src/k8s.io/metrics/*'; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DirectXMan12 i excluded the metrics package because the custom_client
has underscore in the name. I don't think it is worth changing the package name.
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue (batch tested with PRs 45077, 45180, 34727, 45079, 45177) |
@caesarxuchao: The following test(s) failed:
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
…ient Automatic merge from submit-queue (batch tested with PRs 45362, 45159, 45321, 45238) Remove the use of registry in fake clientset Addressing #42095 (comment) The fake clientset needed registry for multiple reasons, and this PR removed these needs: 1. translate GroupVersionResource to GroupVersionKind, the internal `tracker` (a fake apiserver) stores the objects in a map and the key is gvk. This PR changes the map key to be gvr. 2. client-go/testing/fixture.go had a function `checkNamespaced`, which used the registry as the ground truth to verify if the request send by client is properly namespace scoped. Every unit test that used the generated fake clientset would eventually call this function to verify the request sent by the fake clietnset. Such a check is useless, this PR removed `checkNamespaced` completely. 3. When the `tracker` reacted to a fake List request, it asked the registry to translate GVR to GVK, and created a list of type `GVK+"List"`. This PR lets the ListActionImpl specify the GVK explicitly to get rid of the need of the GVR to GVK translation. (the first commit is #45180)
…n-tweaks Automatic merge from submit-queue (batch tested with PRs 46801, 45184, 45930, 46192, 45563) Tweak client-gen to support metrics API This PR adds support to client-gen for readonly APIs as well as for customizing the resource name used for a given type. This is required to support the clients generated for `k8s.io/metrics/pkg/apis/metrics`. cc @caesarxuchao Currently based on #45180 **Release note**: ```release-note NONE ```
This is to break the cyclic dependency in our code base: kubernetes depends on k8s.io/metrics, which depends on kubernetes/staging/client-go.
@DirectXMan12 i actually moved it to staging because we will need the flexibility to update metrics code directly to do many planned refactors, so the copy of metrics in kubernetes has to be the source of truth.
client-gen is not enabled for the code yet, we can enable it after you port your changes to client-gen.
make generated_files
is enabled for metrics.