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

Function composeWatcherFilters

runner/pool/util.go:74–96  ·  view source on GitHub ↗
(entity params.ForgeEntity)

Source from the content-addressed store, hash-verified

72}
73
74func composeWatcherFilters(entity params.ForgeEntity) dbCommon.PayloadFilterFunc {
75 // We want to watch for changes in either the controller or the
76 // entity itself.
77 return watcher.WithAny(
78 watcher.WithAll(
79 // Updates to the controller
80 watcher.WithEntityTypeFilter(dbCommon.ControllerEntityType),
81 watcher.WithOperationTypeFilter(dbCommon.UpdateOperation),
82 ),
83 // Any operation on the entity we're managing the pool for.
84 watcher.WithEntityFilter(entity),
85 // Watch for changes to the github credentials
86 watcher.WithForgeCredentialsFilter(entity.Credentials),
87 watcher.WithAll(
88 watcher.WithEntityJobFilter(entity),
89 watcher.WithAny(
90 watcher.WithOperationTypeFilter(dbCommon.UpdateOperation),
91 watcher.WithOperationTypeFilter(dbCommon.CreateOperation),
92 watcher.WithOperationTypeFilter(dbCommon.DeleteOperation),
93 ),
94 ),
95 )
96}
97
98func (r *basePoolManager) getQueuedJobs() []params.Job {
99 r.mux.Lock()

Callers 2

NewEntityPoolManagerFunction · 0.85
handleEntityUpdateMethod · 0.85

Calls 7

WithAnyFunction · 0.92
WithAllFunction · 0.92
WithEntityTypeFilterFunction · 0.92
WithOperationTypeFilterFunction · 0.92
WithEntityFilterFunction · 0.92
WithEntityJobFilterFunction · 0.92

Tested by

no test coverage detected