Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Rate-Limit xDS config server related control plane functionality #598

Merged
merged 4 commits into from
Jan 27, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/cache/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,6 @@ const (
Secret
Runtime
ExtensionConfig
RateLimitConfig
UnknownType // token to count the total number of supported types
)
7 changes: 7 additions & 0 deletions pkg/cache/v3/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
"github.com/envoyproxy/go-control-plane/pkg/cache/types"
"github.com/envoyproxy/go-control-plane/pkg/resource/v3"
"github.com/envoyproxy/go-control-plane/pkg/wellknown"
ratelimit "github.com/envoyproxy/go-control-plane/ratelimit/config/ratelimit/v3"
)

// GetResponseType returns the enumeration for a valid xDS type URL.
Expand All @@ -54,6 +55,8 @@ func GetResponseType(typeURL resource.Type) types.ResponseType {
return types.Runtime
case resource.ExtensionConfigType:
return types.ExtensionConfig
case resource.RateLimitConfigType:
return types.RateLimitConfig
}
return types.UnknownType
}
Expand All @@ -79,6 +82,8 @@ func GetResponseTypeURL(responseType types.ResponseType) (string, error) {
return resource.RuntimeType, nil
case types.ExtensionConfig:
return resource.ExtensionConfigType, nil
case types.RateLimitConfig:
return resource.RateLimitConfigType, nil
default:
return "", fmt.Errorf("couldn't map response type %v to known resource type", responseType)
}
Expand All @@ -105,6 +110,8 @@ func GetResourceName(res types.Resource) string {
return v.GetName()
case *core.TypedExtensionConfig:
return v.GetName()
case *ratelimit.RateLimitConfig:
return v.GetName()
default:
return ""
}
Expand Down
3 changes: 3 additions & 0 deletions pkg/resource/v3/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ const (
ExtensionConfigType = APITypePrefix + "envoy.config.core.v3.TypedExtensionConfig"
RuntimeType = APITypePrefix + "envoy.service.runtime.v3.Runtime"

// Rate Limit service
RateLimitConfigType = APITypePrefix + "ratelimit.config.ratelimit.v3.RateLimitConfig"
renuka-fernando marked this conversation as resolved.
Show resolved Hide resolved

// AnyType is used only by ADS
AnyType = ""
)
Expand Down
Loading