Ks8/Folders: Fix status codes returned on GET (#101237)

return the correct status code for folder fetching failures
pull/101289/head
Ieva 5 months ago committed by GitHub
parent 2585fec99e
commit bfabe2ce82
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      pkg/registry/apis/folders/legacy_storage.go

@ -142,7 +142,8 @@ func (s *legacyStorage) Get(ctx context.Context, name string, options *metav1.Ge
if errors.Is(err, dashboards.ErrFolderNotFound) || err == nil {
err = resourceInfo.NewNotFound(name)
}
return nil, err
statusErr := apierrors.ToFolderStatusError(err)
return nil, &statusErr
}
r, err := convertToK8sResource(dto, s.namespacer)

Loading…
Cancel
Save