Skip to content

Commit

Permalink
Merge 04ecc74 into 1c15ac3
Browse files Browse the repository at this point in the history
  • Loading branch information
xyi committed Mar 13, 2019
2 parents 1c15ac3 + 04ecc74 commit d0602f8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 5 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions package/lib/compileFunctions.js
Expand Up @@ -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;
}
Expand Down

0 comments on commit d0602f8

Please sign in to comment.