From ba218f781d4c7455cd995eea55be09e902370905 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Mon, 22 Aug 2022 17:20:14 +0000 Subject: [PATCH] pipeline: include mounts in stage checksum When calculating the checksum of the stage, the mount options were not included. This was maybe deliberate, because if the mounts of a stage change, it is very likely that previous stages change too. But the introduction of non-device mounts, like ostree.deployment, have changed the setting, since the content of the tree will be different if that mount is applied or not. And even for the device based mounts it will change the tree if e.g. a device is mounted at at different path but otherwise is formatted with the very same options. In the worst case we miss a few cache hits due to changes in the mount setup that don't lead to tree changes, but that will rarely happen in practice. --- osbuild/pipeline.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osbuild/pipeline.py b/osbuild/pipeline.py index fec08dc3..5ce2fea1 100644 --- a/osbuild/pipeline.py +++ b/osbuild/pipeline.py @@ -88,6 +88,9 @@ class Stage: if self.inputs: data = {n: i.id for n, i in self.inputs.items()} m.update(json.dumps(data, sort_keys=True).encode()) + if self.mounts: + data = [m.id for m in self.mounts.values()] + m.update(json.dumps(data).encode()) return m.hexdigest() @property