Remove fatal error from docker secrets
This commit fixes #242 by catching the error thrown by getSecrets(). The underlying issue exists in docker-secret and has to do with the serviceAccount secret installed automatically by kubernetes.
This commit is contained in:
parent
b08181e712
commit
a536ad49ea
2 changed files with 10 additions and 6 deletions
2
package-lock.json
generated
2
package-lock.json
generated
|
@ -7754,4 +7754,4 @@
|
|||
"integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w=="
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,14 +3,18 @@ const Logger = require('../Logger');
|
|||
const logger = new Logger();
|
||||
|
||||
const initDockerSecrets = () => {
|
||||
const secrets = getSecrets();
|
||||
try {
|
||||
const secrets = getSecrets();
|
||||
|
||||
for (const property in secrets) {
|
||||
const upperProperty = property.toUpperCase();
|
||||
for (const property in secrets) {
|
||||
const upperProperty = property.toUpperCase();
|
||||
|
||||
process.env[upperProperty] = secrets[property];
|
||||
process.env[upperProperty] = secrets[property];
|
||||
|
||||
logger.log(`${upperProperty} was overwritten with docker secret value`);
|
||||
logger.log(`${upperProperty} was overwritten with docker secret value`);
|
||||
}
|
||||
} catch(e) {
|
||||
logger.log('Failed to initialize docker secrets. Error: ' + e, 'ERROR');
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue