K8s: Dashboards: Set message as annotation (#99230)

This commit is contained in:
Stephanie Hingtgen
2025-01-19 22:40:23 -07:00
committed by GitHub
parent b309c5daed
commit 1a2a284972
2 changed files with 11 additions and 6 deletions

View File

@@ -1761,6 +1761,7 @@ func TestLegacySaveCommandToUnstructured(t *testing.T) {
t.Run("successfully converts save command to unstructured", func(t *testing.T) {
cmd := &dashboards.SaveDashboardCommand{
FolderUID: "folder-uid",
Message: "saving this dashboard",
Dashboard: simplejson.NewFromAny(map[string]any{"test": "test", "title": "testing slugify", "uid": "test-uid"}),
}
@@ -1771,7 +1772,7 @@ func TestLegacySaveCommandToUnstructured(t *testing.T) {
assert.Equal(t, "test-namespace", result.GetNamespace())
spec := result.Object["spec"].(map[string]any)
assert.Equal(t, spec["version"], 1)
assert.Equal(t, result.GetAnnotations(), map[string]string{utils.AnnoKeyFolder: "folder-uid"})
assert.Equal(t, result.GetAnnotations(), map[string]string{utils.AnnoKeyFolder: "folder-uid", utils.AnnoKeyMessage: "saving this dashboard"})
})
t.Run("should increase version when called", func(t *testing.T) {