-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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 gateway-services table with endpoints #13217
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's a missing part of a memdb lookup.
…r a service or a destination exist)
rename "endpoint" to "destination"
Co-authored-by: Dan Stough <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple non-blocking things
|
||
} | ||
|
||
func TestStore_ServiceDefaults_Kind_Destination(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should probably do an actual diff, but just looking at TestStore_ServiceDefaults_isDestination
above and this function, I didn't see the difference.
|
||
} | ||
|
||
func TestStore_ServiceDefaults_Kind_Destination_Wildcard(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment here about redundancy with TestStore_ServiceDefaults_isDestination_Wildcard
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right all the isDestination
tests are duplicate. I will remove them
Co-authored-by: Dan Stough <[email protected]>
} | ||
if sd.Destination != nil { | ||
return structs.GatewayServiceKindDestination, nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | |
} | |
return structs.GatewayServiceKindService, nil |
Would this be appropriate? Or are you elsewhere going to interpret "unknown" as "service"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason I added the unknown kind is to differentiate between existing services/destinations and references in the tgtw to non existing, it will help for debugging purpose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM given that more changes are coming on later PRs.
Description
This part of the work needed to add destinations (formerly endpoints) to the terminating gateway. Destinations are defined using a service-default config entry and represent an external entity (a set of addresses and a port) which can be reachable through a given terminating gateway.
In this PR we add the association between a given destination and a terminating gateway. This include the use case of a terminating gateway that define a wildcard in his LinkedServices.
We also add a filed that define the kind of the mapping (Unknown, Service or Destination) so that could be used in the proxycfg part to define the right envoy config.
The Kind is updated based on Service and Destination CRUD and if a Service and a Destination with the same name exists priority is given to the Service.
PR Checklist