mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-29 18:18:52 +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
|
// 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:`);
|
console.log(`Replacing container for service ${this.serviceName} because of config changes:`);
|
||||||
if (!nonArrayEquals) {
|
if (!nonArrayEquals) {
|
||||||
console.log(' Non-array fields: ', JSON.stringify(diff(
|
// Try not to leak any sensitive information
|
||||||
thisOmitted,
|
const diffObj = diff(thisOmitted, otherOmitted) as ServiceConfig;
|
||||||
otherOmitted,
|
if (diffObj.environment != null) {
|
||||||
)));
|
diffObj.environment = _.mapValues(diffObj.environment, () => 'hidden');
|
||||||
|
}
|
||||||
|
console.log(' Non-array fields: ', JSON.stringify(diffObj));
|
||||||
}
|
}
|
||||||
if (differentArrayFields.length > 0) {
|
if (differentArrayFields.length > 0) {
|
||||||
console.log(' Array Fields: ', differentArrayFields.join(','));
|
console.log(' Array Fields: ', differentArrayFields.join(','));
|
||||||
|
Loading…
Reference in New Issue
Block a user