Skip to content

Commit

Permalink
Update docs to specify that gRPC support is not released, fix typo in…
Browse files Browse the repository at this point in the history
… function name and update error string to include gRPC (#73)

* chore: update GatewayAPIManifestError description to include grpcRoute(s)

Signed-off-by: Fredrik August Madsen-Malmo <[email protected]>

* chore: typo in getGatewayAPITracfficRoutingConfig. renamed to [..]Traffic[...]

Signed-off-by: Fredrik August Madsen-Malmo <[email protected]>

* docs: clarify that gRPC support is not included in the released builds, but can be built locally

Signed-off-by: Fredrik August Madsen-Malmo <[email protected]>

---------

Signed-off-by: Fredrik August Madsen-Malmo <[email protected]>
  • Loading branch information
FredrikAugust authored Aug 30, 2024
1 parent f2c3033 commit baa2a7b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
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

0 comments on commit baa2a7b

Please sign in to comment.