File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ const parseInfoFromResourceNode = (
2222 const steps = spec . strategy ?. canary ?. steps || [ ] ;
2323 ro . steps = steps ;
2424
25- if ( status . currentStepIndex && steps . length > 0 ) {
25+ if ( steps && status . currentStepIndex && steps . length > 0 ) {
2626 ro . step = `${ status . currentStepIndex } /${ steps . length } ` ;
2727 }
2828
@@ -49,8 +49,10 @@ const parseInfoFromResourceNode = (
4949 }
5050
5151 ro . containers = [ ] ;
52- for ( const c of spec . template ?. spec ?. containers ) {
53- ro . containers . push ( { name : c . name , image : c . image } ) ;
52+ if ( spec . template ) {
53+ for ( const c of spec . template ?. spec ?. containers ) {
54+ ro . containers . push ( { name : c . name , image : c . image } ) ;
55+ }
5456 }
5557
5658 ro . current = status . replicas ;
@@ -64,8 +66,8 @@ const parseCurrentCanaryStep = (
6466) : { currentStep : any ; currentStepIndex : number } => {
6567 const { status, spec } = resource ;
6668 const canary = spec . strategy ?. canary ;
67- if ( ! canary || canary . steps . length === 0 ) {
68- return null ;
69+ if ( ! canary || ! canary . steps || canary . steps . length === 0 ) {
70+ return { currentStep : null , currentStepIndex : - 1 } ;
6971 }
7072 let currentStepIndex = 0 ;
7173 if ( status . currentStepIndex ) {
You can’t perform that action at this time.
0 commit comments