Skip to content

Commit 87d48f9

Browse files
committed
Produce unique hash per chunk variant
1 parent 3155a2b commit 87d48f9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pkg/dazzle/project.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,11 +425,18 @@ func (p *ProjectChunk) manifest(baseref string, out io.Writer, excludeTests bool
425425
res = append(res, fmt.Sprintf("%s:%s", strings.TrimPrefix(src, p.ContextPath), hex.EncodeToString(hash.Sum(nil))))
426426
}
427427

428+
args := make([]string, 0, len(p.Args))
429+
for k, v := range p.Args {
430+
args = append(args, fmt.Sprintf("%s=%s", k, v))
431+
}
432+
sort.Strings(args)
433+
428434
if baseref != "" {
429435
fmt.Fprintf(out, "Baseref: %s\n", baseref)
430436
}
431437
fmt.Fprintf(out, "Dockerfile: %s\n", string(p.Dockerfile))
432438
fmt.Fprintf(out, "Sources:\n%s\n", strings.Join(res, "\n"))
439+
fmt.Fprintf(out, "Args:\n%s\n", strings.Join(args, "\n"))
433440
if !excludeTests {
434441
tests, _ := yaml.Marshal(p.Tests)
435442
fmt.Fprintf(out, "Tests:\n%s\n", string(tests))

0 commit comments

Comments
 (0)