[release-12.0.1] Dashboards and Folders: cleanup timestamps and error codes (#104720)
K8s: Fix timestamps and error codes
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/utils/ptr"
|
||||
|
||||
@@ -434,7 +435,7 @@ func (a *dashboardSqlAccess) SaveDashboard(ctx context.Context, orgId int64, das
|
||||
return nil, created, err
|
||||
}
|
||||
if failOnExisting && !created {
|
||||
return nil, created, dashboards.ErrDashboardWithSameUIDExists
|
||||
return nil, created, apierrors.NewConflict(dashboardV1.DashboardResourceInfo.GroupResource(), dash.Name, dashboards.ErrDashboardWithSameUIDExists)
|
||||
}
|
||||
|
||||
out, err := a.dashStore.SaveDashboard(ctx, *cmd)
|
||||
|
||||
@@ -273,7 +273,7 @@ func (s *legacyStorage) Update(ctx context.Context,
|
||||
NewParentUID: newParent,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, created, fmt.Errorf("error changing parent folder spec")
|
||||
return nil, created, err
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user