Skip to content

fix(hpa): create pulp-web HPA when ingress_type=ingress#1648

Open
mouchar wants to merge 1 commit into
pulp:mainfrom
mouchar:hpa-fix
Open

fix(hpa): create pulp-web HPA when ingress_type=ingress#1648
mouchar wants to merge 1 commit into
pulp:mainfrom
mouchar:hpa-fix

Conversation

@mouchar
Copy link
Copy Markdown

@mouchar mouchar commented Jun 6, 2026

Summary

  • The web HPA gate in hpaController used !isRoute && !isIngress, which skipped HPA creation whenever ingress_type=ingress — even though pulp-web is still deployed in that mode unless the ingress controller is nginx-supported.
  • Align the gate with needsPulpWeb() (controllers/repo_manager/utils.go:354) so the HPA follows the deployment. Without this, users enabling spec.web.hpa with ingress_type=ingress get no HorizontalPodAutoscaler for pulp-web, while api/content/worker HPAs work fine.
  • Add controllers/repo_manager/hpa_test.go with a table-driven test covering all four ingress_type × IsNginxIngress combinations to guard the gate against regressions.

Test plan

  • go build ./... passes
  • go test ./controllers/repo_manager/ -run TestHpaControllerWebGating -v passes
  • Verified the new test fails on the pre-fix code (only the ingress_type=ingress + non-nginx subtest fails — exactly the bug case) and passes after the fix
  • Manual verification on a cluster: deploy a Pulp CR with spec.ingress_type=ingress and spec.web.hpa.enabled=true; confirm the pulp-web HPA is created

The web HPA gate in hpaController used '!isRoute && !isIngress',
which skipped HPA creation whenever ingress_type=ingress even though
pulp-web is still deployed in that mode unless the ingress controller
is nginx-supported. Align the gate with needsPulpWeb() so the HPA
follows the deployment.

Add hpa_test.go covering the four ingress_type / IsNginxIngress
combinations to guard the gate against regressions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@openshift-ci openshift-ci Bot requested review from dkliban and git-hyagi June 6, 2026 10:10
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Jun 6, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mouchar
Once this PR has been reviewed and has the lgtm label, please assign git-hyagi for approval. For more information see the Code Review Process.

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

Details 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

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Jun 6, 2026

Hi @mouchar. Thanks for your PR.

I'm waiting for a pulp member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant