@@ -299,10 +299,6 @@ func (ctrl *csiSnapshotController) storeContentUpdate(content interface{}) (bool
299
299
return storeObjectUpdate (ctrl .contentStore , content , "content" )
300
300
}
301
301
302
- func (ctrl * csiSnapshotController ) storeClassUpdate (content interface {}) (bool , error ) {
303
- return storeObjectUpdate (ctrl .classStore , content , "class" )
304
- }
305
-
306
302
// createSnapshot starts new asynchronous operation to create snapshot
307
303
func (ctrl * csiSnapshotController ) createSnapshot (snapshot * crdv1.VolumeSnapshot ) error {
308
304
glog .V (5 ).Infof ("createSnapshot[%s]: started" , snapshotKey (snapshot ))
@@ -744,22 +740,12 @@ func (ctrl *csiSnapshotController) getStorageClassFromVolumeSnapshot(snapshot *c
744
740
func (ctrl * csiSnapshotController ) GetSnapshotClass (className string ) (* crdv1.VolumeSnapshotClass , error ) {
745
741
glog .V (5 ).Infof ("getSnapshotClass: VolumeSnapshotClassName [%s]" , className )
746
742
747
- obj , found , err := ctrl .classStore .GetByKey (className )
748
- if found {
749
- class , ok := obj .(* crdv1.VolumeSnapshotClass )
750
- if ok {
751
- return class , nil
752
- }
753
- }
754
743
class , err := ctrl .classLister .Get (className )
755
744
if err != nil {
756
745
glog .Errorf ("failed to retrieve snapshot class %s from the API server: %q" , className , err )
757
746
return nil , fmt .Errorf ("failed to retrieve snapshot class %s from the API server: %q" , className , err )
758
747
}
759
- _ , updateErr := ctrl .storeClassUpdate (class )
760
- if updateErr != nil {
761
- glog .V (4 ).Infof ("getSnapshotClass [%s]: cannot update internal cache: %v" , class .Name , updateErr )
762
- }
748
+
763
749
return class , nil
764
750
}
765
751
@@ -804,10 +790,7 @@ func (ctrl *csiSnapshotController) SetDefaultSnapshotClass(snapshot *crdv1.Volum
804
790
// We will get an "snapshot update" event soon, this is not a big error
805
791
glog .V (4 ).Infof ("setDefaultSnapshotClass [%s]: cannot update internal cache: %v" , snapshotKey (snapshot ), updateErr )
806
792
}
807
- _ , updateErr = ctrl .storeClassUpdate (defaultClasses [0 ])
808
- if updateErr != nil {
809
- glog .V (4 ).Infof ("setDefaultSnapshotClass [%s]: cannot update internal cache: %v" , defaultClasses [0 ].Name , updateErr )
810
- }
793
+
811
794
return defaultClasses [0 ], newSnapshot , nil
812
795
}
813
796
0 commit comments