Skip to content

Commit f3c4fbf

Browse files
authored
cli: Send named resources in ack/nack (#7047)
Without this change, the initial request has any requested resources but the subsequent requests do not Signed-off-by: Sunjay Bhatia <[email protected]>
1 parent 299fd82 commit f3c4fbf

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix DiscoveryRequests sent by cli command when a specific set of resources is requested. Previously only the first request was sending the requested resource names.

cmd/contour/cli.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ func watchstream(log *logrus.Logger, st stream, typeURL string, resources []stri
211211
// instead of an ACK.
212212
nackReq := &envoy_service_discovery_v3.DiscoveryRequest{
213213
TypeUrl: typeURL,
214+
ResourceNames: resources,
214215
ResponseNonce: resp.Nonce,
215216
VersionInfo: resp.VersionInfo,
216217
ErrorDetail: &status.Status{
@@ -239,6 +240,7 @@ func watchstream(log *logrus.Logger, st stream, typeURL string, resources []stri
239240
// just got, or else the watch won't happen properly.
240241
ackReq := &envoy_service_discovery_v3.DiscoveryRequest{
241242
TypeUrl: typeURL,
243+
ResourceNames: resources,
242244
ResponseNonce: resp.Nonce,
243245
VersionInfo: resp.VersionInfo,
244246
Node: &envoy_config_core_v3.Node{
@@ -349,8 +351,9 @@ func watchDeltaStream(log *logrus.Logger, st deltaStream, typeURL string, resour
349351
// The ErrorDetail field being populated is what makes this a NACK
350352
// instead of an ACK.
351353
nackReq := &envoy_service_discovery_v3.DeltaDiscoveryRequest{
352-
TypeUrl: typeURL,
353-
ResponseNonce: resp.Nonce,
354+
TypeUrl: typeURL,
355+
ResourceNamesSubscribe: resources,
356+
ResponseNonce: resp.Nonce,
354357
ErrorDetail: &status.Status{
355358
Code: int32(grpc_code.Code_INTERNAL),
356359
Message: "Told to create a NACK for testing",
@@ -374,8 +377,9 @@ func watchDeltaStream(log *logrus.Logger, st deltaStream, typeURL string, resour
374377
// We'll ACK our request.
375378
// The ResponseNonce field is what makes it an ACK.
376379
ackReq := &envoy_service_discovery_v3.DeltaDiscoveryRequest{
377-
TypeUrl: typeURL,
378-
ResponseNonce: resp.Nonce,
380+
TypeUrl: typeURL,
381+
ResourceNamesSubscribe: resources,
382+
ResponseNonce: resp.Nonce,
379383
Node: &envoy_config_core_v3.Node{
380384
Id: nodeID,
381385
},

0 commit comments

Comments
 (0)