Expect NodeUnpublish calls when NodePublish is called

While this is looser check than original check, I do not think
we can quite expect NodePublish and NodeUnpublish call counts to match

NodePublishvolume call count may not be same as NodeUnpublishVolume
call count because reconciler may have a mount operation queued up
while previous one is finishing. So, it is not unusual to have more than one
NodePublishVolume call for same pod+volume combination, similarly
unmount may also run more than once.
This commit is contained in:
Hemant Kumar 2019-12-18 17:57:23 -05:00
parent 5cb1ec5fea
commit d1fb0b57df

View File

@ -793,8 +793,12 @@ func checkPodLogs(cs clientset.Interface, namespace, driverPodName, driverContai
if foundAttributes.Len() != 0 {
return fmt.Errorf("some unexpected volume attributes were found: %+v", foundAttributes.List())
}
if numNodePublishVolume != numNodeUnpublishVolume {
return fmt.Errorf("number of NodePublishVolume %d != number of NodeUnpublishVolume %d", numNodePublishVolume, numNodeUnpublishVolume)
if numNodePublishVolume == 0 {
return fmt.Errorf("NodePublish was never called")
}
if numNodeUnpublishVolume == 0 {
return fmt.Errorf("NodeUnpublish was never called")
}
return nil
}