Storage: Test mode 5 (#93714)

This commit is contained in:
Todd Treece
2024-09-25 08:29:17 -04:00
committed by GitHub
parent 618e4014a7
commit 177965704d
6 changed files with 47 additions and 28 deletions

View File

@@ -15,6 +15,7 @@ import (
"github.com/grafana/grafana/pkg/services/apiserver/endpoints/request"
gapiutil "github.com/grafana/grafana/pkg/services/apiserver/utils"
playlistsvc "github.com/grafana/grafana/pkg/services/playlist"
"github.com/grafana/grafana/pkg/util"
)
func LegacyUpdateCommandToUnstructured(cmd playlistsvc.UpdatePlaylistCommand) unstructured.Unstructured {
@@ -34,6 +35,9 @@ func LegacyUpdateCommandToUnstructured(cmd playlistsvc.UpdatePlaylistCommand) un
},
},
}
if cmd.UID == "" {
cmd.UID = util.GenerateShortUID()
}
obj.SetName(cmd.UID)
return obj
}