Skip to content

Commit

Permalink
Add ingress settings support in firebase functions (#2924)
Browse files Browse the repository at this point in the history
Co-authored-by: joehan <[email protected]>
  • Loading branch information
takaaa220 and joehan committed Jan 12, 2021
1 parent 67cff84 commit fca0381
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/deploy/functions/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ module.exports = function (context, options, payload) {
vpcConnector: functionInfo.vpcConnector,
vpcConnectorEgressSettings: functionInfo.vpcConnectorEgressSettings,
serviceAccountEmail: functionInfo.serviceAccountEmail,
ingressSettings: functionInfo.ingressSettings,
})
.then((createRes) => {
if (_.has(functionTrigger, "httpsTrigger")) {
Expand Down Expand Up @@ -311,6 +312,7 @@ module.exports = function (context, options, payload) {
vpcConnector: functionInfo.vpcConnector,
vpcConnectorEgressSettings: functionInfo.vpcConnectorEgressSettings,
serviceAccountEmail: functionInfo.serviceAccountEmail,
ingressSettings: functionInfo.ingressSettings,
environmentVariables: _.assign(
{},
existingFunction.environmentVariables,
Expand Down
7 changes: 7 additions & 0 deletions src/gcp/cloudfunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ function _createFunction(options) {
if (options.serviceAccountEmail) {
data.serviceAccountEmail = options.serviceAccountEmail;
}
if (options.ingressSettings) {
data.ingressSettings = options.ingressSettings;
}

return api
.request("POST", endpoint, {
Expand Down Expand Up @@ -205,6 +208,10 @@ function _updateFunction(options) {
data.serviceAccountEmail = options.serviceAccountEmail;
masks.push("serviceAccountEmail");
}
if (options.ingressSettings) {
data.ingressSettings = options.ingressSettings;
masks.push("ingressSettings");
}
if (options.trigger.eventTrigger) {
masks = _.concat(
masks,
Expand Down

0 comments on commit fca0381

Please sign in to comment.