mirror of https://github.com/artifacthub/hub.git
Track kubeVersion and type in Helm charts (#1109)
Related to #1104 Related to #1105 Signed-off-by: Sergio Castaño Arteaga <tegioz@icloud.com>
This commit is contained in:
parent
28d0ba0451
commit
0f64cdc5c6
|
|
@ -110,7 +110,7 @@ func (m *TXMock) Query(ctx context.Context, sql string, args ...interface{}) (pg
|
|||
return nil, nil
|
||||
}
|
||||
|
||||
// Query implements the pgx.Tx interface.
|
||||
// QueryFunc implements the pgx.Tx interface.
|
||||
func (m *TXMock) QueryFunc(
|
||||
ctx context.Context,
|
||||
sql string,
|
||||
|
|
|
|||
|
|
@ -372,6 +372,9 @@ func enrichPackageFromArchive(p *hub.Package, chart *chart.Chart) error {
|
|||
p.Data["dependencies"] = dependencies
|
||||
}
|
||||
|
||||
// Kubernetes version
|
||||
p.Data["kubeVersion"] = chart.Metadata.KubeVersion
|
||||
|
||||
// License
|
||||
licenseFile := getFile(chart, "LICENSE")
|
||||
if licenseFile != nil {
|
||||
|
|
@ -415,6 +418,9 @@ func enrichPackageFromArchive(p *hub.Package, chart *chart.Chart) error {
|
|||
p.Readme = string(readme.Data)
|
||||
}
|
||||
|
||||
// Type
|
||||
p.Data["type"] = chart.Metadata.Type
|
||||
|
||||
// Enrich package with information from annotations
|
||||
if err := enrichPackageFromAnnotations(p, md.Annotations); err != nil {
|
||||
return fmt.Errorf("error enriching package from annotations: %w", err)
|
||||
|
|
|
|||
|
|
@ -57,6 +57,8 @@ func TestTrackerSource(t *testing.T) {
|
|||
},
|
||||
Data: map[string]interface{}{
|
||||
"apiVersion": "v2",
|
||||
"kubeVersion": ">= 1.13.0 < 1.15.0",
|
||||
"type": "application",
|
||||
},
|
||||
Version: "1.0.0",
|
||||
AppVersion: "1.0.0",
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in New Issue