MCPcopy
hub / github.com/baetyl/baetyl / getDeleteAndUpdate

Function getDeleteAndUpdate

engine/engine.go:351–369  ·  view source on GitHub ↗
(desires, reports []specv1.AppInfo)

Source from the content-addressed store, hash-verified

349}
350
351func getDeleteAndUpdate(desires, reports []specv1.AppInfo) (map[string]specv1.AppInfo, map[string]specv1.AppInfo) {
352 del := make(map[string]specv1.AppInfo)
353 update := make(map[string]specv1.AppInfo)
354 for _, d := range desires {
355 update[d.Name] = d
356 }
357 for _, r := range reports {
358 del[r.Name] = r
359 if app, ok := update[r.Name]; ok && app.Version == r.Version {
360 delete(update, app.Name)
361 }
362 }
363 for _, app := range desires {
364 if _, ok := del[app.Name]; ok {
365 delete(del, app.Name)
366 }
367 }
368 return del, update
369}
370
371func (e *engineImpl) applyApps(ns string, infos map[string]specv1.AppInfo, stats map[string]specv1.AppStats) {
372 var wg gosync.WaitGroup

Callers 1

reportAndApplyMethod · 0.85

Calls 1

deleteFunction · 0.85

Tested by

no test coverage detected