Skip to content

Commit

Permalink
feat: Add support for versioning
Browse files Browse the repository at this point in the history
Signed-off-by: Nithish <nithishkarthik01@gmail.com>
  • Loading branch information
humblenginr committed Sep 25, 2022
1 parent 422737f commit 6633608
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions utils/artifacthub/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type AhPackage struct {
Url string
Official bool
VerifiedPublisher bool
Version string
}

func (pkg AhPackage) GenerateComponents() ([]v1alpha1.Component, error) {
Expand All @@ -37,6 +38,7 @@ func (pkg AhPackage) GenerateComponents() ([]v1alpha1.Component, error) {
if err != nil {
continue
}
comp.Metadata["version"] = pkg.Version
components = append(components, comp)
}
return components, nil
Expand Down Expand Up @@ -65,8 +67,10 @@ func (pkg *AhPackage) UpdatePackageData() error {
chartUrl := res[ArtifactHubChartUrlFieldName].(string)
official := res["repository"].(map[string]interface{})["official"].(bool)
verPub := res["repository"].(map[string]interface{})["verified_publisher"].(bool)
version := res["version"].(string)
pkg.Url = chartUrl
pkg.Official = official
pkg.VerifiedPublisher = verPub
pkg.Version = version
return nil
}

0 comments on commit 6633608

Please sign in to comment.