11import React from 'react' ;
2- import { V1Pod , ExtensionsV1beta1IngressList } from '@kubernetes/client-node' ;
2+ import { V1Pod , V1IngressList } from '@kubernetes/client-node' ;
33import styles from './Pod.module.scss' ;
44import StatusIconText from 'components/basic/IconText/StatusIconText/StatusIconText' ;
55import { GetPodStatus , GetContainerStatus , configToYAML , formatError } from 'lib/utils' ;
@@ -112,15 +112,15 @@ const openYAMLPopup = (props: Props) => {
112112const startPortForwarding = async ( props : Props ) => {
113113 try {
114114 const ingressReponse = await authFetch (
115- `/api/resource?resource=ingresses&apiVersion=extensions/v1beta1 &context=${
115+ `/api/resource?resource=ingresses&apiVersion=networking.k8s.io/v1 &context=${
116116 props . devSpaceConfig . kubeContext
117117 } &namespace=${ props . devSpaceConfig . kubeNamespace } `
118118 ) ;
119119 if ( ingressReponse . status !== 200 ) {
120120 throw new Error ( await ingressReponse . text ( ) ) ;
121121 }
122122
123- const ingressList : ExtensionsV1beta1IngressList = await ingressReponse . json ( ) ;
123+ const ingressList : V1IngressList = await ingressReponse . json ( ) ;
124124 const splittedService = props . service . split ( ':' ) ;
125125 if ( ingressList && ingressList . items ) {
126126 for ( let i = 0 ; i < ingressList . items . length ; i ++ ) {
@@ -131,7 +131,7 @@ const startPortForwarding = async (props: Props) => {
131131 if ( rule . http && rule . http . paths ) {
132132 for ( let x = 0 ; x < rule . http . paths . length ; x ++ ) {
133133 const path = rule . http . paths [ x ] ;
134- if ( path . backend && path . backend . serviceName === splittedService [ 0 ] ) {
134+ if ( path . backend && path . backend . service && path . backend . service . name === splittedService [ 0 ] ) {
135135 let suffix = '' ;
136136 if ( path . path ) {
137137 suffix = path . path ;
0 commit comments