Check if local exports exist (#197)

Check if local exports exist during diffing. For tar, the file must
exist. For local, the directory must exist and be populated.

Fixes https://github.com/pulumi/pulumi-docker-build/issues/177.
This commit is contained in:
Bryce Lampe
2024-08-13 13:52:10 -07:00
committed by GitHub
parent 81a7aa4ec4
commit d9c3284f40
4 changed files with 66 additions and 0 deletions

View File

@@ -913,6 +913,12 @@ func (*Image) Diff(
if fmt.Sprint(olds.Exports) != fmt.Sprint(news.Exports) {
diff["exports"] = update
}
// Confirm local exports exist.
for idx, e := range news.Exports {
if !e.Local.Exists() || !e.Tar.Exists() {
diff[fmt.Sprintf("exports[%d]", idx)] = update
}
}
if !reflect.DeepEqual(olds.Labels, news.Labels) {
diff["labels"] = update
}