Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

cli/verifier: derive appProtocol from service #4691

Merged
merged 1 commit into from
Apr 25, 2022

Conversation

shashankram
Copy link
Member

Description:
Uses the same mechanism as the controller to derive
the app protocol for a service port. This is required
for a service with multiple ports, both serving
different protocols.

The AppProtocol in the TrafficAttribute struct
will be used for ingress/egress instead.

Part of #4634

Testing done:

$ osm verify connectivity --from-pod curl/curl-7bb5845476-5b7wr --to-pod httpbin/httpbin-69dc7d545c-hbc6d --service httpbin 
---------------------------------------------
[+] Context: Verify if pod "curl/curl-7bb5845476-5b7wr" can access pod "httpbin/httpbin-69dc7d545c-hbc6d" for service "httpbin/httpbin"
Status: Success

---------------------------------------------

Affected area:

Functional Area
CLI Tool [X]

Please answer the following questions with yes/no.

  1. Does this change contain code from or inspired by another project? no

    • Did you notify the maintainers and provide attribution?
  2. Is this a breaking change? no

  3. Has documentation corresponding to this change been updated in the osm-docs repo (if applicable)? n/a

Uses the same mechanism as the controller to derive
the app protocol for a service port. This is required
for a service with multiple ports, both serving
different protocols.

The `AppProtocol` in the `TrafficAttribute` struct
will be used for ingress/egress instead.

Part of openservicemesh#4634

Signed-off-by: Shashank Ram <[email protected]>
routeConfig := &xds_route.RouteConfiguration{}
//nolint: errcheck
//#nosec G104: Errors unhandled
r.GetRouteConfig().UnmarshalTo(routeConfig)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not check the error here and return an unknown result?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find a scenario where the unmarshaling fails. Wanted to avoid unnecessary checks around this if we can't test it.

@shashankram shashankram merged commit 77b4dd8 into openservicemesh:main Apr 25, 2022
@shashankram shashankram deleted the tools-v3 branch April 25, 2022 21:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants