-
Notifications
You must be signed in to change notification settings - Fork 690
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/xds: convert xDS resources for the envoy xDS server #3087
Conversation
This doesn't work. AFAICT the listeners get populated and send correctly, but perhaps Envoy doesn't like them for some reason. At any rate, the HTTP listener never shows up in the Envoy admin endpoint. |
Codecov Report
@@ Coverage Diff @@
## main #3087 +/- ##
==========================================
- Coverage 73.58% 73.14% -0.45%
==========================================
Files 101 103 +2
Lines 6360 6401 +41
==========================================
+ Hits 4680 4682 +2
- Misses 1577 1617 +40
+ Partials 103 102 -1
|
OK I figured out what is going on. Here's the debug log that gives us the clue:
We report adding 2 listeners to the snapshot, but the snapshot only emits 1. I'm calling |
135d523
to
c7d1553
Compare
// any instance of Envoy to connect to Contour regardless of the | ||
// service-node flag configured on Envoy. | ||
type ConstantHash string | ||
type ConstantHashV2 struct{} |
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.
is it worth moving this into internal/xds/v2
, and the v3 bits into internal/xds/v3
?
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 that I'd rather leave it for now. If I move the 2 implementations I have to either duplicate the "contour" value, or leave the CONSTANT_HASH_VALUE
const behind. I don't mind moving them, but I didn't like either of those options very much.
c7d1553
to
000987e
Compare
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.
couple more nits but otherwise LGTM
case config.ContourServerType: | ||
contour_xds_v3.RegisterServer(contour_xds_v3.NewContourServer(log, xdscache.ResourcesOf(resources)...), grpcServer) | ||
|
||
// Check an internal feature flag to disable xDS v2 endpoints. This is strictly for testing. | ||
if config.GetenvOr("CONTOUR_INTERNAL_DISABLE_XDSV2", "N") != "N" { | ||
if config.GetenvOr("CONTOUR_INTERNAL_DISABLE_XDSV2", "N") == "N" { |
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.
oops, guess we all missed this on the last PR :/
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.
:oof:
@@ -101,3 +103,15 @@ func AnyMessageTypeOf(msg proto.Message) string { | |||
a := MustMarshalAny(msg) | |||
return a.TypeUrl | |||
} | |||
|
|||
/// MustMarshalJSON marshals msg to indented JSON. | |||
func MustMarshalJSON(msg proto.Message) string { |
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 don't see this being used anywhere, can remove if that's the case.
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 ended up having to rewrite it in various ad-hoc debugging, so even though it's not used I'd like to keep it for future debug logging :)
000987e
to
a6ba9f7
Compare
I see lots of log messages for this:
Let me look into what needs to happen to remove that, it's not breaking, just very log spammy. |
That's interesting ... they must be checking the deprecation attributes after the protobuf migration. |
a6ba9f7
to
1d2e79b
Compare
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
Add a snapshotter interface to paper over the go-control-plane API bifurcation. Use this to populate v3 and v2 resources in the snapshot cache. This updates projectcontour#1898. Signed-off-by: James Peach <[email protected]>
37d2286
to
ac979b0
Compare
Add a snapshotter interfact to paper over the go-control-plane API
bifurcation. Use this to populate v3 and v2 resources in the snapshot
cache.
This updates #1898.
Signed-off-by: James Peach [email protected]