Skip to content

Commit 4f49b53

Browse files
authored
Merge pull request #829 from devtron-labs/fix/image-pull-message
chore: error layout fix
2 parents d16dee3 + 67284b6 commit 4f49b53

2 files changed

Lines changed: 25 additions & 61 deletions

File tree

src/Shared/Components/Error/ErrorBar.tsx

Lines changed: 24 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@
1616

1717
import { NavLink } from 'react-router-dom'
1818

19-
import { ReactComponent as ErrorInfo } from '../../../Assets/Icon/ic-errorInfo.svg'
20-
import { DISCORD_LINK, URLS } from '../../../Common'
19+
import { URLS } from '@Common/Constants'
20+
2121
import { AppType } from '../../types'
22+
import { Icon } from '../Icon'
23+
import { InfoBlock } from '../InfoBlock'
2224
import { ErrorBarType } from './types'
23-
import { getIsImagePullBackOff, renderErrorHeaderMessage } from './utils'
25+
import { getIsImagePullBackOff } from './utils'
2426

2527
const ErrorBar = ({ appDetails, useParentMargin = true }: ErrorBarType) => {
2628
if (
@@ -37,70 +39,32 @@ const ErrorBar = ({ appDetails, useParentMargin = true }: ErrorBarType) => {
3739

3840
return (
3941
isImagePullBackOff && (
40-
<div className={`er-2 bw-1 br-4 ${useParentMargin ? 'm-20' : ''} fs-13`}>
41-
<div className="bcr-1 pl-12 pr-12 pt-8 pb-8 dc__border-bottom-r2 flex left dc__top-radius-4">
42-
<ErrorInfo className="icon-dim-24 mr-8" /> <span className="mr-8">IMAGEPULLBACKOFF:</span>
43-
{renderErrorHeaderMessage(appDetails, 'error-bar')}
44-
</div>
45-
{!appDetails.ipsAccessProvided ? (
46-
<div className="pl-12 pr-12 pt-8 pb-8">
47-
<div className="fw-6">How to resolve? </div>
48-
<div className="flex left">
49-
1. Allow &apos;{appDetails.clusterName}&apos; cluster to access credentials for ‘
50-
{appDetails.dockerRegistryId}’ registry and deploy again.
51-
<br />
42+
<div className={`flexbox-col dc__gap-16 ${useParentMargin ? 'm-20' : ''} fs-13`}>
43+
<InfoBlock
44+
heading={
45+
<div className="flexbox dc__content-space fs-13 lh-20 cn-9 fw-6">
46+
<div>
47+
ImagePullBackOff: Failed to pull image on ‘{appDetails.clusterName}’ from ‘
48+
{appDetails.dockerRegistryId}
49+
</div>
5250
<NavLink
5351
to={`${URLS.GLOBAL_CONFIG_DOCKER}/${appDetails.dockerRegistryId}`}
5452
className="cb-5 fs-13 anchor w-auto dc__no-decor flex ml-8"
5553
>
56-
Manage access&nbsp;&nbsp;
54+
Check Permission&nbsp;&nbsp;
55+
<Icon name="ic-arrow-right" color="B500" />
5756
</NavLink>
5857
</div>
59-
2. Redeploy the application after allowing access
60-
<span className="flex left">
61-
{/* Will add document link once available */}
62-
{/* <NavLink
63-
to={`${URLS.STACK_MANAGER_DISCOVER_MODULES_DETAILS}`}
64-
className="cb-5 fs-13 anchor w-auto dc__no-decor flex ml-8"
65-
target="_blank"
66-
>
67-
View Documentation&nbsp;
68-
</NavLink> */}
69-
</span>
70-
</div>
71-
) : (
72-
<>
73-
<div className="pl-12 pr-12 pt-8 pb-8">
74-
<div className="fw-6">Possible issues? </div>
75-
1. Provided credentials may not have permission to pull image from ‘
76-
{appDetails.dockerRegistryId}’ registry. <br />
77-
2. Provided credentials may be invalid.
78-
</div>
79-
<div className="pl-12 pr-12 pt-8 pb-8" style={{ background: 'var(--bg-secondary)' }}>
80-
<div className="flex left">
81-
<span className="mr-8 fw-6">Already provided permission?</span>
82-
Redeploy the application.
83-
<NavLink
84-
to={`/app/${appDetails.appId}/${URLS.APP_TRIGGER}`}
85-
className="cb-5 fs-13 anchor w-auto dc__no-decor flex"
86-
>
87-
&nbsp; Go to Deploy
88-
</NavLink>
89-
</div>
90-
<div className="flex left">
91-
<span className="mr-8 fw-6">Facing issues?</span>
92-
<a
93-
href={DISCORD_LINK}
94-
className="cb-5 fs-13 anchor w-auto dc__no-decor flex"
95-
target="_blank"
96-
rel="noreferrer"
97-
>
98-
Chat with support
99-
</a>
100-
</div>
58+
}
59+
description={
60+
<div className="flexbox-col fs-13 lh-20 cn-9 dc__content-space">
61+
<div>Possible causes for ImagePullBackOff:</div>
62+
<div>&nbsp;&bull; The cluster may not have permission to pull images from the registry</div>
63+
<div>&nbsp;&bull; The image tag might be incorrect or missing in the registry</div>
10164
</div>
102-
</>
103-
)}
65+
}
66+
variant="error"
67+
/>
10468
</div>
10569
)
10670
)

src/Shared/Components/Error/utils.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const getIsImagePullBackOff = (appDetails: AppDetails): boolean => {
3333
return false
3434
}
3535

36-
export const renderErrorHeaderMessage = (appDetails: AppDetails, key: string, onClickActionButton?): JSX.Element => (
36+
export const renderErrorHeaderMessage = (appDetails: AppDetails, key: string, onClickActionButton?) => (
3737
<div>
3838
&apos;{appDetails.clusterName}&apos; cluster
3939
{appDetails.ipsAccessProvided ? ' could not' : ' does not have permission to'} pull container image from ‘

0 commit comments

Comments
 (0)