Skip to content

Commit

Permalink
Correct explanatory comment about time (#296)
Browse files Browse the repository at this point in the history
  • Loading branch information
pleshakov authored Nov 8, 2022
1 parent 2663eb4 commit 4877f7e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/status/updater_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ var _ = Describe("Updater", func() {
WithScheme(scheme).
Build()

// Rfc3339Copy() removes the monotonic clock reading
// We need to remove it, because updating the status in the FakeClient and then getting the resource back
// involves encoding and decoding the resource to/from JSON, which removes the monotonic clock reading.
// Rfc3339Copy() removes the monotonic clock reading and leaves only second-level precision.
// We use it because updating the status in the FakeClient and then getting the resource back
// involves encoding and decoding the resource to/from JSON, which uses RFC 3339 for metav1.Time.
fakeClockTime = metav1.NewTime(time.Now()).Rfc3339Copy()
fakeClock := &statusfakes.FakeClock{}
fakeClock.NowReturns(fakeClockTime)
Expand Down

0 comments on commit 4877f7e

Please sign in to comment.