Skip to content

Commit

Permalink
fix: rejectUnauthorized
Browse files Browse the repository at this point in the history
  • Loading branch information
tkyi committed Aug 6, 2021
1 parent 5ee080d commit f31d2e4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ class K8sExecutor extends Executor {
method: 'PUT',
url: `${apiUri}/v4/builds/${buildId}`,
headers: { Authorization: `Bearer ${token}` },
rejectUnauthorized: false,
https: { rejectUnauthorized: false },
retry: {
limit: this.maxAttempts,
calculateDelay: ({ computedValue }) => (computedValue ? this.retryDelay : 0)
Expand Down Expand Up @@ -365,7 +365,7 @@ class K8sExecutor extends Executor {
headers: {
Authorization: `Bearer ${this.token}`
},
rejectUnauthorized: false,
https: { rejectUnauthorized: false },
context: {
caller: '_start'
}
Expand Down Expand Up @@ -416,7 +416,7 @@ class K8sExecutor extends Executor {
url: `${this.podsUrl}/${podName}/status`,
method: 'GET',
headers: { Authorization: `Bearer ${this.token}` },
rejectUnauthorized: false,
https: { rejectUnauthorized: false },
retry: {
limit: this.maxAttempts,
calculateDelay: ({ computedValue }) => (computedValue ? this.retryDelay : 0)
Expand Down Expand Up @@ -633,7 +633,7 @@ class K8sExecutor extends Executor {
headers: {
Authorization: `Bearer ${this.token}`
},
rejectUnauthorized: false,
https: { rejectUnauthorized: false },
context: {
caller: '_stop'
}
Expand Down Expand Up @@ -726,7 +726,7 @@ class K8sExecutor extends Executor {
url: this.podsUrl,
method: 'GET',
headers: { Authorization: `Bearer ${this.token}` },
rejectUnauthorized: false,
https: { rejectUnauthorized: false },
retry: {
limit: this.maxAttempts,
calculateDelay: ({ computedValue }) => (computedValue ? this.retryDelay : 0)
Expand Down
15 changes: 6 additions & 9 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ describe('index', function() {
headers: {
Authorization: 'Bearer api_key'
},
rejectUnauthorized: false,
https: { rejectUnauthorized: false },
context: {
caller: '_stop'
}
Expand All @@ -317,8 +317,7 @@ describe('index', function() {
.stop({
buildId: testBuildId
})
.then(res => {
console.log('res: ', res);
.then(() => {
assert.calledWith(requestRetryMock, deleteConfig);
assert.calledOnce(requestRetryMock);
}));
Expand Down Expand Up @@ -404,7 +403,7 @@ describe('index', function() {
headers: {
Authorization: 'Bearer api_key'
},
rejectUnauthorized: false,
https: { rejectUnauthorized: false },
context: {
caller: '_start'
}
Expand All @@ -415,7 +414,7 @@ describe('index', function() {
headers: {
Authorization: 'Bearer api_key'
},
rejectUnauthorized: false,
https: { rejectUnauthorized: false },
context: {
caller: 'getPodStatus'
},
Expand All @@ -431,7 +430,7 @@ describe('index', function() {
Authorization: `Bearer ${testToken}`
},
json: {},
rejectUnauthorized: false,
https: { rejectUnauthorized: false },
context: {
caller: 'updateBuild'
},
Expand Down Expand Up @@ -1147,7 +1146,7 @@ describe('index', function() {
headers: {
Authorization: 'Bearer api_key'
},
rejectUnauthorized: false,
https: { rejectUnauthorized: false },
hooks: { afterResponse: [executor.pendingStatusRetryStrategy] },
retry: { limit: MAXATTEMPTS },
searchParams: {
Expand Down Expand Up @@ -1499,8 +1498,6 @@ describe('index', function() {

assert.equal(expectedMessage, actualMessage);
} catch (error) {
console.log(error);

throw new Error('should not fail');
}
});
Expand Down

0 comments on commit f31d2e4

Please sign in to comment.