Skip to content

Commit 449fe0b

Browse files
authored
Merge pull request kubernetes#86397 from gnufied/fix-comparison-of-node-publish-unpublish
Expect NodeUnpublish calls when NodePublish is called
2 parents 6f4ec3e + d1fb0b5 commit 449fe0b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/e2e/storage/csi_mock_volume.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -793,8 +793,12 @@ func checkPodLogs(cs clientset.Interface, namespace, driverPodName, driverContai
793793
if foundAttributes.Len() != 0 {
794794
return fmt.Errorf("some unexpected volume attributes were found: %+v", foundAttributes.List())
795795
}
796-
if numNodePublishVolume != numNodeUnpublishVolume {
797-
return fmt.Errorf("number of NodePublishVolume %d != number of NodeUnpublishVolume %d", numNodePublishVolume, numNodeUnpublishVolume)
796+
if numNodePublishVolume == 0 {
797+
return fmt.Errorf("NodePublish was never called")
798+
}
799+
800+
if numNodeUnpublishVolume == 0 {
801+
return fmt.Errorf("NodeUnpublish was never called")
798802
}
799803
return nil
800804
}

0 commit comments

Comments
 (0)