Make metav1.(Micro)?Time functions take pointers

This commit is contained in:
gmarek
2017-08-04 17:04:14 +02:00
parent 402e48b072
commit 0504cfbc25
23 changed files with 64 additions and 59 deletions

View File

@@ -214,7 +214,7 @@ func TestChangedStatusKeepsStartTime(t *testing.T) {
t.Errorf("StartTime should not be zero")
}
expected := now.Rfc3339Copy()
if !finalStatus.StartTime.Equal(expected) {
if !finalStatus.StartTime.Equal(&expected) {
t.Errorf("Expected %v, but got %v", expected, finalStatus.StartTime)
}
}
@@ -244,7 +244,7 @@ func TestChangedStatusUpdatesLastTransitionTime(t *testing.T) {
if newReadyCondition.LastTransitionTime.IsZero() {
t.Errorf("Unexpected: last transition time not set")
}
if newReadyCondition.LastTransitionTime.Before(oldReadyCondition.LastTransitionTime) {
if newReadyCondition.LastTransitionTime.Before(&oldReadyCondition.LastTransitionTime) {
t.Errorf("Unexpected: new transition time %s, is before old transition time %s", newReadyCondition.LastTransitionTime, oldReadyCondition.LastTransitionTime)
}
}
@@ -283,7 +283,7 @@ func TestUnchangedStatusPreservesLastTransitionTime(t *testing.T) {
if newReadyCondition.LastTransitionTime.IsZero() {
t.Errorf("Unexpected: last transition time not set")
}
if !oldReadyCondition.LastTransitionTime.Equal(newReadyCondition.LastTransitionTime) {
if !oldReadyCondition.LastTransitionTime.Equal(&newReadyCondition.LastTransitionTime) {
t.Errorf("Unexpected: new transition time %s, is not equal to old transition time %s", newReadyCondition.LastTransitionTime, oldReadyCondition.LastTransitionTime)
}
}