From b37d7eac60a0b3b9344ac63bf8f50d747c0d82bb Mon Sep 17 00:00:00 2001 From: Akhil Mohan Date: Thu, 7 Feb 2019 13:51:07 +0530 Subject: [PATCH] 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 --- util/template_utils.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/template_utils.go b/util/template_utils.go index afc4c303..21775253 100644 --- a/util/template_utils.go +++ b/util/template_utils.go @@ -78,9 +78,9 @@ PACKAGE IMAGE1 ({{.Image1}}) IMAGE2 ({{.Image2}}){{range .Diff.InfoDiff}}{{"\n"} const HistoryDiffOutput = ` -----{{.DiffType}}----- -Docker history lines found only in {{.Image1}}:{{if not .Diff.Adds}} None{{else}}{{block "list" .Diff.Adds}}{{"\n"}}{{range .}}{{print "-" .}}{{"\n"}}{{end}}{{end}}{{end}} +Docker history lines found only in {{.Image1}}:{{if not .Diff.Adds}} None{{else}}{{block "list" .Diff.Dels}}{{"\n"}}{{range .}}{{print "-" .}}{{"\n"}}{{end}}{{end}}{{end}} -Docker history lines found only in {{.Image2}}:{{if not .Diff.Dels}} None{{else}}{{block "list2" .Diff.Dels}}{{"\n"}}{{range .}}{{print "-" .}}{{"\n"}}{{end}}{{end}}{{end}} +Docker history lines found only in {{.Image2}}:{{if not .Diff.Dels}} None{{else}}{{block "list2" .Diff.Adds}}{{"\n"}}{{range .}}{{print "-" .}}{{"\n"}}{{end}}{{end}}{{end}} ` const MetadataDiffOutput = `