mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-21 02:01:35 +00:00
commit
8e0327662d
@ -501,6 +501,7 @@ export class Service {
|
||||
) as ServiceConfig['networks'];
|
||||
|
||||
return {
|
||||
name: `${this.serviceName}_${this.imageId}_${this.releaseId}`,
|
||||
Tty: this.config.tty,
|
||||
Cmd: this.config.command,
|
||||
Volumes: volumes,
|
||||
@ -608,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(','));
|
||||
|
@ -458,5 +458,5 @@ export function normalizeLabels(
|
||||
});
|
||||
const balenaLabels = _.pickBy(labels, (_v, k) => _.startsWith(k, 'io.balena.'));
|
||||
const otherLabels = _.pickBy(labels, (_v, k) => !(_.startsWith(k, 'io.balena.') || _.startsWith(k, 'io.resin.')));
|
||||
return _.assign({}, otherLabels, legacyLabels, balenaLabels);
|
||||
return _.assign({}, otherLabels, legacyLabels, balenaLabels) as { [key: string]: string };
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ class Config extends EventEmitter {
|
||||
})
|
||||
.then((value) => {
|
||||
const schemaEntry = this.schema[key];
|
||||
if (value == null && schemaEntry != null && schemaEntry.default) {
|
||||
if (value == null && schemaEntry != null && schemaEntry.default != null) {
|
||||
return schemaEntry.default;
|
||||
}
|
||||
return value;
|
||||
|
@ -490,7 +490,6 @@ module.exports = class DeviceState extends EventEmitter
|
||||
|
||||
triggerApplyTarget: ({ force = false, delay = 0, initial = false } = {}) =>
|
||||
if @applyInProgress
|
||||
console.log('==> Apply in progress')
|
||||
if !@scheduledApply?
|
||||
@scheduledApply = { force, delay }
|
||||
else
|
||||
@ -506,7 +505,6 @@ module.exports = class DeviceState extends EventEmitter
|
||||
console.log('Applying target state')
|
||||
@applyTarget({ force, initial })
|
||||
.finally =>
|
||||
console.log('==> Done applying target state!')
|
||||
@applyInProgress = false
|
||||
@reportCurrentState()
|
||||
if @scheduledApply?
|
||||
|
Loading…
x
Reference in New Issue
Block a user