From cc6816272da77915f3af153adffdcc6f21fb7728 Mon Sep 17 00:00:00 2001 From: Xin Yi Date: Tue, 12 Mar 2019 19:17:31 -0700 Subject: [PATCH] Support serviceAccount option for deployment --- package/lib/compileFunctions.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/package/lib/compileFunctions.js b/package/lib/compileFunctions.js index e667347..db59bbb 100644 --- a/package/lib/compileFunctions.js +++ b/package/lib/compileFunctions.js @@ -43,11 +43,18 @@ module.exports = { funcTemplate.properties.timeout = _.get(funcObject, 'timeout') || _.get(this, 'serverless.service.provider.timeout') || '60s'; + funcTemplate.properties.serviceAccount = _.get(funcObject, 'serviceAccount') + || _.get(this, 'serverless.service.provider.serviceAccount') + || ''; funcTemplate.properties.environmentVariables = _.merge( _.get(this, 'serverless.service.provider.environment'), funcObject.environment // eslint-disable-line comma-dangle ); + if (!funcTemplate.properties.serviceAccount) { + delete funcTemplate.properties.serviceAccount; + } + if (!_.size(funcTemplate.properties.environmentVariables)) { delete funcTemplate.properties.environmentVariables; }