Skip to content
This repository was archived by the owner on Mar 27, 2024. It is now read-only.

Commit b37d7ea

Browse files
committed
fix result switch while viewing with type history
when container-diff is run with --type history the results are switched between the images. This commit fixes this issue by changing the template for HistoryDiffOutput Signed-off-by: Akhil Mohan <akhil.mohan@mayadata.io>
1 parent 5b5e627 commit b37d7ea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

util/template_utils.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ PACKAGE IMAGE1 ({{.Image1}}) IMAGE2 ({{.Image2}}){{range .Diff.InfoDiff}}{{"\n"}
7878
const HistoryDiffOutput = `
7979
-----{{.DiffType}}-----
8080
81-
Docker history lines found only in {{.Image1}}:{{if not .Diff.Adds}} None{{else}}{{block "list" .Diff.Adds}}{{"\n"}}{{range .}}{{print "-" .}}{{"\n"}}{{end}}{{end}}{{end}}
81+
Docker history lines found only in {{.Image1}}:{{if not .Diff.Adds}} None{{else}}{{block "list" .Diff.Dels}}{{"\n"}}{{range .}}{{print "-" .}}{{"\n"}}{{end}}{{end}}{{end}}
8282
83-
Docker history lines found only in {{.Image2}}:{{if not .Diff.Dels}} None{{else}}{{block "list2" .Diff.Dels}}{{"\n"}}{{range .}}{{print "-" .}}{{"\n"}}{{end}}{{end}}{{end}}
83+
Docker history lines found only in {{.Image2}}:{{if not .Diff.Dels}} None{{else}}{{block "list2" .Diff.Adds}}{{"\n"}}{{range .}}{{print "-" .}}{{"\n"}}{{end}}{{end}}{{end}}
8484
`
8585

8686
const MetadataDiffOutput = `

0 commit comments

Comments
 (0)