MCPcopy
hub / github.com/cilium/cilium / AcquireReference

Method AcquireReference

pkg/allocator/allocator_test.go:84–99  ·  view source on GitHub ↗
(ctx context.Context, id idpool.ID, key AllocatorKey, lock kvstore.KVLocker)

Source from the content-addressed store, hash-verified

82}
83
84func (d *dummyBackend) AcquireReference(ctx context.Context, id idpool.ID, key AllocatorKey, lock kvstore.KVLocker) error {
85 d.mutex.Lock()
86 defer d.mutex.Unlock()
87
88 if _, ok := d.masterKeys[id]; !ok {
89 return fmt.Errorf("identity does not exist")
90 }
91
92 d.slaveKeys[id] = key
93
94 if d.handler != nil {
95 d.handler.OnUpsert(id, key)
96 }
97
98 return nil
99}
100
101type dummyLock struct{}
102

Callers

nothing calls this directly

Calls 4

LockMethod · 0.65
UnlockMethod · 0.65
OnUpsertMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected