From bd250c9871067d81ffca39641f90026d94e08bee Mon Sep 17 00:00:00 2001 From: Allen Porter Date: Fri, 16 Jul 2021 00:52:16 -0700 Subject: [PATCH] Fix template optional field check in trace Signed-off-by: Allen Porter --- cmd/flux/trace.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/flux/trace.go b/cmd/flux/trace.go index 22fa42a8..d7ee022e 100644 --- a/cmd/flux/trace.go +++ b/cmd/flux/trace.go @@ -363,6 +363,7 @@ Status: Unknown GitRepository: {{.GitRepository.Name}} Namespace: {{.GitRepository.Namespace}} URL: {{.GitRepository.Spec.URL}} +{{- if .GitRepository.Spec.Reference }} {{- if .GitRepository.Spec.Reference.Tag }} Tag: {{.GitRepository.Spec.Reference.Tag}} {{- else if .GitRepository.Spec.Reference.SemVer }} @@ -370,6 +371,7 @@ Tag: {{.GitRepository.Spec.Reference.SemVer}} {{- else if .GitRepository.Spec.Reference.Branch }} Branch: {{.GitRepository.Spec.Reference.Branch}} {{- end }} +{{- end }} {{- if .GitRepository.Status.Artifact }} Revision: {{.GitRepository.Status.Artifact.Revision}} {{- end }}