MCPcopy Create free account
hub / github.com/cloudbase/garm / SetEntityPool

Method SetEntityPool

cache/entity_cache.go:241–255  ·  view source on GitHub ↗
(entityID string, pool params.Pool)

Source from the content-addressed store, hash-verified

239}
240
241func (e *EntityCache) SetEntityPool(entityID string, pool params.Pool) {
242 e.mux.Lock()
243 defer e.mux.Unlock()
244
245 poolEntity, err := pool.GetEntity()
246 if err != nil || poolEntity.ID != entityID {
247 return
248 }
249
250 if cache, ok := e.entities[entityID]; ok {
251 e.pools[pool.ID] = pool
252 cache.Pools[pool.ID] = struct{}{}
253 e.entities[entityID] = cache
254 }
255}
256
257func (e *EntityCache) SetEntityScaleSet(entityID string, scaleSet params.ScaleSet) {
258 e.mux.Lock()

Callers 1

SetEntityPoolFunction · 0.80

Calls 3

LockMethod · 0.65
UnlockMethod · 0.65
GetEntityMethod · 0.65

Tested by

no test coverage detected