Skip to content

Commit b1f9ba7

Browse files
committed
fix: update naming conventions consistentcy
1 parent 35722ed commit b1f9ba7

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

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

+9-9
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ export class AwsEksDetector implements Detector {
6262
async detect(config: ResourceDetectionConfigWithLogger): Promise<Resource> {
6363
try {
6464
await AwsEksDetector.fileAccessAsync(this.K8S_TOKEN_PATH);
65-
const k8Scert = await AwsEksDetector.readFileAsync(this.K8S_CERT_PATH);
65+
const k8scert = await AwsEksDetector.readFileAsync(this.K8S_CERT_PATH);
6666

67-
if (!this._isEks(config, k8Scert)) {
67+
if (!this._isEks(config, k8scert)) {
6868
return Resource.empty();
6969
}
7070

7171
const containerId = await this._getContainerId(config);
72-
const clusterName = await this._getClusterName(config, k8Scert);
72+
const clusterName = await this._getClusterName(config, k8scert);
7373

7474
return !containerId && !clusterName
7575
? Resource.empty()
@@ -78,7 +78,7 @@ export class AwsEksDetector implements Detector {
7878
[CONTAINER_RESOURCE.ID]: containerId || '',
7979
});
8080
} catch (e) {
81-
config.logger.warn('Not running on K8S');
81+
config.logger.warn('This process is not running on Kubernetes because either the token path or certificate path cannot be accessed ', e);
8282
return Resource.empty();
8383
}
8484
}
@@ -91,7 +91,7 @@ export class AwsEksDetector implements Detector {
9191
*/
9292
private async _isEks(
9393
config: ResourceDetectionConfigWithLogger,
94-
k8scert: Buffer
94+
cert: Buffer
9595
): Promise<boolean> {
9696
const options = {
9797
hostname: this.K8S_SVC_URL,
@@ -101,7 +101,7 @@ export class AwsEksDetector implements Detector {
101101
headers: {
102102
Authorization: await this._getK8sCredHeader(config),
103103
},
104-
ca: k8scert,
104+
ca: cert,
105105
};
106106
return !!(await this._fetchString(options));
107107
}
@@ -113,7 +113,7 @@ export class AwsEksDetector implements Detector {
113113
*/
114114
private async _getClusterName(
115115
config: ResourceDetectionConfigWithLogger,
116-
k8scert: Buffer
116+
cert: Buffer
117117
): Promise<string | undefined> {
118118
const options = {
119119
host: this.K8S_SVC_URL,
@@ -123,7 +123,7 @@ export class AwsEksDetector implements Detector {
123123
headers: {
124124
Authorization: await this._getK8sCredHeader(config),
125125
},
126-
ca: k8scert,
126+
ca: cert,
127127
};
128128
return await this._fetchString(options);
129129
}
@@ -142,7 +142,7 @@ export class AwsEksDetector implements Detector {
142142
);
143143
return 'Bearer ' + content;
144144
} catch (e) {
145-
config.logger.warn('Unable to load K8s client token.', e);
145+
config.logger.warn('Unable to read Kubernetes client token.', e);
146146
}
147147
return '';
148148
}

0 commit comments

Comments
 (0)