feat: add wildcard support for ingress class matching#4615
Open
czuares wants to merge 1 commit intoargoproj:masterfrom
Open
feat: add wildcard support for ingress class matching#4615czuares wants to merge 1 commit intoargoproj:masterfrom
czuares wants to merge 1 commit intoargoproj:masterfrom
Conversation
3c26912 to
6c099b0
Compare
Add support for wildcard patterns in --alb-ingress-classes and --nginx-ingress-classes flags to match multiple ingress classes: - '*' matches any ingress class - 'prefix-*' matches classes starting with prefix - '*-suffix' matches classes ending with suffix This allows for more flexible ingress class configuration without needing to list each class individually. Changes: - Updated hasClass() function to support wildcard matching - Added comprehensive unit tests for wildcard patterns - Updated ALB and NGINX documentation with examples Signed-off-by: Corey Zuares <czuares@drivewealth.com>
6c099b0 to
faeea3a
Compare
|
Contributor
Published E2E Test Results 4 files 4 suites 3h 30m 45s ⏱️ For more details on these failures, see this check. Results for commit faeea3a. |
Contributor
Published Unit Test Results2 416 tests 2 416 ✅ 3m 4s ⏱️ Results for commit faeea3a. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4615 +/- ##
==========================================
+ Coverage 84.40% 84.41% +0.01%
==========================================
Files 164 164
Lines 18855 18865 +10
==========================================
+ Hits 15914 15925 +11
Misses 2077 2077
+ Partials 864 863 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
This PR adds wildcard pattern support for ingress class matching in the
--alb-ingress-classesand--nginx-ingress-classesflags.Motivation
When managing multiple ingress controllers with similar naming patterns (e.g.,
nginx-internal,nginx-external,nginx-staging), users currently need to specify each class individually. This becomes cumbersome and error-prone when the number of ingress classes grows.Changes
Core Implementation
hasClass()function iningress/ingress.goto support wildcard patterns:*- matches any ingress classprefix-*- matches classes starting with the prefix*-suffix- matches classes ending with the suffixTesting
ingress/ingress_test.gowith 24 test cases covering:*)prefix-*)*-suffix)Documentation
docs/features/traffic-management/nginx.mdwith wildcard pattern documentation and examplesdocs/features/traffic-management/alb.mdwith wildcard pattern documentation and examplesExamples
Checklist
Testing
All existing tests pass, and new tests verify the wildcard functionality:
go test -v ./ingress -run TestHasClass