Skip to content

feat: add wildcard support for ingress class matching#4615

Open
czuares wants to merge 1 commit intoargoproj:masterfrom
czuares:feat/ingress-class-wildcard-support
Open

feat: add wildcard support for ingress class matching#4615
czuares wants to merge 1 commit intoargoproj:masterfrom
czuares:feat/ingress-class-wildcard-support

Conversation

@czuares
Copy link

@czuares czuares commented Feb 12, 2026

Summary

This PR adds wildcard pattern support for ingress class matching in the --alb-ingress-classes and --nginx-ingress-classes flags.

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

  • Updated hasClass() function in ingress/ingress.go to support wildcard patterns:
    • * - matches any ingress class
    • prefix-* - matches classes starting with the prefix
    • *-suffix - matches classes ending with the suffix

Testing

  • Added comprehensive unit tests in ingress/ingress_test.go with 24 test cases covering:
    • Exact matching (existing behavior)
    • Wildcard matching (*)
    • Prefix wildcards (prefix-*)
    • Suffix wildcards (*-suffix)
    • Mixed patterns
    • Edge cases

Documentation

  • Updated docs/features/traffic-management/nginx.md with wildcard pattern documentation and examples
  • Updated docs/features/traffic-management/alb.md with wildcard pattern documentation and examples

Examples

# Match all nginx-* classes
--nginx-ingress-classes nginx-*

# Match multiple patterns
--nginx-ingress-classes nginx-* --nginx-ingress-classes custom-nginx

# Match all ingress classes
--nginx-ingress-classes '*'

Checklist

  • Code changes implemented
  • Unit tests added and passing
  • Documentation updated
  • Backward compatible (exact matching still works)

Testing

All existing tests pass, and new tests verify the wildcard functionality:

go test -v ./ingress -run TestHasClass

@czuares czuares force-pushed the feat/ingress-class-wildcard-support branch from 3c26912 to 6c099b0 Compare February 12, 2026 19:02
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>
@czuares czuares force-pushed the feat/ingress-class-wildcard-support branch from 6c099b0 to faeea3a Compare February 12, 2026 19:03
@sonarqubecloud
Copy link

@github-actions
Copy link
Contributor

Published E2E Test Results

  4 files    4 suites   3h 30m 45s ⏱️
120 tests 111 ✅  7 💤 2 ❌
482 runs  452 ✅ 28 💤 2 ❌

For more details on these failures, see this check.

Results for commit faeea3a.

@github-actions
Copy link
Contributor

Published Unit Test Results

2 416 tests   2 416 ✅  3m 4s ⏱️
  129 suites      0 💤
    1 files        0 ❌

Results for commit faeea3a.

@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.41%. Comparing base (348260a) to head (faeea3a).
⚠️ Report is 1 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant