ingress-nginx icon indicating copy to clipboard operation
ingress-nginx copied to clipboard

Draft: Fixing alternative balancer selector

Open mavriq opened this issue 4 weeks ago • 4 comments

What this PR does / why we need it:

Why is this change required? What problem does it solve?

The current implementation of balancer.lua contains a bug where the system incorrectly handles configurations with multiple alternative balancers. The code has an artificial limitation that prohibits using more than one alternative balancer, throwing the error "only one alternative balancer is currently supported".

This is a bug fix, not a new feature, because:

  • The system already supports configurations with multiple alternative balancers at the configuration level
  • The processing logic for multiple balancers is already partially implemented in the code
  • The limitation is artificial and doesn't align with the system's architectural capabilities

What changes were made?

  • Removed the artificial limitation on the number of alternative balancers
  • Restored full functionality of the check chain for all alternative balancers
  • Preserved the original business logic of checks
    • affinity
    • header
    • cookie
    • weight
  • Maintained the ability to explicitly deny via never values in traffic policies

Types of changes

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] CVE Report (Scanner found CVE and adding report)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] Documentation only

Which issue/s this PR fixes

fixes #6922

How Has This Been Tested?

Checklist:

  • [ ] My change requires a change to the documentation.
  • [ ] I have updated the documentation accordingly.
  • [x] I've read the CONTRIBUTION guide
  • [x] I have added unit and/or e2e tests to cover my changes.
  • [ ] All new and existing tests passed.

mavriq avatar Nov 22 '25 17:11 mavriq

This issue is currently awaiting triage.

If Ingress contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

k8s-ci-robot avatar Nov 22 '25 17:11 k8s-ci-robot

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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 /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Nov 22 '25 17:11 k8s-ci-robot

Hi @mavriq. Thanks for your PR.

I'm waiting for a github.com 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.

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.

k8s-ci-robot avatar Nov 22 '25 17:11 k8s-ci-robot

Deploy Preview for kubernetes-ingress-nginx canceled.

Name Link
Latest commit 4f5854088df4009f016caeaac124c4229447ea20
Latest deploy log https://app.netlify.com/projects/kubernetes-ingress-nginx/deploys/692c84876c34900008108c85

netlify[bot] avatar Nov 22 '25 17:11 netlify[bot]