MCPcopy
hub / github.com/argoproj/argo-cd / writeBackToInformer

Method writeBackToInformer

controller/appcontroller.go:1674–1681  ·  view source on GitHub ↗

writeBackToInformer writes a just recently updated App back into the informer cache. This prevents the situation where the controller operates on a stale app and repeats work

(app *appv1.Application)

Source from the content-addressed store, hash-verified

1672// writeBackToInformer writes a just recently updated App back into the informer cache.
1673// This prevents the situation where the controller operates on a stale app and repeats work
1674func (ctrl *ApplicationController) writeBackToInformer(app *appv1.Application) {
1675 logCtx := log.WithFields(applog.GetAppLogFields(app)).WithField("informer-writeBack", true)
1676 err := ctrl.appInformer.GetStore().Update(app)
1677 if err != nil {
1678 logCtx.WithError(err).Error("failed to update informer store")
1679 return
1680 }
1681}
1682
1683// PatchAppWithWriteBack patches an application and writes it back to the informer cache
1684func (ctrl *ApplicationController) PatchAppWithWriteBack(ctx context.Context, name, ns string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *appv1.Application, err error) {

Callers 2

PatchAppWithWriteBackMethod · 0.95
autoSyncMethod · 0.95

Calls 3

GetStoreMethod · 0.80
UpdateMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected