mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-21 18:06:47 +00:00
Merge pull request #1043 from balena-io/1039-fix-volume-on-hup
fix: Don't consider volume supervised labels when comparing
This commit is contained in:
commit
3d7781170c
@ -1,6 +1,7 @@
|
||||
import * as Docker from 'dockerode';
|
||||
import assign = require('lodash/assign');
|
||||
import isEqual = require('lodash/isEqual');
|
||||
import omitBy = require('lodash/omitBy');
|
||||
|
||||
import constants = require('../lib/constants');
|
||||
import { InternalInconsistencyError } from '../lib/errors';
|
||||
@ -90,7 +91,10 @@ export class Volume {
|
||||
public isEqualConfig(volume: Volume): boolean {
|
||||
return (
|
||||
isEqual(this.config.driverOpts, volume.config.driverOpts) &&
|
||||
isEqual(this.config.labels, volume.config.labels)
|
||||
isEqual(
|
||||
Volume.omitSupervisorLabels(this.config.labels),
|
||||
Volume.omitSupervisorLabels(volume.config.labels),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -148,6 +152,14 @@ export class Volume {
|
||||
name: match[2],
|
||||
};
|
||||
}
|
||||
|
||||
private static omitSupervisorLabels(labels: LabelObject): LabelObject {
|
||||
// TODO: Export these to a constant
|
||||
return omitBy(
|
||||
labels,
|
||||
(_v, k) => k === 'io.resin.supervised' || k === 'io.balena.supervised',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Volume;
|
||||
|
Loading…
x
Reference in New Issue
Block a user