Skip to content

Commit

Permalink
fix: updated files to adhere to linter
Browse files Browse the repository at this point in the history
  • Loading branch information
KKelvinLo committed Nov 11, 2020
1 parent 37f44d4 commit 7359cb1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class AwsEksDetector implements Detector {
[CONTAINER_RESOURCE.ID]: containerId || '',
});
} catch (e) {
config.logger.warn('This process is not running on Kubernetes because either the token path or certificate path cannot be accessed ', e);
config.logger.warn('Process is not running on K8S', e);
return Resource.empty();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ describe('awsEksDetector', () => {
const errorMsg = {
fileNotFoundError: new Error('cannot find cgroup file'),
};
let sandbox: sinon.SinonSandbox;
let readStub, fileStub, getCredStub;
const correctCgroupData =
'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklm';
const mockedClusterResponse = 'my-cluster';
const mockedAwsAuth = 'my-auth';
const k8s_token = 'Bearer 31ada4fd-adec-460c-809a-9e56ceb75269';

let sandbox: sinon.SinonSandbox;
let readStub, fileStub, getCredStub;
beforeEach(() => {
sandbox = sinon.createSandbox();
nock.disableNetConnect();
Expand Down Expand Up @@ -79,6 +79,9 @@ describe('awsEksDetector', () => {

scope.done();

sandbox.assert.calledOnce(fileStub);
sandbox.assert.calledOnce(readStub);
sandbox.assert.calledOnce(getCredStub);
assert.ok(resource);
assertK8sResource(resource, {
clusterName: 'my-cluster',
Expand Down

0 comments on commit 7359cb1

Please sign in to comment.