PROJQUAY-12383: fix(cmpstatus): handle unmanaged component HPAs - #1311
PROJQUAY-12383: fix(cmpstatus): handle unmanaged component HPAs#1311LiZhang19817 wants to merge 1 commit into
Conversation
|
Note
|
| Layer / File(s) | Summary |
|---|---|
Dynamic HPA evaluation pkg/cmpstatus/hpa.go |
HPA names are assembled from managed components, and missing-HPA conditions include the namespaced resource name. |
HPA check validation pkg/cmpstatus/hpa_test.go, pkg/cmpstatus/evaluator_test.go |
Tests use a shared owned-HPA helper and cover managed and unmanaged Clair/Mirror combinations plus specific missing-HPA messages. |
Estimated code review effort: 2 (Simple) | ~10 minutes
🚥 Pre-merge checks | ✅ 9
✅ Passed checks (9 passed)
| Check name | Status | Explanation |
|---|---|---|
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
| Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
| Crd Backward Compatibility | ✅ Passed | No files under apis/quay/v1 were modified; the commit only changes pkg/cmpstatus/*, so CRD backward-compatibility checks are not applicable. |
| No Weak Cryptographic Algorithms | ✅ Passed | Modified HPA status code/tests contain no MD5/SHA-1/DES/RC4/3DES or InsecureSkipVerify usage. |
| No Privileged Containers | ✅ Passed | Touched files are HPA status code/tests only; diff search found no privileged:true, hostPID/Network/IPC, or SYS_ADMIN settings. |
| No Sensitive Data In Logs | ✅ Passed | Touched HPA files add no log.Info/Error/klog/fmt.Print* calls; only condition messages with HPA resource names, not secrets. |
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title starts with the required PROJQUAY ticket and accurately describes the unmanaged component HPA status change. |
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
Comment @coderabbitai help to get the list of available commands.
|
@LiZhang19817: This pull request references [Jira Issue PROJQUAY-12383](https://redhat.atlassian.net/browse/PROJQUAY-12383), which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
DetailsIn 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 openshift-eng/jira-lifecycle-plugin repository. |
|
@LiZhang19817: This pull request references [Jira Issue PROJQUAY-12383](https://redhat.atlassian.net/browse/PROJQUAY-12383), which is valid. 3 validation(s) were run on this bug
DetailsIn 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 openshift-eng/jira-lifecycle-plugin repository. |
|
@LiZhang19817: This pull request references [Jira Issue PROJQUAY-12383](https://redhat.atlassian.net/browse/PROJQUAY-12383), which is valid. 3 validation(s) were run on this bug
DetailsIn 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 openshift-eng/jira-lifecycle-plugin repository. |
|
/test ocp-latest-e2e |
|
/test ocp-latest-e2e |
2 similar comments
|
/test ocp-latest-e2e |
|
/test ocp-latest-e2e |
|
@LiZhang19817: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. I understand the commands that are listed here. |
Summary
ComponentHPAReady=False/Available=Falsewhen HPA is managed but mirror or clair (or both) are unmanagedComponentHPAReadyfailure messages for debuggabilityRoot Cause
The HPA health checker in
pkg/cmpstatus/hpa.gohard-coded a loop over all three HPAs (quay-app,clair-app,quay-mirror) without checking whether the respective backing component is managed. When mirror or clair is unmanaged, kustomize never emits their HPA manifests, so the checker hits a not-found and permanently reportsComponentHPAReady=False, which cascades toAvailable=False— even though Quay is fully functional.Changes
pkg/cmpstatus/hpa.goquay-app, conditionally includeclair-app(if clair managed) andquay-mirror(if mirror managed). Include HPA name in not-found error message.pkg/cmpstatus/hpa_test.goownedHPA()test helper. Add 3 new test cases: clair unmanaged, mirror unmanaged, both unmanaged. Update existing "all managed" test to explicitly declare clair+mirror as managed. Update expected error message.pkg/cmpstatus/evaluator_test.goJira
Test plan
go test ./pkg/cmpstatus— all unit tests passhorizontalpodautoscaler: managed: true,mirror: managed: false→ verifyComponentHPAReady=TrueandAvailable=Truehorizontalpodautoscaler: managed: true,clair: managed: false→ verifyComponentHPAReady=TrueandAvailable=Truehorizontalpodautoscaler: managed: true, both clair and mirror unmanaged → verifyComponentHPAReady=TrueAvailable=True"Horizontal pod autoscaler registry-quay-app not found")🤖 Generated with Claude Code