MCPcopy Create free account
hub / github.com/FairwindsOps/gemini / syncHandler

Method syncHandler

pkg/controller/controller.go:156–172  ·  view source on GitHub ↗
(w workItem)

Source from the content-addressed store, hash-verified

154}
155
156func (c *Controller) syncHandler(w workItem) error {
157 var err error
158 if w.task == backupTask {
159 err = snapshots.ReconcileBackupsForSnapshotGroup(w.snapshotGroup)
160 } else if w.task == restoreTask {
161 err = snapshots.RestoreSnapshotGroup(w.snapshotGroup, c.snapshotReadyTimeoutSeconds)
162 } else if w.task == deleteTask {
163 err = snapshots.OnSnapshotGroupDelete(w.snapshotGroup)
164 }
165
166 if err != nil {
167 klog.Errorf("%s/%s: failed to perform %s - %v", w.namespace, w.name, taskLabels[w.task], err)
168 return err
169 }
170
171 return nil
172}
173
174// Run starts the controller
175func (c *Controller) Run(threadiness int, stopCh <-chan struct{}) error {

Callers 5

processNextWorkItemMethod · 0.95
TestBackupHandlerFunction · 0.80
TestRestoreHandlerFunction · 0.80
TestDeleteHandlerFunction · 0.80
TestPreexistingPVCFunction · 0.80

Calls 3

RestoreSnapshotGroupFunction · 0.92
OnSnapshotGroupDeleteFunction · 0.92

Tested by 4

TestBackupHandlerFunction · 0.64
TestRestoreHandlerFunction · 0.64
TestDeleteHandlerFunction · 0.64
TestPreexistingPVCFunction · 0.64