Skip to content

Commit

Permalink
Merge pull request #28 from screwdriver-cd/revert-25-use-admin-func
Browse files Browse the repository at this point in the history
fix: Revert "[2] fix(854): Use pipeline.admin function"
  • Loading branch information
minzcmu authored Jun 4, 2018
2 parents a030b07 + bf1786c commit 308fc68
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
3 changes: 1 addition & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@ class ExecutorQueue extends Executor {
* @return {Promise}
*/
async postBuildEvent({ pipeline, job, apiUri }) {
const admin = await pipeline.admin;
const jwt = this.tokenGen(admin.username, {}, pipeline.scmContext);
const jwt = this.tokenGen(Object.keys(pipeline.admins)[0], {}, pipeline.scmContext);

const options = {
url: `${apiUri}/v4/events`,
Expand Down
6 changes: 0 additions & 6 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,6 @@ describe('index test', () => {

executor.tokenGen = tokenGen;

const adminMock = Promise.resolve({
username: 'test'
});

testDelayedConfig.pipeline.admin = adminMock;

executor.startPeriodic(testDelayedConfig).then(() => {
assert.calledOnce(queueMock.connect);
assert.notCalled(redisMock.hset);
Expand Down

0 comments on commit 308fc68

Please sign in to comment.