Storage: Remove storageLocalUpload flag (#52413)

This commit is contained in:
Ryan McKinley 2022-07-18 10:44:42 -07:00 committed by GitHub
parent 841e5ae8ad
commit 824f12a993
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 18 additions and 39 deletions

View File

@ -43,7 +43,6 @@ export interface FeatureToggles {
storage?: boolean;
dashboardsFromStorage?: boolean;
export?: boolean;
storageLocalUpload?: boolean;
azureMonitorResourcePickerForMetrics?: boolean;
explore2Dashboard?: boolean;
tracing?: boolean;

View File

@ -227,17 +227,16 @@ func (hs *HTTPServer) registerRoutes() {
})
if hs.Features.IsEnabled(featuremgmt.FlagStorage) {
apiRoute.Group("/storage", func(orgRoute routing.RouteRegister) {
orgRoute.Get("/list/", routing.Wrap(hs.StorageService.List))
orgRoute.Get("/list/*", routing.Wrap(hs.StorageService.List))
orgRoute.Get("/read/*", routing.Wrap(hs.StorageService.Read))
apiRoute.Group("/storage", func(storageRoute routing.RouteRegister) {
storageRoute.Get("/list/", routing.Wrap(hs.StorageService.List))
storageRoute.Get("/list/*", routing.Wrap(hs.StorageService.List))
storageRoute.Get("/read/*", routing.Wrap(hs.StorageService.Read))
if hs.Features.IsEnabled(featuremgmt.FlagStorageLocalUpload) {
orgRoute.Post("/delete/*", reqGrafanaAdmin, routing.Wrap(hs.StorageService.Delete))
orgRoute.Post("/upload", reqGrafanaAdmin, routing.Wrap(hs.StorageService.Upload))
orgRoute.Post("/createFolder", reqGrafanaAdmin, routing.Wrap(hs.StorageService.CreateFolder))
orgRoute.Post("/deleteFolder", reqGrafanaAdmin, routing.Wrap(hs.StorageService.DeleteFolder))
}
// Write paths
storageRoute.Post("/delete/*", reqGrafanaAdmin, routing.Wrap(hs.StorageService.Delete))
storageRoute.Post("/upload", reqGrafanaAdmin, routing.Wrap(hs.StorageService.Upload))
storageRoute.Post("/createFolder", reqGrafanaAdmin, routing.Wrap(hs.StorageService.CreateFolder))
storageRoute.Post("/deleteFolder", reqGrafanaAdmin, routing.Wrap(hs.StorageService.DeleteFolder))
})
}

View File

@ -152,12 +152,6 @@ var (
State: FeatureStateAlpha,
RequiresDevMode: true,
},
{
Name: "storageLocalUpload",
Description: "allow uploads to local storage",
State: FeatureStateAlpha,
RequiresDevMode: true,
},
{
Name: "azureMonitorResourcePickerForMetrics",
Description: "New UI for Azure Monitor Metrics Query",

View File

@ -115,10 +115,6 @@ const (
// Export grafana instance (to git, etc)
FlagExport = "export"
// FlagStorageLocalUpload
// allow uploads to local storage
FlagStorageLocalUpload = "storageLocalUpload"
// FlagAzureMonitorResourcePickerForMetrics
// New UI for Azure Monitor Metrics Query
FlagAzureMonitorResourcePickerForMetrics = "azureMonitorResourcePickerForMetrics"

View File

@ -108,15 +108,16 @@ func ProvideService(sql *sqlstore.SQLStore, features featuremgmt.FeatureToggles,
initializeOrgStorages := func(orgId int64) []storageRuntime {
storages := make([]storageRuntime, 0)
if features.IsEnabled(featuremgmt.FlagStorageLocalUpload) {
storages = append(storages,
newSQLStorage(RootResources,
"Resources",
&StorageSQLConfig{orgId: orgId}, sql).
setBuiltin(true).
setDescription("Upload custom resource files"))
}
// Custom upload files
storages = append(storages,
newSQLStorage(RootResources,
"Resources",
&StorageSQLConfig{orgId: orgId}, sql).
setBuiltin(true).
setDescription("Upload custom resource files"))
// System settings
storages = append(storages,
newSQLStorage(RootSystem,
"System",

View File

@ -94,16 +94,6 @@ export const ResourcePickerPopover = (props: Props) => {
<button className={getTabClassName(PickerTabType.URL)} onClick={() => setActivePicker(PickerTabType.URL)}>
URL
</button>
{config.featureToggles['storageLocalUpload'] ? (
<button
className={getTabClassName(PickerTabType.Upload)}
onClick={() => setActivePicker(PickerTabType.Upload)}
>
Upload
</button>
) : (
''
)}
</div>
<div className={styles.resourcePickerPopoverContent}>
{renderPicker()}