mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-21 02:01:35 +00:00
fix: Don't consider volume supervised labels when comparing
Change-type: patch Closes: #1039 Signed-off-by: Cameron Diver <cameron@balena.io>
This commit is contained in:
parent
9ad2a6a343
commit
cbb079e8dc
@ -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