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:
Sergio C. Arteaga 2021-02-09 14:34:05 +01:00 committed by GitHub
parent 28d0ba0451
commit 0f64cdc5c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 2 deletions

View File

@ -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,

View File

@ -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)

View File

@ -56,7 +56,9 @@ func TestTrackerSource(t *testing.T) {
},
},
Data: map[string]interface{}{
"apiVersion": "v2",
"apiVersion": "v2",
"kubeVersion": ">= 1.13.0 < 1.15.0",
"type": "application",
},
Version: "1.0.0",
AppVersion: "1.0.0",