mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Storage: Add mode 2 dual writing improvements (#87204)
* Fix mode 2 List test * Set origin timestamp during conversion to k8s resource * Add instructions for updating a playlist * Handle partial deletions of a collection in mode 2
This commit is contained in:
@@ -91,9 +91,11 @@ func convertToK8sResource(v *playlistsvc.PlaylistDTO, namespacer request.Namespa
|
||||
if err == nil {
|
||||
meta.SetUpdatedTimestampMillis(v.UpdatedAt)
|
||||
if v.Id > 0 {
|
||||
createdAt := time.UnixMilli(v.CreatedAt)
|
||||
meta.SetOriginInfo(&utils.ResourceOriginInfo{
|
||||
Name: "SQL",
|
||||
Key: fmt.Sprintf("%d", v.Id),
|
||||
Name: "SQL",
|
||||
Key: fmt.Sprintf("%d", v.Id),
|
||||
Timestamp: &createdAt,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ func TestPlaylistConversion(t *testing.T) {
|
||||
"annotations": {
|
||||
"grafana.app/originKey": "123",
|
||||
"grafana.app/originName": "SQL",
|
||||
"grafana.app/originTimestamp":"1970-01-01T00:00:12Z",
|
||||
"grafana.app/updatedTimestamp": "1970-01-01T00:00:54Z"
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user