Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix statuses handing in StandardPage component of k8s API for retreiv…
…ing resources When calling k8s hook APIs for retreiving resources, the API returns 2 statuses: loaded and error. See https://github.com/openshift/console/blob/master/frontend/packages/console-dynamic-plugin-sdk/src/utils/k8s/hooks/useK8sWatchResources.ts Based on the code and on debugging, if an error status is returned setting to true, the loaded status is not nessesarily set to true as well. Therefore, fixing this in StandardPage component is required to display an API failure's error message of "Unable to retrieve data" in the center of the page insead of keep rendering a Loading component. For example, in the edge case scenrio of a non admin user that trying to list the "all namespaces" resources, the API returns an error of "403 Forbidden" and loaded is returned set to false. The providers page appears as follows before the fix: And after the fix: Signed-off-by: Sharon Gratch <[email protected]>
- Loading branch information