@@ -13,7 +13,7 @@ const deploymentReader: IWorkloadReaderFunc = async (workloadName, namespace) =>
1313 const deployment = deploymentResult . body ;
1414
1515 if ( ! deployment . metadata || ! deployment . spec || ! deployment . spec . template . metadata ||
16- ! deployment . spec . template . spec ) {
16+ ! deployment . spec . template . spec || ! deployment . status ) {
1717 // TODO(ivanstanev): add logging to know when/if it happens!
1818 return undefined ;
1919 }
@@ -24,6 +24,7 @@ const deploymentReader: IWorkloadReaderFunc = async (workloadName, namespace) =>
2424 specMeta : deployment . spec . template . metadata ,
2525 containers : deployment . spec . template . spec . containers ,
2626 ownerRefs : deployment . metadata . ownerReferences ,
27+ revision : deployment . status . observedGeneration ,
2728 } ;
2829} ;
2930
@@ -33,7 +34,7 @@ const replicaSetReader: IWorkloadReaderFunc = async (workloadName, namespace) =>
3334 const replicaSet = replicaSetResult . body ;
3435
3536 if ( ! replicaSet . metadata || ! replicaSet . spec || ! replicaSet . spec . template ||
36- ! replicaSet . spec . template . metadata || ! replicaSet . spec . template . spec ) {
37+ ! replicaSet . spec . template . metadata || ! replicaSet . spec . template . spec || ! replicaSet . status ) {
3738 // TODO(ivanstanev): add logging to know when/if it happens!
3839 return undefined ;
3940 }
@@ -44,6 +45,7 @@ const replicaSetReader: IWorkloadReaderFunc = async (workloadName, namespace) =>
4445 specMeta : replicaSet . spec . template . metadata ,
4546 containers : replicaSet . spec . template . spec . containers ,
4647 ownerRefs : replicaSet . metadata . ownerReferences ,
48+ revision : replicaSet . status . observedGeneration ,
4749 } ;
4850} ;
4951
@@ -53,7 +55,7 @@ const statefulSetReader: IWorkloadReaderFunc = async (workloadName, namespace) =
5355 const statefulSet = statefulSetResult . body ;
5456
5557 if ( ! statefulSet . metadata || ! statefulSet . spec || ! statefulSet . spec . template . metadata ||
56- ! statefulSet . spec . template . spec ) {
58+ ! statefulSet . spec . template . spec || ! statefulSet . status ) {
5759 // TODO(ivanstanev): add logging to know when/if it happens!
5860 return undefined ;
5961 }
@@ -64,6 +66,7 @@ const statefulSetReader: IWorkloadReaderFunc = async (workloadName, namespace) =
6466 specMeta : statefulSet . spec . template . metadata ,
6567 containers : statefulSet . spec . template . spec . containers ,
6668 ownerRefs : statefulSet . metadata . ownerReferences ,
69+ revision : statefulSet . status . observedGeneration ,
6770 } ;
6871} ;
6972
@@ -73,7 +76,7 @@ const daemonSetReader: IWorkloadReaderFunc = async (workloadName, namespace) =>
7376 const daemonSet = daemonSetResult . body ;
7477
7578 if ( ! daemonSet . metadata || ! daemonSet . spec || ! daemonSet . spec . template . spec ||
76- ! daemonSet . spec . template . metadata ) {
79+ ! daemonSet . spec . template . metadata || ! daemonSet . status ) {
7780 // TODO(ivanstanev): add logging to know when/if it happens!
7881 return undefined ;
7982 }
@@ -84,6 +87,7 @@ const daemonSetReader: IWorkloadReaderFunc = async (workloadName, namespace) =>
8487 specMeta : daemonSet . spec . template . metadata ,
8588 containers : daemonSet . spec . template . spec . containers ,
8689 ownerRefs : daemonSet . metadata . ownerReferences ,
90+ revision : daemonSet . status . observedGeneration ,
8791 } ;
8892} ;
8993
@@ -135,7 +139,8 @@ const replicationControllerReader: IWorkloadReaderFunc = async (workloadName, na
135139 const replicationController = replicationControllerResult . body ;
136140
137141 if ( ! replicationController . metadata || ! replicationController . spec || ! replicationController . spec . template ||
138- ! replicationController . spec . template . metadata || ! replicationController . spec . template . spec ) {
142+ ! replicationController . spec . template . metadata || ! replicationController . spec . template . spec ||
143+ ! replicationController . status ) {
139144 // TODO(ivanstanev): add logging to know when/if it happens!
140145 return undefined ;
141146 }
@@ -146,6 +151,7 @@ const replicationControllerReader: IWorkloadReaderFunc = async (workloadName, na
146151 specMeta : replicationController . spec . template . metadata ,
147152 containers : replicationController . spec . template . spec . containers ,
148153 ownerRefs : replicationController . metadata . ownerReferences ,
154+ revision : replicationController . status . observedGeneration ,
149155 } ;
150156} ;
151157
0 commit comments