diff --git a/deploy/lib/deployTriggers.js b/deploy/lib/deployTriggers.js index 7706ee2..a2fe5f9 100644 --- a/deploy/lib/deployTriggers.js +++ b/deploy/lib/deployTriggers.js @@ -35,7 +35,6 @@ module.exports = { }, getTriggers(triggers) { - const feedMask = { feed: undefined }; return Object.keys(triggers) .map(t => { const trigger = triggers[t]; @@ -49,7 +48,7 @@ module.exports = { }, }); } - return Object.assign(trigger, feedMask); + return trigger }); }, }; diff --git a/deploy/tests/deployTriggers.js b/deploy/tests/deployTriggers.js index 1acb2a8..72163ba 100644 --- a/deploy/tests/deployTriggers.js +++ b/deploy/tests/deployTriggers.js @@ -54,11 +54,19 @@ describe('deployTriggers', () => { { triggerName: 'myTrigger', namespace: 'myNamespace', - feed: undefined }, { triggerName: 'feedTrigger', namespace: 'feedNamespace', + feed: { + feedName: "alarms/alarm", + namespace: "whisk.system", + params: { + "cron": "* * * * *", + "trigger_payload": {} + }, + trigger: "/feedNamespace/feedTrigger" + }, trigger: { annotations: [ { @@ -67,7 +75,6 @@ describe('deployTriggers', () => { } ], }, - feed: undefined }, ], }; diff --git a/provider/tests/openwhiskProvider.js b/provider/tests/openwhiskProvider.js index 9d94df4..f0dcee3 100644 --- a/provider/tests/openwhiskProvider.js +++ b/provider/tests/openwhiskProvider.js @@ -60,7 +60,7 @@ describe('OpenwhiskProvider', () => { const creds = {apihost: 'some_api', auth: 'user:pass'} sandbox.stub(openwhiskProvider, "props").returns(BbPromise.resolve(creds)) return openwhiskProvider.client().then(client => { - expect(client.actions.client.options).to.be.deep.equal({apigwToken: undefined, apigwSpaceGuid: undefined, namespace: undefined, apiKey: creds.auth, ignoreCerts: false, apiVersion: 'v1', cert: undefined, key: undefined, api: `https://${creds.apihost}/api/v1/`, authHandler: undefined, noUserAgent: undefined}) + expect(client.actions.client.options).to.be.deep.equal({apigwToken: undefined, apigwSpaceGuid: undefined, namespace: undefined, apiKey: creds.auth, ignoreCerts: false, apiVersion: 'v1', cert: undefined, key: undefined, api: `https://${creds.apihost}/api/v1/`, authHandler: undefined, noUserAgent: undefined, agent: undefined, proxy: undefined}) expect(typeof openwhiskProvider._client).to.not.equal('undefined'); }) }) @@ -71,7 +71,7 @@ describe('OpenwhiskProvider', () => { sandbox.stub(openwhiskProvider, "props").returns(BbPromise.resolve(creds)) openwhiskProvider.serverless.service.provider.ignore_certs = true return openwhiskProvider.client().then(client => { - expect(client.actions.client.options).to.be.deep.equal({apigwToken: undefined, apigwSpaceGuid: undefined, namespace: undefined, apiKey: creds.auth, ignoreCerts: true, apiVersion: 'v1', cert: undefined, key: undefined, api: `https://${creds.apihost}/api/v1/`, authHandler: undefined, noUserAgent: undefined}) + expect(client.actions.client.options).to.be.deep.equal({apigwToken: undefined, apigwSpaceGuid: undefined, namespace: undefined, apiKey: creds.auth, ignoreCerts: true, apiVersion: 'v1', cert: undefined, key: undefined, api: `https://${creds.apihost}/api/v1/`, authHandler: undefined, noUserAgent: undefined, agent: undefined, proxy: undefined}) expect(typeof openwhiskProvider._client).to.not.equal('undefined'); }) }) @@ -81,7 +81,7 @@ describe('OpenwhiskProvider', () => { const creds = {apihost: 'some_api', auth: 'user:pass', apigw_access_token: 'token'} sandbox.stub(openwhiskProvider, "props").returns(BbPromise.resolve(creds)) return openwhiskProvider.client().then(client => { - expect(client.actions.client.options).to.be.deep.equal({apigwToken: 'token', apigwSpaceGuid: 'user', namespace: undefined, apiKey: creds.auth, ignoreCerts: false, apiVersion: 'v1', cert: undefined, key: undefined, api: `https://${creds.apihost}/api/v1/`, authHandler: undefined, noUserAgent: undefined}) + expect(client.actions.client.options).to.be.deep.equal({apigwToken: 'token', apigwSpaceGuid: 'user', namespace: undefined, apiKey: creds.auth, ignoreCerts: false, apiVersion: 'v1', cert: undefined, key: undefined, api: `https://${creds.apihost}/api/v1/`, authHandler: undefined, noUserAgent: undefined, agent: undefined, proxy: undefined}) expect(typeof openwhiskProvider._client).to.not.equal('undefined'); }) })