@@ -124,11 +124,6 @@ type ContentUpdateObserver interface {
124124 // Canceled is called when the update has been canceled, or if changes
125125 // were written and the update has been reverted.
126126 Canceled () error
127- // UpdateApplied is called after a successful update has been written to
128- // disk and before the update is considered complete.
129- UpdateApplied () error
130- // Done is called when the observer is no longer needed.
131- Done ()
132127}
133128
134129// searchVolumeWithTraitsAndMatchParts searches for a disk matching the given
@@ -1790,9 +1785,6 @@ func updateLocationForStructure(structureLocations map[string]map[int]StructureL
17901785
17911786func applyUpdates (structureLocations map [string ]map [int ]StructureLocation , new GadgetData , updates []updatePair , rollbackDir string , observer ContentUpdateObserver ) error {
17921787 updaters := make ([]Updater , len (updates ))
1793- if observer != nil {
1794- defer observer .Done ()
1795- }
17961788
17971789 for i , one := range updates {
17981790 loc , err := updateLocationForStructure (structureLocations , one .to )
@@ -1850,15 +1842,8 @@ func applyUpdates(structureLocations map[string]map[int]StructureLocation, new G
18501842 }
18511843
18521844 if updateErr == nil {
1853- if observer == nil {
1854- // all good, updates applied successfully
1855- return nil
1856- }
1857- if err := observer .UpdateApplied (); err == nil {
1858- return nil
1859- } else {
1860- updateErr = fmt .Errorf ("cannot observe applied update: %v" , err )
1861- }
1845+ // all good, updates applied successfully
1846+ return nil
18621847 }
18631848
18641849 logger .Noticef ("cannot update gadget: %v" , updateErr )
0 commit comments