Skip to content

Commit 5cd846e

Browse files
committed
Fix doNotGrantBefore test timestamp precision
1 parent 820d947 commit 5cd846e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

internal/controller/nodedisruption_controller_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,8 @@ var _ = Describe("NodeDisruption controller", func() {
573573
})
574574

575575
It("keeps the node disruption pending until doNotGrantBefore", func() {
576-
doNotGrantBefore := metav1.NewTime(time.Now().Add(time.Hour))
576+
// Kubernetes drops sub-second precision when persisting metav1.Time values.
577+
doNotGrantBefore := metav1.NewTime(time.Now().Add(time.Hour).Truncate(time.Second))
577578

578579
By("creating a new NodeDisruption with doNotGrantBefore in the future")
579580
disruption := &nodedisruptionv1alpha1.NodeDisruption{

0 commit comments

Comments
 (0)