@@ -40,8 +40,8 @@ interface PodResource extends K8sResourceCommon {
4040 } ;
4141}
4242
43- const ROUTE = 'network-observer' ;
44- const POD_SELECTOR = { 'app.kubernetes.io/name ' : 'network-observer' } ;
43+ const ROUTE = 'skupper- network-observer' ;
44+ const POD_SELECTOR = { 'app.kubernetes.io/part-of ' : 'skupper- network-observer' } ;
4545const POD_LOADED_STATUS = 'Running' ;
4646
4747const DeploymentNetworkConsoleButton = function ( ) {
@@ -51,21 +51,21 @@ const DeploymentNetworkConsoleButton = function () {
5151 const watchResource = {
5252 groupVersionKind,
5353 namespace : NamespaceManager . getNamespace ( ) ,
54- isList : true ,
54+ isList : false ,
5555 name : ROUTE
5656 } ;
5757
5858 const watchResourcePod = {
5959 groupVersionKind : groupVersionKindPod ,
6060 namespace : NamespaceManager . getNamespace ( ) ,
61- isList : false ,
61+ isList : true ,
6262 selector : {
6363 matchLabels : POD_SELECTOR
6464 }
6565 } ;
6666
67- const [ route ] = useK8sWatchResource < RouteResource [ ] > ( watchResource ) ;
68- const [ deployment ] = useK8sWatchResource < PodResource > ( watchResourcePod ) ;
67+ const [ route ] = useK8sWatchResource < RouteResource > ( watchResource ) ;
68+ const [ deployments ] = useK8sWatchResource < PodResource [ ] > ( watchResourcePod ) ;
6969
7070 const mutationCreate = useMutation ( {
7171 mutationFn : ( ) => RESTApi . createDeployment ( )
@@ -86,16 +86,16 @@ const DeploymentNetworkConsoleButton = function () {
8686 mutationDelete . mutate ( ) ;
8787 } ;
8888 useEffect ( ( ) => {
89- console . log ( 'route' , route ) ;
90- const data = route ?. find ( ( r ) => r . metadata ?. name ?. includes ( ROUTE ) ) ;
89+ const data = route ;
9190
9291 if ( data ?. spec ?. host && data ?. spec ?. port ?. targetPort ) {
9392 const newUrl = data ?. spec ?. host ? `${ data ?. spec ?. port ?. targetPort } ://${ data ?. spec ?. host } ` : undefined ;
9493 setUrl ( newUrl ) ;
9594 }
9695 } , [ route ] ) ;
9796
98- const loaded = deployment ?. status ?. phase === POD_LOADED_STATUS && url ;
97+ const deployment = deployments ?. [ 0 ] ;
98+ const loaded = deployment ?. status ?. phase === POD_LOADED_STATUS && ! ! url ;
9999
100100 return (
101101 < Flex justifyContent = { { default : 'justifyContentSpaceBetween' } } >
0 commit comments