Skip to content

Commit 9cd16b4

Browse files
authored
Merge pull request #410 from prasadkatti/skip_remote_pvs
fix: do not try to get node for non-local PVs
2 parents d1def35 + 7e1afae commit 9cd16b4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/node-cleanup/controller/controller.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,10 @@ func (c *CleanupController) startCleanupTimersIfNeeded() {
260260
}
261261

262262
for _, pv := range pvs {
263+
if !common.IsLocalPVWithStorageClass(pv, c.storageClassNames) {
264+
continue
265+
}
266+
263267
nodeName, ok := common.NodeAttachedToLocalPV(pv)
264268
if !ok {
265269
klog.Errorf("error getting node attached to pv: %s", pv)
@@ -285,7 +289,7 @@ func (c *CleanupController) startCleanupTimersIfNeeded() {
285289
// The PV must be a local PV, have a StorageClass present in the list of storageClassNames, have a NodeAffinity
286290
// to a deleted Node, and have a PVC bound to it (otherwise there's nothing to clean up).
287291
func (c *CleanupController) shouldEnqueueEntry(pv *v1.PersistentVolume, nodeName string) (bool, error) {
288-
if !common.IsLocalPVWithStorageClass(pv, c.storageClassNames) || pv.Spec.ClaimRef == nil {
292+
if pv.Spec.ClaimRef == nil {
289293
return false, nil
290294
}
291295

0 commit comments

Comments
 (0)