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

internal/cmd/egctl/translate_test.go failed after adding ClusterLoadAssignment.ValidateAll() #1742

Closed
Ronnie-personal opened this issue Aug 2, 2023 · 1 comment
Labels
kind/bug Something isn't working

Comments

@Ronnie-personal
Copy link
Contributor

Ronnie-personal commented Aug 2, 2023

Description:
You may find more context at #1662 (comment)

Here are the detailed error messages:
AIL: TestTranslate/authn-single-route-single-match-to-xds| (293.93s) translate_test.go:321: Error Trace: /home/nino/ronniegateway/internal/cmd/egctl/translate_test.go:321 Error: Received unexpected error: failed to translate xds ir for key envoy-gateway-system/eg value &{AccessLog:0xc0000e1ea0 Tracing:<nil> HTTP:[0xc00051e800] TCP:[] UDP:[] EnvoyPatchPolicies:[]}, error:validation failed for xds resource cluster_name:"envoy-gateway-system/backend/rule/0/match/0-www.example.com" endpoints:{locality:{} lb_endpoints:{endpoint:{address:{socket_address:{port_value:3000}}} load_balancing_weight:{value:1}} load_balancing_weight:{value:1}}, err:invalid ClusterLoadAssignment.Endpoints[0]: embedded message failed validation | caused by: invalid LocalityLbEndpoints.LbEndpoints[0]: embedded message failed validation | caused by: invalid LbEndpoint.Endpoint: embedded message failed validation | caused by: invalid Endpoint.Address: embedded message failed validation | caused by: invalid Address.SocketAddress: embedded message failed validation | caused by: invalid SocketAddress.Address: value length must be at least 1 runes

What issue is being seen? Describe what should be happening instead of
the bug, for example: Envoy should not crash, the expected value isn't
returned, etc.

Repro steps:
Add following code to 'internal/xds/types/resourceversiontable.go', then run 'internal/cmd/egctl/translate_test.go'.
case resourcev3.EndpointType: // TBD - ValidateAll() breaks existing test internal/cmd/egctl/translate_test // authn-single-route-single-match-to-xds.endpoint expects address for socketAddress field, but this field currently only has port, does not have address if resourceOfType, ok := xdsResource.(*endpointv3.ClusterLoadAssignment); ok { if err := resourceOfType.ValidateAll(); err != nil { return fmt.Errorf("validation failed for xds resource %+v, err:%v", xdsResource, err) } } else { return fmt.Errorf("failed to cast xds resource %+v to ClusterLoadAssignment type", xdsResource) }

Include sample requests, environment, etc. All data and inputs
required to reproduce the bug.

Note: If there are privacy concerns, sanitize the data prior to
sharing.

Environment:

Include the environment like gateway version, envoy version and so on.

Logs:

Include the access logs and the Envoy logs.

@Ronnie-personal
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant