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

Fix to not created cron job #203

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
3 changes: 1 addition & 2 deletions deploy/lib/deployTriggers.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ module.exports = {
},

getTriggers(triggers) {
const feedMask = { feed: undefined };
return Object.keys(triggers)
.map(t => {
const trigger = triggers[t];
Expand All @@ -49,7 +48,7 @@ module.exports = {
},
});
}
return Object.assign(trigger, feedMask);
return trigger
});
},
};
11 changes: 9 additions & 2 deletions deploy/tests/deployTriggers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
{
Expand All @@ -67,7 +75,6 @@ describe('deployTriggers', () => {
}
],
},
feed: undefined
},
],
};
Expand Down
6 changes: 3 additions & 3 deletions provider/tests/openwhiskProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
})
})
Expand All @@ -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');
})
})
Expand All @@ -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');
})
})
Expand Down