Skip to content

fix: update go-control-plane to support MONTH, WEEK, and YEAR rate limit units#941

Merged
collin-lee merged 1 commit intoenvoyproxy:mainfrom
okdas:fix/update-go-control-plane-for-month-support
Aug 14, 2025
Merged

fix: update go-control-plane to support MONTH, WEEK, and YEAR rate limit units#941
collin-lee merged 1 commit intoenvoyproxy:mainfrom
okdas:fix/update-go-control-plane-for-month-support

Conversation

@okdas
Copy link
Copy Markdown
Contributor

@okdas okdas commented Aug 13, 2025

Summary

Updates the go-control-plane/ratelimit module to include support for MONTH, WEEK, and YEAR rate limit units, aligning with Envoy Gateway v1.5.0+ capabilities.

Context

This unblocks the issue originally raised in envoyproxy/gateway#4495 which was mistakenly closed. The support for MONTH and YEAR units was:

However, the ratelimit service itself was still using an older version of go-control-plane that didn't include these enum definitions.

Problem

When Envoy Gateway v1.5.0+ sends rate limit configurations with "Month" unit via xDS, the ratelimit service fails with:

Error loading new configuration: middleware/guard-rate-limit-policy: invalid rate limit unit '5'

This occurs because:

  1. Envoy Gateway correctly sends the enum value 5 for MONTH via xDS
  2. The ratelimit service's version of go-control-plane (v0.1.0) doesn't have MONTH enum defined
  3. When converting from protobuf to YAML, .String() on enum value 5 returns "5" instead of "MONTH"
  4. The YAML parser then rejects "5" as an invalid unit string

Solution

Updated dependencies:

  • github.com/envoyproxy/go-control-plane/ratelimit to v0.1.1-0.20250812085011 (includes MONTH/WEEK/YEAR enums)
  • Related dependencies updated to maintain compatibility

Testing

  • Built the project successfully with go build ./...
  • Verified MONTH (5), WEEK (7), and YEAR (6) enums are now present in vendored protobuf files
  • Confirmed the enum .String() method now correctly returns "MONTH", "WEEK", "YEAR" instead of numeric values

Related Issues & PRs

This completes the chain of updates needed for full MONTH/WEEK/YEAR rate limit support across the Envoy ecosystem.

@arkodg
Copy link
Copy Markdown
Contributor

arkodg commented Aug 13, 2025

hey @okdas can you fix DCO / sign your commit and force push ?

…mit units

Updates the go-control-plane/ratelimit module to v0.1.1-0.20250812085011
which includes support for MONTH, WEEK, and YEAR rate limit units that
were added in commit acb1b95dadd4859dea1a0c62f1c0997786c102ec.

This fixes the issue where rate limit configurations using "Month" unit
were failing with "invalid rate limit unit '5'" error because the
previous version did not include the enum definitions for these units.

Fixes envoyproxy/ratelimit#XXX

Signed-off-by: Dmitry K <okdas@pm.me>
@okdas okdas force-pushed the fix/update-go-control-plane-for-month-support branch from 3dbfa4e to a007e81 Compare August 13, 2025 23:01
@okdas
Copy link
Copy Markdown
Contributor Author

okdas commented Aug 13, 2025

hey @okdas can you fix DCO / sign your commit and force push ?

Thanks! This has been done.

@Olshansk
Copy link
Copy Markdown

@okdas Thanks for doing the deep dive here.

@arkodg Thank you for the review!


@arkodg Could you please take a look at this comment.

If you could just publish a dev release as soon as tomorrow, we can push and test it in prod!

If not, it'll be a bit of overhead but we'd likely have to fork and fragment the system.

@arkodg
Copy link
Copy Markdown
Contributor

arkodg commented Aug 14, 2025

@Olshansk getting this PR in should be enough for now, you can use the generated tag (short sha which will should show up in https://hub.docker.com/r/envoyproxy/ratelimit/tags in the helm chart https://gateway.envoyproxy.io/docs/install/gateway-helm-api/#values as a workaround until EG v1.5.1 is out

@Olshansk
Copy link
Copy Markdown

Will do.

Thank you for the ultra fast response @arkodg!

@Olshansk
Copy link
Copy Markdown

@arkodg Can you trigger the workflows so we can kick things off and push things forward?

@arkodg
Copy link
Copy Markdown
Contributor

arkodg commented Aug 14, 2025

this will need a review from the maintainers, ptal @collin-lee / @psbrar99

@collin-lee collin-lee merged commit 38f0198 into envoyproxy:main Aug 14, 2025
6 checks passed
@Olshansk
Copy link
Copy Markdown

tl;dr @collin-lee Appreciate the review and merge here!


I'll continue the conversation in envoyproxy/go-control-plane#1245.

There might still be an open question if "it's ready".

If you guys ever need feedback (dev images, our usage, etc), let us know!

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.

5 participants