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