diff --git a/src/compose/service.ts b/src/compose/service.ts index 8417d5fb..e2b9f118 100644 --- a/src/compose/service.ts +++ b/src/compose/service.ts @@ -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(','));