Skip to content
This repository was archived by the owner on Jul 26, 2022. It is now read-only.

Commit 448305a

Browse files
authored
fix: add a accurate log message when AWS region is not defined in the Systems manager manifest (#648)
Signed-off-by: yutachaos <[email protected]>
1 parent 3409c66 commit 448305a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/backends/system-manager-backend.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ class SystemManagerBackend extends KVBackend {
2424
* @returns {Promise} Promise object representing secret property value.
2525
*/
2626
async _get ({ key, specOptions: { roleArn, region } }) {
27+
this._logger.info(`fetching secret property ${key} with role: ${roleArn || 'pods role'} in region: ${region || 'pods region'}`)
28+
2729
let client = this._client
2830
let factoryArgs = null
2931
if (roleArn) {
30-
this._logger.info(`fetching secret property ${key} with role: ${roleArn} in region ${region}`)
3132
const credentials = this._assumeRole({
3233
RoleArn: roleArn,
3334
RoleSessionName: 'k8s-external-secrets'
@@ -36,9 +37,8 @@ class SystemManagerBackend extends KVBackend {
3637
...factoryArgs,
3738
credentials
3839
}
39-
} else {
40-
this._logger.info(`fetching secret property ${key} with pod role in region ${region}`)
4140
}
41+
4242
if (region) {
4343
factoryArgs = {
4444
...factoryArgs,

0 commit comments

Comments
 (0)