Skip to content

Commit 251e56c

Browse files
committed
Fix: PVC used by a job doesn't get resize after the pod of the job completed
Once the job pod is terminated, remove the corresponding PVC from the usedPVCs. issue-175 Signed-off-by: Phan Le <[email protected]>
1 parent 7c0d0a2 commit 251e56c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/controller/controller.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,11 @@ func (ctrl *resizeController) updatePod(oldObj, newObj interface{}) {
161161
return
162162
}
163163

164-
ctrl.usedPVCs.addPod(pod)
164+
if isPodTerminated(pod) {
165+
ctrl.usedPVCs.removePod(pod)
166+
} else {
167+
ctrl.usedPVCs.addPod(pod)
168+
}
165169
}
166170

167171
func (ctrl *resizeController) updatePVC(oldObj, newObj interface{}) {

0 commit comments

Comments
 (0)