Skip to content

Commit 75bd07a

Browse files
committed
handle when pod is terminated
1 parent 0107fb8 commit 75bd07a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

integration-tests/src/test/java/oracle/kubernetes/operator/utils/K8sTestUtils.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,11 @@ public V1Pod getPod(String namespace, String labelSelectors, String podName) {
410410
* @return boolean true if the pod is in Terminating status
411411
*/
412412
public boolean isPodTerminating(String namespace, String labelSelectors, String podName) {
413-
V1ObjectMeta metadata = getPod(namespace, labelSelectors, podName).getMetadata();
413+
V1ObjectMeta metadata;
414+
metadata = getPod(namespace, labelSelectors, podName).getMetadata();
415+
if (metadata == null) {
416+
return false;
417+
}
414418
if (metadata.getDeletionTimestamp() != null) {
415419
logger.info(metadata.getDeletionTimestamp().toString());
416420
} else {

0 commit comments

Comments
 (0)