@@ -11,14 +11,17 @@ import { KubeObject } from '@kinvolk/headlamp-plugin/lib/lib/k8s/cluster';
1111import { useFilterFunc } from '@kinvolk/headlamp-plugin/lib/Utils' ;
1212import { Link as MuiLink } from '@mui/material' ;
1313import React from 'react' ;
14- import CheckIfFluxInstalled , { useFluxControllerAvailableCheck } from '../checkflux' ;
14+ import { useTheme } from '@mui/material/styles' ;
15+ import { useFluxControllerAvailableCheck , useFluxInstallCheck } from '../checkflux' ;
1516import SourceLink from '../common/Link' ;
1617import Table from '../common/Table' ;
18+ import Flux404 from '../checkflux' ;
1719
1820const IMAGE_AUTOMATION_BETA_VERSION = 'v1beta2' ;
1921
2022function ImageAutomation ( ) {
2123 const CRD = K8s . ResourceClasses . CustomResourceDefinition ;
24+ const isFluxInstalled = useFluxInstallCheck ( ) ;
2225 const isVersionAvailable = CRD . apiEndpoint . apiInfo . find (
2326 apiInfo => apiInfo . version === IMAGE_AUTOMATION_BETA_VERSION
2427 ) ;
@@ -50,9 +53,16 @@ function ImageAutomation() {
5053 return imageUpdateAutomation ?. makeCRClass ( ) ;
5154 } , [ imageUpdateAutomation ] ) ;
5255
56+ if ( isFluxInstalled === null ) {
57+ return < Loader /> ;
58+ }
59+
60+ if ( ! isFluxInstalled ) {
61+ return < Flux404 /> ;
62+ }
63+
5364 return (
5465 < >
55- < CheckIfFluxInstalled />
5666 { imageRepository && < ImageRepositoryList resourceClass = { imageRepositoryClass } /> }
5767 { imagePolicy && < ImagePolicyList resourceClass = { imagePolicyClass } /> }
5868 { imageUpdateAutomation && (
@@ -73,7 +83,12 @@ export default function ImageAutomationWrapper() {
7383
7484 if ( ! isImageAutomationControllerAvailable ) {
7585 return (
76- < SectionBox >
86+ < SectionBox sx = { {
87+ padding : '1rem' ,
88+ alignItems : 'center' ,
89+ margin : '2rem auto' ,
90+ maxWidth : '600px' ,
91+ } } >
7792 < h1 > Image Automation Controller is not installed</ h1 >
7893 < p >
7994 Follow the{ ' ' }
0 commit comments