mirror of
https://github.com/kubernetes/client-go.git
synced 2025-06-27 15:39:39 +00:00
Clarified comment on DeltaFIFO::Replace
Kubernetes-commit: ae53a008cb372f7301e302ee982269630e964b12
This commit is contained in:
parent
c68732b808
commit
a1b3b98c4b
19
tools/cache/delta_fifo.go
vendored
19
tools/cache/delta_fifo.go
vendored
@ -442,15 +442,16 @@ func (f *DeltaFIFO) Pop(process PopProcessFunc) (interface{}, error) {
|
||||
}
|
||||
}
|
||||
|
||||
// Replace atomically adds the given objects using the Sync type of
|
||||
// Delta and does some deletions. In particular: for every
|
||||
// pre-existing key K that is not the key of an object in `list` there
|
||||
// is the effect of `Delete(DeletedFinalStateUnknown{K, O})` where O
|
||||
// is current object of K. If `f.knownObjects == nil` then the
|
||||
// pre-existing keys are those in `f.items` and the current object of
|
||||
// K is the `.Newest()` of the Deltas associated with K. Otherwise
|
||||
// the pre-existing keys are those listed by `f.knownObjects` and the
|
||||
// current object of K is what `f.knownObjects.GetByKey(K)` returns.
|
||||
// Replace atomically does two things: (1) it adds the given objects
|
||||
// using the Sync type of Delta and then (2) it does some deletions.
|
||||
// In particular: for every pre-existing key K that is not the key of
|
||||
// an object in `list` there is the effect of
|
||||
// `Delete(DeletedFinalStateUnknown{K, O})` where O is current object
|
||||
// of K. If `f.knownObjects == nil` then the pre-existing keys are
|
||||
// those in `f.items` and the current object of K is the `.Newest()`
|
||||
// of the Deltas associated with K. Otherwise the pre-existing keys
|
||||
// are those listed by `f.knownObjects` and the current object of K is
|
||||
// what `f.knownObjects.GetByKey(K)` returns.
|
||||
func (f *DeltaFIFO) Replace(list []interface{}, resourceVersion string) error {
|
||||
f.lock.Lock()
|
||||
defer f.lock.Unlock()
|
||||
|
Loading…
Reference in New Issue
Block a user