forked from kubev2v/forklift-console-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle fetching from inventory for users that don't have permissions …
…to list all namespaces Reference: kubev2v#1293 Handle providers fetching from inventory for users with limited namespace roles, who can only list their namespaces content and don't have get permissions to all namespaces. Before the fix, when those users tried to fetch providers inventory data, regarldess to current namespace, the "inventory server is not reachable" error was always displayed. After this fix, those users will not fetch all namepsaces but only ones which they allow to list. So the fetching should now succeed and no error should be displayed. Signed-off-by: Sharon Gratch <[email protected]>
- Loading branch information
Showing
6 changed files
with
176 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...ift-console-plugin/src/modules/Providers/views/list/components/NamespaceNotAccessible.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
import { Alert, Text, TextContent, TextVariants } from '@patternfly/react-core'; | ||
|
||
export const NamespaceNotAccessible: React.FC = () => { | ||
const { t } = useTranslation(); | ||
return ( | ||
<Alert title={t('Namespace')} variant="warning"> | ||
<TextContent> | ||
<Text component={TextVariants.p}> | ||
{t( | ||
'Namespace is not accessible. To troubleshoot, check the Forklift controller pod logs.', | ||
)} | ||
</Text> | ||
</TextContent> | ||
</Alert> | ||
); | ||
}; | ||
|
||
export default NamespaceNotAccessible; |
21 changes: 21 additions & 0 deletions
21
...t-console-plugin/src/modules/Providers/views/list/components/ProvidersK8sNotReachable.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
import { Alert, Text, TextContent, TextVariants } from '@patternfly/react-core'; | ||
|
||
export const ProvidersK8sNotReachable: React.FC = () => { | ||
const { t } = useTranslation(); | ||
return ( | ||
<Alert title={t('Providers')} variant="warning"> | ||
<TextContent> | ||
<Text component={TextVariants.p}> | ||
{t( | ||
'Providers are not accessible. To troubleshoot, check the Forklift controller pod logs.', | ||
)} | ||
</Text> | ||
</TextContent> | ||
</Alert> | ||
); | ||
}; | ||
|
||
export default ProvidersK8sNotReachable; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters