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

Fix incorrect protocol check on discovery chains with peer targets. #15833

Merged
merged 1 commit into from
Dec 20, 2022

Conversation

hashi-derek
Copy link
Member

@hashi-derek hashi-derek commented Dec 19, 2022

The following message is incorrectly printed out whenever saving a service-resolver with a peer failover target.

discovery chain "my-chain" uses inconsistent protocols; service "my-service" has "tcp" which is not "http"

This PR excludes peer targets from the protocol validation logic when building discovery chains, which should prevent the error from occurring.

Steps to reproduce:

  1. Set up a service-defaults with “http” protocol on a service “mylocal”
  2. Set up a peering connection and import a remote service “myremote” (this remote's protocol shouldn't matter to reproduce the issue)
  3. Attempt to save a resolver for “mylocal” that has a failover to “myremote” configured.

Be careful to ensure that no "myremote" service-default exists in the local cluster, as it will actually be looked up, and the error will not surface.

// TODO: Add in remote peer protocol validation when building a chain.
// This likely would require querying the imported services, which
// shouldn't belong in the discovery chain compilation here.
if target.Peer == "" {
Copy link
Member

Choose a reason for hiding this comment

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

Ah so this boils down to "there is not a service-defaults for imported services to store the protocol" if I'm understanding.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup. I was still writing the description up for the ticket, haha. I guess the system automatically assigned you to this PR.

@hashi-derek hashi-derek force-pushed the derekm/NET-1891/protocol-mismatch branch from d73cb02 to 5984ad3 Compare December 19, 2022 16:47
@hashi-derek hashi-derek force-pushed the derekm/NET-1891/protocol-mismatch branch from 5984ad3 to 36891f3 Compare December 19, 2022 16:49
@hashi-derek hashi-derek marked this pull request as ready for review December 19, 2022 17:16
@hashi-derek hashi-derek added the backport-inactive/1.14 This release series is no longer active label Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-inactive/1.14 This release series is no longer active
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants