ShortURL: Fix wrong creation timestamp conversion (#113646)
This commit is contained in:
@@ -25,14 +25,14 @@ func convertToK8sResource(v *shorturls.ShortUrl, namespacer request.NamespaceMap
|
||||
// resourceVersion can't be 0, since we are using the lastSeenAt value, when it's zero we default to current time
|
||||
resourceVersion := fmt.Sprintf("%d", v.LastSeenAt)
|
||||
if v.LastSeenAt == 0 {
|
||||
resourceVersion = fmt.Sprintf("%d", time.Now().UnixMilli())
|
||||
resourceVersion = fmt.Sprintf("%d", time.Now().Unix())
|
||||
}
|
||||
|
||||
p := &shorturl.ShortURL{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: v.Uid,
|
||||
ResourceVersion: resourceVersion,
|
||||
CreationTimestamp: metav1.NewTime(time.UnixMilli(v.CreatedAt)),
|
||||
CreationTimestamp: metav1.NewTime(time.Unix(v.CreatedAt, 0)),
|
||||
Namespace: namespacer(v.OrgId),
|
||||
},
|
||||
Spec: spec,
|
||||
|
||||
Reference in New Issue
Block a user