Skip to content

Commit 7f38830

Browse files
Update unit tests to check mounts
1 parent 8d332b7 commit 7f38830

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/secrets-store/nodeserver_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ func TestNodePublishVolume(t *testing.T) {
332332
},
333333
rotationConfig: &RotationConfig{
334334
enabled: true,
335-
interval: time.Minute,
335+
interval: -1 * time.Minute, // Using negative interval to pass the rotation interval check in unit tests
336336
},
337337
},
338338
{
@@ -407,8 +407,8 @@ func TestNodePublishVolume(t *testing.T) {
407407
t.Fatalf("expected err to be nil, got: %v", err)
408408
}
409409
expectedMounts := 1
410-
if ns.rotationConfig.enabled {
411-
// If rotation time is not enabled, there should not be any mounts.
410+
if ns.rotationConfig.enabled && ns.rotationConfig.interval > 0 {
411+
// If due to rotation interval, NodePublishVolume has skipped, there should not be any mount operation
412412
expectedMounts = 0
413413
}
414414
if len(mnts) != expectedMounts {

0 commit comments

Comments
 (0)