From d7da0893ab112055ecea964e6f37739abd68fe64 Mon Sep 17 00:00:00 2001 From: Jon Edvald Date: Tue, 12 Mar 2019 12:29:51 +0100 Subject: [PATCH] fix(openfaas): error when getting status of func not created by Garden --- garden-service/src/plugins/openfaas/openfaas.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/garden-service/src/plugins/openfaas/openfaas.ts b/garden-service/src/plugins/openfaas/openfaas.ts index 454c12c5de..5ab3ffce8e 100644 --- a/garden-service/src/plugins/openfaas/openfaas.ts +++ b/garden-service/src/plugins/openfaas/openfaas.ts @@ -350,7 +350,8 @@ async function getServiceStatus({ ctx, module, service }: GetServiceStatusParams } const container: any = findByName(deployment.spec.template.spec.containers, service.name) - const version = findByName(container.env, "GARDEN_VERSION").value + const envVersion = findByName(container.env, "GARDEN_VERSION") + const version = envVersion ? envVersion.value : undefined const status = await checkDeploymentStatus(api, namespace, deployment) return {