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

Method GetEntityScaleSets

cache/entity_cache.go:361–377  ·  view source on GitHub ↗
(entityID string)

Source from the content-addressed store, hash-verified

359}
360
361func (e *EntityCache) GetEntityScaleSets(entityID string) []params.ScaleSet {
362 e.mux.Lock()
363 defer e.mux.Unlock()
364
365 if cache, ok := e.entities[entityID]; ok {
366 var scaleSets []params.ScaleSet
367 for scaleSetID := range cache.ScaleSets {
368 if scaleSet, ok := e.scalesets[scaleSetID]; ok {
369 scaleSets = append(scaleSets, scaleSet)
370 }
371 }
372 // Sort the scale sets by creation date.
373 sortByID(scaleSets)
374 return scaleSets
375 }
376 return nil
377}
378
379func (e *EntityCache) GetEntitiesUsingEndpoint(endpoint params.ForgeEndpoint) []params.ForgeEntity {
380 e.mux.Lock()

Callers 1

GetEntityScaleSetsFunction · 0.80

Calls 3

sortByIDFunction · 0.85
LockMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected