Merge pull request #84781 from Gerry-Lee/UseTimeUtilInsteadOfTimeSub
Use time.Until instead of t.Sub(time.Now())
This commit is contained in:
		| @@ -287,7 +287,7 @@ func formatBootstrapToken(obj *outputapiv1alpha1.BootstrapToken) string { | ||||
| 	ttl := "<forever>" | ||||
| 	expires := "<never>" | ||||
| 	if obj.Expires != nil { | ||||
| 		ttl = duration.ShortHumanDuration(obj.Expires.Sub(time.Now())) | ||||
| 		ttl = duration.ShortHumanDuration(time.Until(obj.Expires.Time)) | ||||
| 		expires = obj.Expires.Format(time.RFC3339) | ||||
| 	} | ||||
| 	ttl = fmt.Sprintf("%-9s", ttl) | ||||
|   | ||||
| @@ -48,5 +48,5 @@ func newExpirationInfo(name string, cert *x509.Certificate, externallyManaged bo | ||||
|  | ||||
| // ResidualTime returns the time missing to expiration | ||||
| func (e *ExpirationInfo) ResidualTime() time.Duration { | ||||
| 	return e.ExpirationDate.Sub(time.Now()) | ||||
| 	return time.Until(e.ExpirationDate) | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Kubernetes Prow Robot
					Kubernetes Prow Robot