From ec2d0fa67c51c69cda13f45d92c5745fea6a55db Mon Sep 17 00:00:00 2001 From: Cai Lei Date: Wed, 8 Nov 2017 19:31:24 +0800 Subject: [PATCH] Check 'pod.metadata.labels' exists before using it --- lib/deploy.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/deploy.js b/lib/deploy.js index 4ce7d04..e06e3bf 100644 --- a/lib/deploy.js +++ b/lib/deploy.js @@ -142,6 +142,7 @@ function waitForDeployment(funcName, requestMoment, namespace, options) { const functionPods = _.filter( podsInfo.items, (pod) => ( + !_.isEmpty(pod.metadata.labels) && pod.metadata.labels.function === funcName && // Ignore pods that may still exist from a previous deployment moment(pod.metadata.creationTimestamp) >= requestMoment