K8s: Remove restore functionality; can be done with list (#102560)
This commit is contained in:
@@ -265,8 +265,6 @@ type GetDashboardQuery struct {
|
||||
FolderID *int64
|
||||
FolderUID *string
|
||||
OrgID int64
|
||||
|
||||
IncludeDeleted bool // only supported when using unified storage
|
||||
}
|
||||
|
||||
type DashboardTagCloudItem struct {
|
||||
|
||||
@@ -757,7 +757,7 @@ func (dr *DashboardServiceImpl) saveDashboard(ctx context.Context, cmd *dashboar
|
||||
|
||||
func (dr *DashboardServiceImpl) GetSoftDeletedDashboard(ctx context.Context, orgID int64, uid string) (*dashboards.Dashboard, error) {
|
||||
if dr.features.IsEnabledGlobally(featuremgmt.FlagKubernetesClientDashboardsFolders) {
|
||||
return dr.getDashboardThroughK8s(ctx, &dashboards.GetDashboardQuery{OrgID: orgID, UID: uid, IncludeDeleted: true})
|
||||
return dr.getDashboardThroughK8s(ctx, &dashboards.GetDashboardQuery{OrgID: orgID, UID: uid})
|
||||
}
|
||||
|
||||
return dr.dashboardStore.GetSoftDeletedDashboard(ctx, orgID, uid)
|
||||
@@ -1520,12 +1520,6 @@ func (dr *DashboardServiceImpl) CleanUpDeletedDashboards(ctx context.Context) (i
|
||||
// -----------------------------------------------------------------------------------------
|
||||
|
||||
func (dr *DashboardServiceImpl) getDashboardThroughK8s(ctx context.Context, query *dashboards.GetDashboardQuery) (*dashboards.Dashboard, error) {
|
||||
// if including deleted dashboards for restore, use the /latest subresource
|
||||
subresource := ""
|
||||
if query.IncludeDeleted && dr.features.IsEnabledGlobally(featuremgmt.FlagKubernetesRestore) {
|
||||
subresource = "latest"
|
||||
}
|
||||
|
||||
// get uid if not passed in
|
||||
if query.UID == "" {
|
||||
result, err := dr.GetDashboardUIDByID(ctx, &dashboards.GetDashboardRefByIDQuery{
|
||||
@@ -1538,7 +1532,7 @@ func (dr *DashboardServiceImpl) getDashboardThroughK8s(ctx context.Context, quer
|
||||
query.UID = result.UID
|
||||
}
|
||||
|
||||
out, err := dr.k8sclient.Get(ctx, query.UID, query.OrgID, v1.GetOptions{}, subresource)
|
||||
out, err := dr.k8sclient.Get(ctx, query.UID, query.OrgID, v1.GetOptions{}, "")
|
||||
if err != nil && !apierrors.IsNotFound(err) {
|
||||
return nil, err
|
||||
} else if err != nil || out == nil {
|
||||
|
||||
@@ -656,12 +656,6 @@ var (
|
||||
Owner: grafanaAppPlatformSquad,
|
||||
FrontendOnly: true,
|
||||
},
|
||||
{
|
||||
Name: "kubernetesRestore",
|
||||
Description: "Allow restoring objects in k8s",
|
||||
Stage: FeatureStageExperimental,
|
||||
Owner: grafanaAppPlatformSquad,
|
||||
},
|
||||
{
|
||||
Name: "kubernetesClientDashboardsFolders",
|
||||
Description: "Route the folder and dashboard service requests to k8s",
|
||||
|
||||
@@ -413,7 +413,6 @@ unifiedStorageSearchUI,2024-12-19T18:21:48Z,,a8f347144ddc16f2033fdeb4f3474e49239
|
||||
playlistsReconciler,2024-12-20T03:09:31Z,,24bf337c562dc9b9d8684cc9acb7ea171ea83414,Charandas
|
||||
k8SFolderCounts,2024-12-27T17:10:44Z,,df36e77cd31d2ad77e3d708748d040367a0c8c9c,Leonor Oliveira
|
||||
k8SFolderMove,2024-12-27T17:10:44Z,,df36e77cd31d2ad77e3d708748d040367a0c8c9c,Leonor Oliveira
|
||||
kubernetesRestore,2025-01-03T14:48:47Z,,5429512779bd5f25b88ff728ea91efdef7dfafa0,Stephanie Hingtgen
|
||||
improvedExternalSessionHandlingSAML,2025-01-09T17:02:49Z,,c52ec21c75ab72c2f7d28259bac0364edae560d0,Misi
|
||||
teamHttpHeadersMimir,2025-01-13T10:42:47Z,,04acbcdef23f673bd6bbfdbbece29c9769ce155a,Eric Leijonmarck
|
||||
ABTestFeatureToggleA,2025-01-13T21:13:13Z,,009d7f42b3d09b3a6be1f00f07314e2b25af7ebc,Nathan Marrs
|
||||
|
||||
|
@@ -86,7 +86,6 @@ formatString,GA,@grafana/dataviz-squad,false,false,true
|
||||
kubernetesPlaylists,GA,@grafana/grafana-app-platform-squad,false,true,false
|
||||
kubernetesSnapshots,experimental,@grafana/grafana-app-platform-squad,false,true,false
|
||||
kubernetesDashboards,experimental,@grafana/grafana-app-platform-squad,false,false,true
|
||||
kubernetesRestore,experimental,@grafana/grafana-app-platform-squad,false,false,false
|
||||
kubernetesClientDashboardsFolders,experimental,@grafana/grafana-app-platform-squad,false,false,false
|
||||
datasourceQueryTypes,experimental,@grafana/grafana-app-platform-squad,false,true,false
|
||||
queryService,experimental,@grafana/grafana-app-platform-squad,false,true,false
|
||||
|
||||
|
@@ -355,10 +355,6 @@ const (
|
||||
// Use the kubernetes API in the frontend for dashboards
|
||||
FlagKubernetesDashboards = "kubernetesDashboards"
|
||||
|
||||
// FlagKubernetesRestore
|
||||
// Allow restoring objects in k8s
|
||||
FlagKubernetesRestore = "kubernetesRestore"
|
||||
|
||||
// FlagKubernetesClientDashboardsFolders
|
||||
// Route the folder and dashboard service requests to k8s
|
||||
FlagKubernetesClientDashboardsFolders = "kubernetesClientDashboardsFolders"
|
||||
|
||||
@@ -2404,18 +2404,6 @@
|
||||
"expression": "true"
|
||||
}
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"name": "kubernetesRestore",
|
||||
"resourceVersion": "1735880498698",
|
||||
"creationTimestamp": "2025-01-03T14:48:47Z"
|
||||
},
|
||||
"spec": {
|
||||
"description": "Allow restoring objects in k8s",
|
||||
"stage": "experimental",
|
||||
"codeowner": "@grafana/grafana-app-platform-squad"
|
||||
}
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"name": "kubernetesSnapshots",
|
||||
|
||||
Reference in New Issue
Block a user