Folders: Fix panic in unified storage only mode (#110979)

This commit is contained in:
Stephanie Hingtgen
2025-09-11 18:43:03 +00:00
committed by GitHub
parent f5457c7909
commit ca9982dc15
+5
View File
@@ -143,6 +143,10 @@ func (b *FolderAPIBuilder) UpdateAPIGroupInfo(apiGroupInfo *genericapiserver.API
storage := map[string]rest.Storage{}
if b.ignoreLegacy {
opts.StorageOptsRegister(resourceInfo.GroupResource(), apistore.StorageOptions{
EnableFolderSupport: true,
RequireDeprecatedInternalID: true})
store, err := grafanaregistry.NewRegistryStore(opts.Scheme, resourceInfo, opts.OptsGetter)
if err != nil {
return err
@@ -150,6 +154,7 @@ func (b *FolderAPIBuilder) UpdateAPIGroupInfo(apiGroupInfo *genericapiserver.API
storage[resourceInfo.StoragePath()] = store
apiGroupInfo.VersionedResourcesStorageMap[folders.VERSION] = storage
b.storage = storage[resourceInfo.StoragePath()].(grafanarest.Storage)
b.parents = newParentsGetter(store, folder.MaxNestedFolderDepth)
return nil
}