Skip to content

Commit 7359cb1

Browse files
committed
fix: updated files to adhere to linter
1 parent 37f44d4 commit 7359cb1

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

packages/opentelemetry-resource-detector-aws/src/detectors/AwsEksDetector.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export class AwsEksDetector implements Detector {
7878
[CONTAINER_RESOURCE.ID]: containerId || '',
7979
});
8080
} catch (e) {
81-
config.logger.warn('This process is not running on Kubernetes because either the token path or certificate path cannot be accessed ', e);
81+
config.logger.warn('Process is not running on K8S', e);
8282
return Resource.empty();
8383
}
8484
}

packages/opentelemetry-resource-detector-aws/test/detectors/AwsEksDetector.test.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ describe('awsEksDetector', () => {
3434
const errorMsg = {
3535
fileNotFoundError: new Error('cannot find cgroup file'),
3636
};
37-
let sandbox: sinon.SinonSandbox;
38-
let readStub, fileStub, getCredStub;
3937
const correctCgroupData =
4038
'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklm';
4139
const mockedClusterResponse = 'my-cluster';
4240
const mockedAwsAuth = 'my-auth';
4341
const k8s_token = 'Bearer 31ada4fd-adec-460c-809a-9e56ceb75269';
4442

43+
let sandbox: sinon.SinonSandbox;
44+
let readStub, fileStub, getCredStub;
4545
beforeEach(() => {
4646
sandbox = sinon.createSandbox();
4747
nock.disableNetConnect();
@@ -79,6 +79,9 @@ describe('awsEksDetector', () => {
7979

8080
scope.done();
8181

82+
sandbox.assert.calledOnce(fileStub);
83+
sandbox.assert.calledOnce(readStub);
84+
sandbox.assert.calledOnce(getCredStub);
8285
assert.ok(resource);
8386
assertK8sResource(resource, {
8487
clusterName: 'my-cluster',

0 commit comments

Comments
 (0)