Skip to content

Commit d50f0ae

Browse files
committed
remove deadcode
1 parent 3ea4ee4 commit d50f0ae

File tree

3 files changed

+4
-28
lines changed

3 files changed

+4
-28
lines changed

pkg/modifycontroller/controller.go

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -179,25 +179,6 @@ func (ctrl *modifyController) deletePVC(obj interface{}) {
179179
ctrl.claimQueue.Forget(objKey)
180180
}
181181

182-
// modifyPVC modifies the PVC and PV based on VAC
183-
func (ctrl *modifyController) modifyPVC(pvc *v1.PersistentVolumeClaim, pv *v1.PersistentVolume) error {
184-
var err error
185-
if isFirstTimeModifyVolumeWithPVC(pvc, pv) {
186-
// If it is first time adding a vac, always validate and then call modify volume
187-
_, _, err, _ = ctrl.validateVACAndModifyVolumeWithTarget(pvc, pv)
188-
} else {
189-
_, _, err, _ = ctrl.modify(pvc, pv)
190-
}
191-
return err
192-
}
193-
194-
func isFirstTimeModifyVolumeWithPVC(pvc *v1.PersistentVolumeClaim, pv *v1.PersistentVolume) bool {
195-
if pv.Spec.VolumeAttributesClassName == nil && pvc.Spec.VolumeAttributesClassName != nil {
196-
return true
197-
}
198-
return false
199-
}
200-
201182
func (ctrl *modifyController) init(ctx context.Context) bool {
202183
informersSyncd := []cache.InformerSynced{ctrl.pvListerSynced, ctrl.pvcListerSynced}
203184
informersSyncd = append(informersSyncd, ctrl.vacListerSynced)

pkg/modifycontroller/controller_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,10 @@ func TestController(t *testing.T) {
111111
}
112112
}
113113
time.Sleep(time.Second * 2)
114-
err = ctrlInstance.modifyPVC(test.pvc, test.pv)
114+
_, _, err, _ = ctrlInstance.modify(test.pvc, test.pv)
115+
if err != nil {
116+
t.Fatalf("for %s: unexpected error: %v", test.name, err)
117+
}
115118

116119
modifyCallCount := client.GetModifyCount()
117120
if test.callCSIModify && modifyCallCount == 0 {

pkg/resizer/csi_resizer.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -281,11 +281,3 @@ func getCredentials(k8sClient kubernetes.Interface, ref *v1.SecretReference) (ma
281281
}
282282
return credentials, nil
283283
}
284-
285-
func uniqueAccessModes(pvSpec v1.PersistentVolumeSpec) map[v1.PersistentVolumeAccessMode]bool {
286-
m := map[v1.PersistentVolumeAccessMode]bool{}
287-
for _, mode := range pvSpec.AccessModes {
288-
m[mode] = true
289-
}
290-
return m
291-
}

0 commit comments

Comments
 (0)