This commit is contained in:
Ryan McKinley
2025-12-09 15:20:31 +03:00
parent ad0adf79bd
commit 61ec394f59
3 changed files with 6 additions and 4 deletions
+5 -2
View File
@@ -61,7 +61,7 @@ func (r *converter) asDataSource(ds *datasources.DataSource) (*datasourceV0.Data
obj.Spec.SetJSONData(ds.JsonData.Interface())
}
rv := time.Now().UnixMilli()
rv := int64(0)
if !ds.Created.IsZero() {
obj.CreationTimestamp = metav1.NewTime(ds.Created)
rv = ds.Created.UnixMilli()
@@ -78,6 +78,10 @@ func (r *converter) asDataSource(ds *datasources.DataSource) (*datasourceV0.Data
}
}
if rv > 0 {
obj.ResourceVersion = strconv.FormatInt(rv, 10)
}
if ds.APIVersion != "" {
obj.APIVersion = fmt.Sprintf("%s/%s", r.group, ds.APIVersion)
}
@@ -87,7 +91,6 @@ func (r *converter) asDataSource(ds *datasources.DataSource) (*datasourceV0.Data
utils.LabelKeyDeprecatedInternalID: strconv.FormatInt(ds.ID, 10),
}
}
obj.ResourceVersion = strconv.FormatInt(rv, 10)
return obj, nil
}
@@ -3,6 +3,7 @@
"name": "unique-identifier",
"namespace": "org-0",
"uid": "YpaSG5GQAdxtLZtF6BqQWCeYXOhbVi5C4Cg4oILnJC0X",
"resourceVersion": "1015203600000",
"generation": 8,
"creationTimestamp": "2002-03-04T01:00:00Z",
"labels": {
@@ -10,7 +11,6 @@
}
},
"spec": {
"jsonData": null,
"title": "Display name"
}
}
@@ -5,7 +5,6 @@
"uid": "boDNh7zU3nXj46rOXIJI7r44qaxjs8yy9I9dOj1MyBoX"
},
"spec": {
"jsonData": null,
"title": "Hello testdata"
}
}