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

Update docs to specify that gRPC support is not released, fix typo in function name and update error string to include gRPC #73

Merged
merged 3 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion docs/features/grpc.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# GRPC routes

!!! warning
We tested grpc support only by looking at resources state as traffic providers didn't support grpc well at the moment of development but it would be great if you contribute a real example
We tested grpc support only by looking at resources state as traffic providers didn't support grpc well at the moment of development, but it would be great if you contribute a real example. Due to this, gRPC support is not included in the released builds, but can be tested by building the plugin from the source code.

To use GRPCRoute:

Expand Down
2 changes: 1 addition & 1 deletion pkg/plugin/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package plugin

const (
GatewayAPIUpdateError = "error updating Gateway API %q: %s"
GatewayAPIManifestError = "No routes configured. One of 'tcpRoutes', 'httpRoutes', 'tcpRoute' or 'httpRoute' should be set"
GatewayAPIManifestError = "No routes configured. At least one of 'httpRoutes', 'grpcRoutes', 'tcpRoutes', 'httpRoute', 'grpcRoute' or 'tcpRoute' must be set"
HTTPRouteFieldIsEmptyError = "httpRoute field is empty. It has to be set to remove managed routes"
InvalidHeaderMatchTypeError = "invalid header match type"
BackendRefWasNotFoundInHTTPRouteError = "backendRef was not found in httpRoute"
Expand Down
8 changes: 4 additions & 4 deletions pkg/plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (r *RpcPlugin) UpdateHash(rollout *v1alpha1.Rollout, canaryHash, stableHash
}

func (r *RpcPlugin) SetWeight(rollout *v1alpha1.Rollout, desiredWeight int32, additionalDestinations []v1alpha1.WeightDestination) pluginTypes.RpcError {
gatewayAPIConfig, err := getGatewayAPITracfficRoutingConfig(rollout)
gatewayAPIConfig, err := getGatewayAPITrafficRoutingConfig(rollout)
if err != nil {
return pluginTypes.RpcError{
ErrorString: err.Error(),
Expand Down Expand Up @@ -86,7 +86,7 @@ func (r *RpcPlugin) SetWeight(rollout *v1alpha1.Rollout, desiredWeight int32, ad
}

func (r *RpcPlugin) SetHeaderRoute(rollout *v1alpha1.Rollout, headerRouting *v1alpha1.SetHeaderRoute) pluginTypes.RpcError {
gatewayAPIConfig, err := getGatewayAPITracfficRoutingConfig(rollout)
gatewayAPIConfig, err := getGatewayAPITrafficRoutingConfig(rollout)
if err != nil {
return pluginTypes.RpcError{
ErrorString: err.Error(),
Expand Down Expand Up @@ -136,7 +136,7 @@ func (r *RpcPlugin) VerifyWeight(rollout *v1alpha1.Rollout, desiredWeight int32,
}

func (r *RpcPlugin) RemoveManagedRoutes(rollout *v1alpha1.Rollout) pluginTypes.RpcError {
gatewayAPIConfig, err := getGatewayAPITracfficRoutingConfig(rollout)
gatewayAPIConfig, err := getGatewayAPITrafficRoutingConfig(rollout)
if err != nil {
return pluginTypes.RpcError{
ErrorString: err.Error(),
Expand Down Expand Up @@ -181,7 +181,7 @@ func (r *RpcPlugin) Type() string {
return Type
}

func getGatewayAPITracfficRoutingConfig(rollout *v1alpha1.Rollout) (*GatewayAPITrafficRouting, error) {
func getGatewayAPITrafficRoutingConfig(rollout *v1alpha1.Rollout) (*GatewayAPITrafficRouting, error) {
validate := validator.New(validator.WithRequiredStructEnabled())
gatewayAPIConfig := &GatewayAPITrafficRouting{
ConfigMap: defaults.ConfigMap,
Expand Down
Loading