Skip to content

Commit

Permalink
Populate app versions in app crds (#422)
Browse files Browse the repository at this point in the history
We previously just used helm chart versions, but can dive into the Chart.yaml and grab app version where present
  • Loading branch information
michaeljguarino committed Jul 18, 2023
1 parent 84fd497 commit f7da9ad
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/api/charts.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ func convertVersion(version *gqlclient.VersionFragment) *Version {
v := &Version{
Id: version.ID,
Version: version.Version,
Helm: version.Helm,
}
if version.Readme != nil {
v.Readme = *version.Readme
Expand Down
1 change: 1 addition & 0 deletions pkg/api/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ type Version struct {
Id string
Version string
Readme string
Helm map[string]interface{}
Package string
ValuesTemplate string
TemplateType gqlclient.TemplateType
Expand Down
7 changes: 7 additions & 0 deletions pkg/scaffold/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,13 @@ func repoUrl(w *wkspace.Workspace, repo string, chart string) string {
func appVersion(charts []*api.ChartInstallation) string {
for _, inst := range charts {
if inst.Chart.Dependencies.Application {
if inst.Version.Helm != nil {
if vsn, ok := inst.Version.Helm["appVersion"]; ok {
if v, ok := vsn.(string); ok {
return v
}
}
}
return inst.Version.Version
}
}
Expand Down

0 comments on commit f7da9ad

Please sign in to comment.