Skip to content

Conversation

@mavriq
Copy link

@mavriq mavriq commented Nov 22, 2025

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

  • 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.
  • I've read the CONTRIBUTION guide
  • I have added unit and/or e2e tests to cover my changes.
  • All new and existing tests passed.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 22, 2025
@k8s-ci-robot
Copy link
Contributor

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 k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Nov 22, 2025
@k8s-ci-robot
Copy link
Contributor

[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 k8s-ci-robot added area/lua Issues or PRs related to lua code needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Nov 22, 2025
@k8s-ci-robot
Copy link
Contributor

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 k8s-ci-robot added needs-priority size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 22, 2025
@netlify
Copy link

netlify bot commented Nov 22, 2025

Deploy Preview for kubernetes-ingress-nginx canceled.

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

@Gacko Gacko marked this pull request as draft November 22, 2025 17:28
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 22, 2025
@mavriq mavriq force-pushed the fixing-alternative-balancer-selector branch from b1458bb to 392bc39 Compare November 30, 2025 17:12
Expect().
Status(http.StatusNotFound)
}
})
Copy link
Author

@mavriq mavriq Nov 30, 2025

Choose a reason for hiding this comment

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

what here was fixed:

  • added f.WaitForNginxServer... for fixing the race condition between f.EnsureIngress and f.HTTPTestClient()...Expect().Status(http.StatusNotFound)
  • test should return 404 status for requests to the canary if no matching ingress is found has been fixed (a different header is being sent than the one that is configured)
  • added several options for checking wrong headers

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

Labels

area/lua Issues or PRs related to lua code cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

I want releases multiple versions as Canary,how to do it

2 participants