-
Notifications
You must be signed in to change notification settings - Fork 2k
feat: add label selector to metrics call #3999
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
base: master
Are you sure you want to change the base?
Conversation
Welcome @at88mph! |
Fixes #3998 |
Thanks for sending a PR, we need you to fill out the SLA. |
Hi there. Yes, I'm working with my organization on how to do that as it's
a little new to us.
Thanks.
…On Thu, Apr 3, 2025 at 3:11 PM Brendan Burns ***@***.***> wrote:
Thanks for sending a PR, we need you to fill out the SLA.
—
Reply to this email directly, view it on GitHub
<#3999 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMYFZAJA77RWJKVLFFZYRD2XWWXVAVCNFSM6AAAAAB2M2HQKKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONZXGEYDKMZVGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
[image: brendandburns]*brendandburns* left a comment
(kubernetes-client/java#3999)
<#3999 (comment)>
Thanks for sending a PR, we need you to fill out the SLA.
—
Reply to this email directly, view it on GitHub
<#3999 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMYFZAJA77RWJKVLFFZYRD2XWWXVAVCNFSM6AAAAAB2M2HQKKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONZXGEYDKMZVGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
…to metrics-label-selector
Merged latest |
PodMetrics.class, PodMetricsList.class, "metrics.k8s.io", "v1beta1", "pods", apiClient); | ||
return metricsClient.list(namespace).throwsApiException().getObject(); | ||
new GenericKubernetesApi<>( | ||
PodMetrics.class, PodMetricsList.class, Metrics.API_GROUP, Metrics.API_VERSION, "pods", apiClient); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
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.
Sure, I can make that happen. Maybe the PodMetrics
class can contain "pods"
, and the NodeMetrics
class can contain "nodes"
for consistency on line 69?
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.
It's okay.
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.
Actually, scratch that. Those strings are only ever used in Metrics
, so let's keep it there.
…to metrics-label-selector
* @return PodMetricList, never null. | ||
* @throws ApiException If the ApiClient cannot complete the request. | ||
*/ | ||
public PodMetricsList getPodMetrics(String namespace, String labelSelector) throws ApiException { |
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.
getPodMetrics(String namespace, @nullable String labelSelector)
It is better to mark the nullable argument explicitly.
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.
Done, thanks.
PodMetrics.class, PodMetricsList.class, "metrics.k8s.io", "v1beta1", "pods", apiClient); | ||
return metricsClient.list(namespace).throwsApiException().getObject(); | ||
new GenericKubernetesApi<>( | ||
PodMetrics.class, PodMetricsList.class, Metrics.API_GROUP, Metrics.API_VERSION, "pods", apiClient); |
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.
It's okay.
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
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: at88mph, Sud0x67 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Changes
labelSelector
togetPodMetrics()
method inMetrics
.