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)
| 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 |
| 1674 | func (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 |
| 1684 | func (ctrl *ApplicationController) PatchAppWithWriteBack(ctx context.Context, name, ns string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *appv1.Application, err error) { |
no test coverage detected