Skip to content

Commit

Permalink
Parse requirement's alias and display "alias(name)" if 'alias' was de…
Browse files Browse the repository at this point in the history
…fined
  • Loading branch information
hmacias-avaya committed Oct 30, 2020
1 parent 561b946 commit 205c7bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/document/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,11 @@ func getRequirementsTableTemplates() string {
requirementsSectionBuilder.WriteString("| Repository | Name | Version |\n")
requirementsSectionBuilder.WriteString("|------------|------|---------|\n")
requirementsSectionBuilder.WriteString(" {{- range .Dependencies }}")
requirementsSectionBuilder.WriteString(" {{ if .Alias }}")
requirementsSectionBuilder.WriteString("\n| {{ .Repository }} | {{ .Alias }}({{ .Name }}) | {{ .Version }} |")
requirementsSectionBuilder.WriteString(" {{ else }}")
requirementsSectionBuilder.WriteString("\n| {{ .Repository }} | {{ .Name }} | {{ .Version }} |")
requirementsSectionBuilder.WriteString(" {{ end }}")
requirementsSectionBuilder.WriteString(" {{- end }}")
requirementsSectionBuilder.WriteString("{{ end }}")

Expand Down
1 change: 1 addition & 0 deletions pkg/helm/chart_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ type ChartRequirementsItem struct {
Name string
Version string
Repository string
Alias string
}

type ChartRequirements struct {
Expand Down

0 comments on commit 205c7bb

Please sign in to comment.