Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

removed feedMask as it causing issue with trigger creation #196

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions deploy/lib/deployApiGw.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ module.exports = {
this.serverless.cli.log(`Deployed API Gateway Route: ${JSON.stringify(route)}`);
}
}).catch(err => {
throw new this.serverless.classes.Error(
`Failed to deploy API Gateway route due to error: ${err.message}`
);
})
throw new this.serverless.classes.Error(
`Failed to deploy API Gateway route due to error: ${err.message}`
);
})
});
},

Expand All @@ -27,21 +27,24 @@ module.exports = {
.then(ow => ow.actions.list())
.then(allActions => {

for(let path in swagger.paths) {
for(let verb in swagger.paths[path]) {
const operation = swagger.paths[path][verb]
for (let path in swagger.paths) {
for (let verb in swagger.paths[path]) {
const operation = swagger.paths[path][verb]
if (operation['x-openwhisk'].namespace === '_') {
const swaggerAction = operation['x-openwhisk']

const action = allActions.find(item => item.name === swaggerAction.action)
swaggerAction.namespace = action.namespace
swaggerAction.url = swaggerAction.url.replace(/web\/_/, `web/${action.namespace}`)

const namespace = action.namespace.split("/")[0]

swaggerAction.namespace = namespace
swaggerAction.url = swaggerAction.url.replace(/web\/_/, `web/${namespace}`)

const id = operation.operationId
const stmts = swagger["x-ibm-configuration"].assembly.execute[0]['operation-switch'].case
const stmt = stmts.find(stmt => stmt.operations[0] === id)
const invoke = stmt.execute[stmt.execute.length -1].invoke
invoke['target-url'] = invoke['target-url'].replace(/web\/_/, `web/${action.namespace}`)
const invoke = stmt.execute[stmt.execute.length - 1].invoke
invoke['target-url'] = invoke['target-url'].replace(/web\/_/, `web/${namespace}`)
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions deploy/lib/deployTriggers.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = {
deployTriggers() {
const triggers = this.getTriggers(this.serverless.service.triggers);

if(triggers.length) {
if (triggers.length) {
this.serverless.cli.log('Deploying Triggers...');
}

Expand All @@ -35,7 +35,7 @@ module.exports = {
},

getTriggers(triggers) {
const feedMask = { feed: undefined };

return Object.keys(triggers)
.map(t => {
const trigger = triggers[t];
Expand All @@ -49,7 +49,7 @@ module.exports = {
},
});
}
return Object.assign(trigger, feedMask);
return trigger;
});
},
};