Skip to content

Commit

Permalink
Merge pull request #70 from fasaxc/fix-update-type
Browse files Browse the repository at this point in the history
Fix two issues that resulted in incorrect updateTypes
  • Loading branch information
fasaxc authored Nov 7, 2017
2 parents 5f55c67 + caae1fb commit 742dc8a
Show file tree
Hide file tree
Showing 4 changed files with 176 additions and 125 deletions.
21 changes: 10 additions & 11 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions glide.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@ import:
- package: github.com/mipearson/rfw
- package: github.com/prometheus/client_golang
version: ^0.9.0-pre1
- package: github.com/gavv/monotime
- package: github.com/onsi/ginkgo
version: f40a49d81e5c12e90400620b6242fb29a8e7c9
- package: github.com/Workiva/go-datastructures
version: ^1.0.39
version: af7475fb23e7561c87e7c1d17c12f46d732379bb
subpackages:
- trie/ctrie
- package: golang.org/x/text
Expand Down
7 changes: 6 additions & 1 deletion pkg/snapcache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,12 @@ func (c *Cache) publishBreadcrumb() {
counterUpdatesSkipped.Inc()
continue
}
c.kvs.Insert(keyAsBytes, newUpd)
// Since the purpose of the snapshot is to hold the initial set of updates to send to Felix at start-of-day,
// all the updates that it stores should have type UpdateTypeKVNew since they're all new to Felix. Copy
// the KV and adjust it before storing it in the snapshot.
updToStore := newUpd
updToStore.UpdateType = api.UpdateTypeKVNew
c.kvs.Insert(keyAsBytes, updToStore)
}

// Record the update in the new Breadcrumb so that clients following the chain of
Expand Down
Loading

0 comments on commit 742dc8a

Please sign in to comment.