Skip to content

Reconcile listener rule tags for all matched rules#4772

Open
andreybutenko wants to merge 1 commit into
kubernetes-sigs:mainfrom
andreybutenko:2026-05-28-listener-rule-tags-bugfix
Open

Reconcile listener rule tags for all matched rules#4772
andreybutenko wants to merge 1 commit into
kubernetes-sigs:mainfrom
andreybutenko:2026-05-28-listener-rule-tags-bugfix

Conversation

@andreybutenko
Copy link
Copy Markdown
Contributor

Reconcile listener rule tags for all matched rules

Motivation

In some cases, listener rule tags would not be updated after alb.ingress.kubernetes.io/tags is changed.

Specifically:

  • The synthesizeListenerRulesOnListener function only called UpdateRulesTags for listener rules where the settings (condition/action/transform) match but priority differs.
  • However, it did not call UpdateRulesTags for 1/ listener rules where the settings and priority both match or 2/ listener rules where the settings don't match but the priority does.

Details

  • Update matchResAndSDKListenerRules to return matchedResAndSDKLRsFullyMatched for fully-matched listener rules that only need tag reconciliation
  • Update synthesizeListenerRulesOnListener to also reconcile tags for matchedResAndSDKLRsFullyMatched and matchedResAndSDKLRsByPriority
  • Add and update unit tests

Testing

Unit tests pass

=== RUN   Test_matchResAndSDKListenerRules
=== RUN   Test_matchResAndSDKListenerRules/all_listener_rules_has_match
=== RUN   Test_matchResAndSDKListenerRules/all_listener_rules_settings_has_match_but_not_priority
=== RUN   Test_matchResAndSDKListenerRules/all_listener_rules_settings_including_transforms_has_match_but_not_priority
=== RUN   Test_matchResAndSDKListenerRules/some_listener_rules_settings_has_match_but_not_priority,_some_listener_rules_priority_match_but_not_settings
=== RUN   Test_matchResAndSDKListenerRules/some_listener_rules_settings_has_match_but_not_priority,_some_listener_rules_priority_match_but_not_settings(requires_modification),_some_needs_to_be_created_and_some_sdk_needs_to_be_deleted
--- PASS: Test_matchResAndSDKListenerRules (0.05s)
    --- PASS: Test_matchResAndSDKListenerRules/all_listener_rules_has_match (0.01s)
    --- PASS: Test_matchResAndSDKListenerRules/all_listener_rules_settings_has_match_but_not_priority (0.01s)
    --- PASS: Test_matchResAndSDKListenerRules/all_listener_rules_settings_including_transforms_has_match_but_not_priority (0.01s)
    --- PASS: Test_matchResAndSDKListenerRules/some_listener_rules_settings_has_match_but_not_priority,_some_listener_rules_priority_match_but_not_settings (0.01s)
    --- PASS: Test_matchResAndSDKListenerRules/some_listener_rules_settings_has_match_but_not_priority,_some_listener_rules_priority_match_but_not_settings(requires_modification),_some_needs_to_be_created_and_some_sdk_needs_to_be_deleted (0.02s)
=== RUN   Test_CreateAndDeleteRules
=== RUN   Test_CreateAndDeleteRules/no_rules
=== RUN   Test_CreateAndDeleteRules/just_creation
=== RUN   Test_CreateAndDeleteRules/just_deletes
=== RUN   Test_CreateAndDeleteRules/just_creation_--_at_limit
=== RUN   Test_CreateAndDeleteRules/just_deletes_--_at_max_limit
=== RUN   Test_CreateAndDeleteRules/mix_of_deletes_and_creates
=== RUN   Test_CreateAndDeleteRules/mix_of_deletes_and_creates_--_already_at_limit
=== RUN   Test_CreateAndDeleteRules/mix_of_deletes_and_creates_--_limit_reached_part_way_between_creations
--- PASS: Test_CreateAndDeleteRules (0.00s)
    --- PASS: Test_CreateAndDeleteRules/no_rules (0.00s)
    --- PASS: Test_CreateAndDeleteRules/just_creation (0.00s)
    --- PASS: Test_CreateAndDeleteRules/just_deletes (0.00s)
    --- PASS: Test_CreateAndDeleteRules/just_creation_--_at_limit (0.00s)
    --- PASS: Test_CreateAndDeleteRules/just_deletes_--_at_max_limit (0.00s)
    --- PASS: Test_CreateAndDeleteRules/mix_of_deletes_and_creates (0.00s)
    --- PASS: Test_CreateAndDeleteRules/mix_of_deletes_and_creates_--_already_at_limit (0.00s)
    --- PASS: Test_CreateAndDeleteRules/mix_of_deletes_and_creates_--_limit_reached_part_way_between_creations (0.00s)
=== RUN   Test_synthesizeListenerRulesOnListener_TagsUpdatedForAllBuckets
=== RUN   Test_synthesizeListenerRulesOnListener_TagsUpdatedForAllBuckets/tags-only_change_on_fully_matched_rule_triggers_UpdateRulesTags
=== RUN   Test_synthesizeListenerRulesOnListener_TagsUpdatedForAllBuckets/priority-matched_rule_with_different_actions_also_gets_UpdateRulesTags
--- PASS: Test_synthesizeListenerRulesOnListener_TagsUpdatedForAllBuckets (0.00s)
    --- PASS: Test_synthesizeListenerRulesOnListener_TagsUpdatedForAllBuckets/tags-only_change_on_fully_matched_rule_triggers_UpdateRulesTags (0.00s)
    --- PASS: Test_synthesizeListenerRulesOnListener_TagsUpdatedForAllBuckets/priority-matched_rule_with_different_actions_also_gets_UpdateRulesTags (0.00s)
PASS
ok  	sigs.k8s.io/aws-load-balancer-controller/pkg/deploy/elbv2	1.121s

Checklist

  • [yes] Added tests that cover your change (if possible)
  • [N/A] Added/modified documentation as required (such as the README.md, or the docs directory)
  • [no] Manually tested
  • [yes] Made sure the title of the PR is a good description that can go into the release notes

BONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯

  • [N/A] Backfilled missing tests for code in same general area 🎉
  • [N/A] Refactored something and made the world a better place 🌟

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: andreybutenko
Once this PR has been reviewed and has the lgtm label, please assign wweiwei-li 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

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 29, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Hi @andreybutenko. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

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.

@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants