-
Notifications
You must be signed in to change notification settings - Fork 79
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
Properly discover HPA status #634
Conversation
This commit adds a conditions function for the HorizontalPodAutoscaler kind. It follows the definition documented [here](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/#appendix-horizontal-pod-autoscaler-status-conditions). Signed-off-by: Max Jonas Werner <[email protected]>
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 |
The Kubernetes project currently lacks enough active 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 rotten |
@karlkfi would you be able to take a look at this, please? 🙏🏻 |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close |
@k8s-triage-robot: Closed this PR. In response to this:
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. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: makkes 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 |
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.
Sorry to let this rot. Added some review comments.
@@ -74,6 +75,58 @@ func alwaysReady(u *unstructured.Unstructured) (*Result, error) { | |||
}, nil | |||
} | |||
|
|||
func hpaConditions(u *unstructured.Unstructured) (*Result, error) { |
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.
Can you add a comment that describes what this is expecting for HPA to be detected as Current?
metadata: | ||
name: test | ||
namespace: qual | ||
generation: 1 |
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.
Does HPA have an observedGeneration?
Usually we expect that observedGeneration must equal generation, otherwise the object is still reconciling.
Ideally the CRD would require observedGeneration and default it to zero, that way the status is always defined after being applied, even if the controller hasn't updated the status yet.
testCases := map[string]testSpec{ | ||
"hpaNoStatus": { | ||
spec: hpaNoStatus, | ||
expectedStatus: UnknownStatus, |
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.
Usually when an object doesn't have status, it's shown as Current, with the assumption that there might not be any status. The way to work around that is to default status.observedGeneration=0
in the CRD. Is that not true for the HPA CRD?
I wonder if we should get that changed upstream.
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 |
The Kubernetes project currently lacks enough active 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 rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close |
@k8s-triage-robot: Closed this PR. In response to this:
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-sigs/prow repository. |
This commit adds a conditions function for the HorizontalPodAutoscaler kind. It follows the definition documented
here.