mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-20 14:13:08 +00:00
fix: Redact environment variable values in debug output
Chnage-type: patch Signed-off-by: Cameron Diver <cameron@resin.io>
This commit is contained in:
parent
2a94a7b730
commit
6ad3a7981d
@ -609,10 +609,12 @@ export class Service {
|
||||
// so that if we end up in a restart loop, we know exactly why
|
||||
console.log(`Replacing container for service ${this.serviceName} because of config changes:`);
|
||||
if (!nonArrayEquals) {
|
||||
console.log(' Non-array fields: ', JSON.stringify(diff(
|
||||
thisOmitted,
|
||||
otherOmitted,
|
||||
)));
|
||||
// Try not to leak any sensitive information
|
||||
const diffObj = diff(thisOmitted, otherOmitted) as ServiceConfig;
|
||||
if (diffObj.environment != null) {
|
||||
diffObj.environment = _.mapValues(diffObj.environment, () => 'hidden');
|
||||
}
|
||||
console.log(' Non-array fields: ', JSON.stringify(diffObj));
|
||||
}
|
||||
if (differentArrayFields.length > 0) {
|
||||
console.log(' Array Fields: ', differentArrayFields.join(','));
|
||||
|
Loading…
Reference in New Issue
Block a user