Skip to content
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

Add others's status in hpa describe #59609

Merged
merged 1 commit into from Mar 27, 2018
Merged

Add others's status in hpa describe #59609

merged 1 commit into from Mar 27, 2018

Conversation

zhangxiaoyu-zidif
Copy link
Contributor

@zhangxiaoyu-zidif zhangxiaoyu-zidif commented Feb 9, 2018

What this PR does / why we need it:
Add other status in HPA describe

  • rs
  • deployment

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

Release note:

Add all kinds of resource objects' statuses in HPA description.

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 9, 2018
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 9, 2018
@zhangxiaoyu-zidif zhangxiaoyu-zidif changed the title Add rs status in hpa describe Add others's status in hpa describe Feb 9, 2018
@zhangxiaoyu-zidif
Copy link
Contributor Author

/assign @liggitt
could you take a look?

@ericchiang
Copy link
Contributor

Can you add a description of what this does? Why is it needed?

@zhangxiaoyu-zidif
Copy link
Contributor Author

@ericchiang
hi, I see The Horizontal Pod Autoscaler automatically scales the number of pods in a replication controller, deployment or replica set based on observed CPU utilization in https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/ and the code only contains rc's description, I guess we may need add rs and deploy's description on HPA

@@ -2875,6 +2875,24 @@ func describeHorizontalPodAutoscaler(hpa *autoscaling.HorizontalPodAutoscaler, e
w.Write(LEVEL_0, "failed to check Replication Controller\n")
}
}
if strings.ToLower(hpa.Spec.ScaleTargetRef.Kind) == "replicaSet" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ToLower will never match "replicaSet"

We should not be adding hard coded scale targets to this function. If we want to use the generic scale client to fetch scale status, that would be better

w.Write(LEVEL_0, "failed to check ReplicaSet\n")
}
}
if strings.ToLower(hpa.Spec.ScaleTargetRef.Kind) == "deployment" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. Don't add hardcoded scale targets. Replace the existing one with a call using the polymorphic scale client

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find we can use subsource to show the current replicas and desired replicas, so I use it instead. =)

@zhangxiaoyu-zidif
Copy link
Contributor Author

/test pull-kubernetes-e2e-gce

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Mar 26, 2018
@zhangxiaoyu-zidif
Copy link
Contributor Author

@liggitt PTAL

@liggitt
Copy link
Member

liggitt commented Mar 26, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 26, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt, zhangxiaoyu-zidif

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 26, 2018
@zhangxiaoyu-zidif
Copy link
Contributor Author

/test pull-kubernetes-e2e-gce

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 61434, 61501, 59609, 61467, 61531). If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit 99fb416 into kubernetes:master Mar 27, 2018
@zhangxiaoyu-zidif zhangxiaoyu-zidif deleted the add-rs-in-hpa-describe branch March 27, 2018 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants