Skip to content

Commit

Permalink
fix typo and use index to insert
Browse files Browse the repository at this point in the history
Signed-off-by: Arko Dasgupta <arko@tetrate.io>
  • Loading branch information
arkodg committed Oct 26, 2022
1 parent 67d5397 commit be882d5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/cache/v3/linear.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func (cache *LinearCache) respondDelta(request *DeltaRequest, value chan DeltaRe
// Only send a response if there were changes
if len(resp.Resources) > 0 || len(resp.RemovedResources) > 0 {
if cache.log != nil {
cache.log.Debugf("[linear cache] node: %s, sending delta response for typeURL %s with resources: %v removed resources %v with wildcard: %t",
cache.log.Debugf("[linear cache] node: %s, sending delta response for typeURL %s with resources: %v removed resources: %v with wildcard: %t",
request.GetNode().GetId(), request.TypeUrl, GetResourceNames(resp.Resources), resp.RemovedResources, state.IsWildcard())
}
value <- resp
Expand Down
6 changes: 3 additions & 3 deletions pkg/cache/v3/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ func GetResourceName(res types.Resource) string {

// GetResourceName returns the resource names for a list of valid xDS response types.
func GetResourceNames(resources []types.Resource) []string {
out := make([]string, 0, len(resources))
for _, r := range resources {
out = append(out, GetResourceName(r))
out := make([]string, len(resources))
for i, r := range resources {
out[i] = GetResourceName(r)
}
return out
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/cache/v3/simple.go
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ func (cache *snapshotCache) respondDelta(ctx context.Context, snapshot ResourceS
// otherwise, envoy won't complete initialization
if len(resp.Resources) > 0 || len(resp.RemovedResources) > 0 || (state.IsWildcard() && state.IsFirst()) {
if cache.log != nil {
cache.log.Debugf("node: %s, sending delta response for typeURL %s with resources: %v removed resources %v with wildcard: %t",
cache.log.Debugf("node: %s, sending delta response for typeURL %s with resources: %v removed resources: %v with wildcard: %t",
request.GetNode().GetId(), request.TypeUrl, GetResourceNames(resp.Resources), resp.RemovedResources, state.IsWildcard())
}
select {
Expand Down

0 comments on commit be882d5

Please sign in to comment.