From 0275f688ec64144f45d20cda31204e25bc1d4cf7 Mon Sep 17 00:00:00 2001 From: Tayler Geiger Date: Fri, 29 Mar 2024 16:09:55 -0500 Subject: [PATCH 1/3] Add NOTES.txt check Signed-off-by: Tayler Geiger --- .../checks/chart-0.1.0-v3.without-notes.tgz | Bin 0 -> 3671 bytes internal/chartverifier/checks/checks.go | 19 +++++++++ internal/chartverifier/checks/checks_test.go | 37 +++++++++++++++++ internal/chartverifier/profiles/default.go | 3 +- .../chartverifier/profiles/profile_test.go | 19 +++++---- internal/chartverifier/verifierbuilder.go | 1 + .../profiles/profile-community-1.3.yaml | 38 +++++++++++++++++ .../profiles/profile-partner-1.3.yaml | 39 ++++++++++++++++++ .../profiles/profile-redhat-1.3.yaml | 39 ++++++++++++++++++ pkg/chartverifier/checks/checks.go | 2 + 10 files changed, 187 insertions(+), 10 deletions(-) create mode 100644 internal/chartverifier/checks/chart-0.1.0-v3.without-notes.tgz create mode 100644 internal/profileconfig/profiles/profile-community-1.3.yaml create mode 100644 internal/profileconfig/profiles/profile-partner-1.3.yaml create mode 100644 internal/profileconfig/profiles/profile-redhat-1.3.yaml diff --git a/internal/chartverifier/checks/chart-0.1.0-v3.without-notes.tgz b/internal/chartverifier/checks/chart-0.1.0-v3.without-notes.tgz new file mode 100644 index 0000000000000000000000000000000000000000..a9867dbd5483a48f6d5727eb300e5ad3c8d0bf1e GIT binary patch literal 3671 zcmV-d4yf@TiwFP!000001MM9BZ`-!AKMTnJz~^qr)>p}rKNACcctP5?6>GDg={gL< zFwhchbCE<{&EP z%CDZ|jU3ksnDkSgC|!0!zGGoT^sXT@k&^GTDNAFfn6$W$7z?EmIq7z; z9A89T-NZ&5CyD3QCA2GhI{eo+p3`$3_t1)I#3qKmrB(?%14|+IDfVwIix#fqIj+6z zJ4+h!!1~y;`1yj7f0)ILNk{q%7E$MSDdL;#V~_lUwjVU)f9Q>St^D5wys-%Bd|?*8 zGa;Qqd~pxh`F;@Tyc?u+rfhfIHD&iZ53ymA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sIEBKe;X(1*Oea2QkuaGe`Qv?TUCr63(XautnDk1I z_lxX^tsSDSDDvUUMg0jcRc91$f~O1vHW-q}4GNo9Y9U*d_XpQW^7@jyAR(hmX0CYa zOW8imtB-blzF`&u#Q+r{ZeEaq)G>+>)i4y;NZ Date: Fri, 19 Apr 2024 13:53:32 -0500 Subject: [PATCH 2/3] Make NOTES.txt check optional Also change command help message to say "NOTES.txt" --- internal/chartverifier/checks/checks.go | 5 ++--- internal/chartverifier/profiles/default.go | 2 +- internal/profileconfig/profiles/profile-partner-1.3.yaml | 2 +- internal/profileconfig/profiles/profile-redhat-1.3.yaml | 3 +-- tests/charts/psql-service/0.1.11/community-report-info.json | 2 +- tests/charts/psql-service/0.1.11/partner-report-info.json | 2 +- tests/charts/psql-service/0.1.11/redhat-report-info.json | 2 +- tests/charts/psql-service/0.1.8/community-report-info.json | 2 +- tests/charts/psql-service/0.1.8/partner-report-info.json | 2 +- tests/charts/psql-service/0.1.8/redhat-report-info.json | 2 +- tests/charts/psql-service/0.1.9/community-report-info.json | 2 +- tests/charts/psql-service/0.1.9/partner-report-info.json | 2 +- tests/charts/psql-service/0.1.9/redhat-report-info.json | 2 +- 13 files changed, 14 insertions(+), 16 deletions(-) diff --git a/internal/chartverifier/checks/checks.go b/internal/chartverifier/checks/checks.go index 887a3203..4fcf7c3b 100644 --- a/internal/chartverifier/checks/checks.go +++ b/internal/chartverifier/checks/checks.go @@ -39,8 +39,8 @@ const ( APIVersion2 = "v2" ReadmeExist = "Chart has a README" ReadmeDoesNotExist = "Chart does not have a README" - NotesExist = "Chart does contain NOTES" - NotesDoesNotExist = "Chart does not contain NOTES" + NotesExist = "Chart does contain NOTES.txt" + NotesDoesNotExist = "Chart does not contain NOTES.txt" NotHelm3Reason = "API version is not V2, used in Helm 3" Helm3Reason = "API version is V2, used in Helm 3" TestTemplatePrefix = "templates/tests/" @@ -121,7 +121,6 @@ func HasNotes(opts *CheckOptions) (Result, error) { r := NewResult(false, NotesDoesNotExist) for _, f := range c.Templates { - fmt.Println(f.Name) if f.Name == "templates/NOTES.txt" { r.SetResult(true, NotesExist) } diff --git a/internal/chartverifier/profiles/default.go b/internal/chartverifier/profiles/default.go index edee5d45..b1facdf5 100644 --- a/internal/chartverifier/profiles/default.go +++ b/internal/chartverifier/profiles/default.go @@ -43,7 +43,7 @@ func getDefaultProfile(msg string) *Profile { {Name: fmt.Sprintf("%s/%s", CheckVersion10, apiChecks.ChartTesting), Type: apiChecks.MandatoryCheckType}, {Name: fmt.Sprintf("%s/%s", CheckVersion10, apiChecks.RequiredAnnotationsPresent), Type: apiChecks.MandatoryCheckType}, {Name: fmt.Sprintf("%s/%s", CheckVersion10, apiChecks.SignatureIsValid), Type: apiChecks.MandatoryCheckType}, - {Name: fmt.Sprintf("%s/%s", CheckVersion10, apiChecks.HasNotes), Type: apiChecks.MandatoryCheckType}, + {Name: fmt.Sprintf("%s/%s", CheckVersion10, apiChecks.HasNotes), Type: apiChecks.OptionalCheckType}, } return &profile diff --git a/internal/profileconfig/profiles/profile-partner-1.3.yaml b/internal/profileconfig/profiles/profile-partner-1.3.yaml index 37afe3db..f51832d0 100644 --- a/internal/profileconfig/profiles/profile-partner-1.3.yaml +++ b/internal/profileconfig/profiles/profile-partner-1.3.yaml @@ -35,5 +35,5 @@ checks: - name: v1.0/signature-is-valid type: Mandatory - name: v1.0/has-notes - type: Mandatory + type: Optional diff --git a/internal/profileconfig/profiles/profile-redhat-1.3.yaml b/internal/profileconfig/profiles/profile-redhat-1.3.yaml index 07f2a00b..90271a9c 100644 --- a/internal/profileconfig/profiles/profile-redhat-1.3.yaml +++ b/internal/profileconfig/profiles/profile-redhat-1.3.yaml @@ -35,5 +35,4 @@ checks: - name: v1.0/signature-is-valid type: Mandatory - name: v1.0/has-notes - type: Mandatory - + type: Optional diff --git a/tests/charts/psql-service/0.1.11/community-report-info.json b/tests/charts/psql-service/0.1.11/community-report-info.json index e4f9e04a..de4595ce 100644 --- a/tests/charts/psql-service/0.1.11/community-report-info.json +++ b/tests/charts/psql-service/0.1.11/community-report-info.json @@ -24,7 +24,7 @@ }, "metadata": { "vendorType": "community", - "profileVersion": "v1.2", + "profileVersion": "v1.3", "webCatalogOnly": false, "chart-uri": "psql-service-0.1.11.tgz", "chart": { diff --git a/tests/charts/psql-service/0.1.11/partner-report-info.json b/tests/charts/psql-service/0.1.11/partner-report-info.json index 08f1353a..a89a01dd 100644 --- a/tests/charts/psql-service/0.1.11/partner-report-info.json +++ b/tests/charts/psql-service/0.1.11/partner-report-info.json @@ -24,7 +24,7 @@ }, "metadata": { "vendorType": "partner", - "profileVersion": "v1.2", + "profileVersion": "v1.3", "webCatalogOnly": false, "chart-uri": "psql-service-0.1.11.tgz", "chart": { diff --git a/tests/charts/psql-service/0.1.11/redhat-report-info.json b/tests/charts/psql-service/0.1.11/redhat-report-info.json index 583a0682..2aa46c07 100644 --- a/tests/charts/psql-service/0.1.11/redhat-report-info.json +++ b/tests/charts/psql-service/0.1.11/redhat-report-info.json @@ -24,7 +24,7 @@ }, "metadata": { "vendorType": "redhat", - "profileVersion": "v1.2", + "profileVersion": "v1.3", "webCatalogOnly": false, "chart-uri": "psql-service-0.1.11.tgz", "chart": { diff --git a/tests/charts/psql-service/0.1.8/community-report-info.json b/tests/charts/psql-service/0.1.8/community-report-info.json index ca523a89..c99d873f 100644 --- a/tests/charts/psql-service/0.1.8/community-report-info.json +++ b/tests/charts/psql-service/0.1.8/community-report-info.json @@ -23,7 +23,7 @@ }, "metadata": { "vendorType": "community", - "profileVersion": "v1.2", + "profileVersion": "v1.3", "webCatalogOnly": false, "chart-uri": "/charts/src", "chart": { diff --git a/tests/charts/psql-service/0.1.8/partner-report-info.json b/tests/charts/psql-service/0.1.8/partner-report-info.json index bb70d793..d6dda5cc 100644 --- a/tests/charts/psql-service/0.1.8/partner-report-info.json +++ b/tests/charts/psql-service/0.1.8/partner-report-info.json @@ -23,7 +23,7 @@ }, "metadata": { "vendorType": "partner", - "profileVersion": "v1.2", + "profileVersion": "v1.3", "webCatalogOnly": false, "chart-uri": "/charts/src", "chart": { diff --git a/tests/charts/psql-service/0.1.8/redhat-report-info.json b/tests/charts/psql-service/0.1.8/redhat-report-info.json index f73ba2cf..d9bb63d4 100644 --- a/tests/charts/psql-service/0.1.8/redhat-report-info.json +++ b/tests/charts/psql-service/0.1.8/redhat-report-info.json @@ -23,7 +23,7 @@ }, "metadata": { "vendorType": "redhat", - "profileVersion": "v1.2", + "profileVersion": "v1.3", "webCatalogOnly": false, "chart-uri": "/charts/src", "chart": { diff --git a/tests/charts/psql-service/0.1.9/community-report-info.json b/tests/charts/psql-service/0.1.9/community-report-info.json index 6a5a78aa..bc364936 100644 --- a/tests/charts/psql-service/0.1.9/community-report-info.json +++ b/tests/charts/psql-service/0.1.9/community-report-info.json @@ -23,7 +23,7 @@ }, "metadata": { "vendorType": "community", - "profileVersion": "v1.2", + "profileVersion": "v1.3", "webCatalogOnly": false, "chart-uri": "psql-service-0.1.9.tgz", "chart": { diff --git a/tests/charts/psql-service/0.1.9/partner-report-info.json b/tests/charts/psql-service/0.1.9/partner-report-info.json index 5ecc00dc..97ca7be3 100644 --- a/tests/charts/psql-service/0.1.9/partner-report-info.json +++ b/tests/charts/psql-service/0.1.9/partner-report-info.json @@ -23,7 +23,7 @@ }, "metadata": { "vendorType": "partner", - "profileVersion": "v1.2", + "profileVersion": "v1.3", "webCatalogOnly": false, "chart-uri": "psql-service-0.1.9.tgz", "chart": { diff --git a/tests/charts/psql-service/0.1.9/redhat-report-info.json b/tests/charts/psql-service/0.1.9/redhat-report-info.json index db0b5105..c4efd412 100644 --- a/tests/charts/psql-service/0.1.9/redhat-report-info.json +++ b/tests/charts/psql-service/0.1.9/redhat-report-info.json @@ -23,7 +23,7 @@ }, "metadata": { "vendorType": "redhat", - "profileVersion": "v1.2", + "profileVersion": "v1.3", "webCatalogOnly": false, "chart-uri": "psql-service-0.1.9.tgz", "chart": { From 93966564eb95f3237d34dce2fb424fa9130e9240 Mon Sep 17 00:00:00 2001 From: Tayler Geiger Date: Tue, 23 Apr 2024 14:42:09 -0500 Subject: [PATCH 3/3] Update docs to include has-notes check Also add breaks to has-notes and has-readme logic --- docs/helm-chart-checks.md | 43 +++++++++++++++---------- docs/helm-chart-troubleshooting.md | 4 +++ internal/chartverifier/checks/checks.go | 2 ++ 3 files changed, 32 insertions(+), 17 deletions(-) diff --git a/docs/helm-chart-checks.md b/docs/helm-chart-checks.md index 98a2f66d..caff548a 100644 --- a/docs/helm-chart-checks.md +++ b/docs/helm-chart-checks.md @@ -52,21 +52,22 @@ The following table lists the set of checks for each profile version with detail #### Table 2: Helm chart default checks -| Profile v1.2 | Profile v1.1 | Profile v1.0 | Description | -|:-------------------------------:|:-------------------------------:|:-------------------------------:|--------------- -| [is-helm-v3 v1.0](helm-chart-troubleshooting.md#is-helm-v3-v10) | [is-helm-v3 v1.0](helm-chart-troubleshooting.md#is-helm-v3-v10) | [is-helm-v3 v1.0](helm-chart-troubleshooting.md#is-helm-v3-v10) | Checks that the given `uri` points to a Helm v3 chart. -| [has-readme v1.0](helm-chart-troubleshooting.md#has-readme-v10) | [has-readme v1.0](helm-chart-troubleshooting.md#has-readme-v10) | [has-readme v1.0](helm-chart-troubleshooting.md#has-readme-v10) | Checks that the Helm chart contains the `README.md` file. -| [contains-test V1.0](helm-chart-troubleshooting.md#contains-test-v10) | [contains-test V1.0](helm-chart-troubleshooting.md#contains-test-v10) | [contains-test v1.0](helm-chart-troubleshooting.md#contains-test-v10) | Checks that the Helm chart contains at least one test file. -| [has-kubeversion v1.1](helm-chart-troubleshooting.md#has-kubeversion-v11) | [has-kubeversion v1.1](helm-chart-troubleshooting.md#has-kubeversion-v11) | [has-kubeversion v1.0](helm-chart-troubleshooting.md#has-kubeversion-v10) | Checks that the `Chart.yaml` file of the Helm chart includes the `kubeVersion` field (v1.0) and is a valid semantic version (v1.1). -| [contains-values-schema v1.0](helm-chart-troubleshooting.md#contains-values-schema-v10) | [contains-values-schema v1.0](helm-chart-troubleshooting.md#contains-values-schema-v10) | [contains-values-schema v1.0](helm-chart-troubleshooting.md#contains-values-schema-v10) | Checks that the Helm chart contains a JSON schema file (`values.schema.json`) to validate the `values.yaml` file in the chart. -| [not-contains-crds v1.0](helm-chart-troubleshooting.md#not-contains-crds-v10) | [not-contains-crds v1.0](helm-chart-troubleshooting.md#not-contains-crds-v10) | [not-contains-crds v1.0](helm-chart-troubleshooting.md#not-contains-crds-v10) | Checks that the Helm chart does not include custom resource definitions (CRDs). -| [not-contain-csi-objects v1.0](helm-chart-troubleshooting.md#not-contain-csi-objects-v10) | [not-contain-csi-objects v1.0](helm-chart-troubleshooting.md#not-contain-csi-objects-v10) | [not-contain-csi-objects v1.0](helm-chart-troubleshooting.md#not-contain-csi-objects-v10) | Checks that the Helm chart does not include Container Storage Interface (CSI) objects. -| [images-are-certified v1.1](helm-chart-troubleshooting.md#images-are-certified-v10) | [images-are-certified v1.0](helm-chart-troubleshooting.md#images-are-certified-v10) | [images-are-certified v1.0](helm-chart-troubleshooting.md#images-are-certified-v10) | Checks that the images referenced by the Helm chart are Red Hat-certified. -| [helm-lint v1.0](helm-chart-troubleshooting.md#helm-lint-v10) | [helm-lint v1.0](helm-chart-troubleshooting.md#helm-lint-v10) | [helm-lint v1.0](helm-chart-troubleshooting.md#helm-lint-v10) | Checks that the chart is well formed by running the `helm lint` command. -| [chart-testing v1.0](helm-chart-troubleshooting.md#chart-testing-v10) | [chart-testing v1.0](helm-chart-troubleshooting.md#chart-testing-v10) | [chart-testing v1.0](helm-chart-troubleshooting.md#chart-testing-v10) | Installs the chart and verifies it on a Red Hat OpenShift Container Platform cluster. -| [contains-values v1.0](helm-chart-troubleshooting.md#contains-values-v10) | [contains-values v1.0](helm-chart-troubleshooting.md#contains-values-v10) | [contains-values v1.0](helm-chart-troubleshooting.md#contains-values-v10) | Checks that the Helm chart contains the `values`[¹](https://github.com/redhat-certification/chart-verifier/blob/main/docs/helm-chart-checks.md#-for-more-information-on-the-values-file-see-values-and-best-practices-for-using-values) file. -| [required-annotations-present v1.0](helm-chart-troubleshooting.md#required-annotations-present-v10) | [required-annotations-present v1.0](helm-chart-troubleshooting.md#required-annotations-present-v10) | - | Checks that the Helm chart contains the annotation: ```charts.openshift.io/name```. -| [signature-is-valid v1.0](helm-chart-troubleshooting.md#signature-is-valid-v10) | - | - | Verifies a signed chart based on a provided public key | +| Profile v1.3 | Profile v1.2 | Profile v1.1 | Profile v1.0 | Description | +|---|---|---|---|---| +| [is-helm-v3 v1.0](helm-chart-troubleshooting.md#is-helm-v3-v10) | [is-helm-v3 v1.0](helm-chart-troubleshooting.md#is-helm-v3-v10) | [is-helm-v3 v1.0](helm-chart-troubleshooting.md#is-helm-v3-v10) | [is-helm-v3 v1.0](helm-chart-troubleshooting.md#is-helm-v3-v10) | Checks that the given `uri` points to a Helm v3 chart. | +| [has-readme v1.0](helm-chart-troubleshooting.md#has-readme-v10) | [has-readme v1.0](helm-chart-troubleshooting.md#has-readme-v10) | [has-readme v1.0](helm-chart-troubleshooting.md#has-readme-v10) | [has-readme v1.0](helm-chart-troubleshooting.md#has-readme-v10) | Checks that the Helm chart contains the `README.md` file. | +| [contains-test V1.0](helm-chart-troubleshooting.md#contains-test-v10) | [contains-test V1.0](helm-chart-troubleshooting.md#contains-test-v10) | [contains-test V1.0](helm-chart-troubleshooting.md#contains-test-v10) | [contains-test v1.0](helm-chart-troubleshooting.md#contains-test-v10) | Checks that the Helm chart contains at least one test file. | +| [has-kubeversion v1.1](helm-chart-troubleshooting.md#has-kubeversion-v11) | [has-kubeversion v1.1](helm-chart-troubleshooting.md#has-kubeversion-v11) | [has-kubeversion v1.1](helm-chart-troubleshooting.md#has-kubeversion-v11) | [has-kubeversion v1.0](helm-chart-troubleshooting.md#has-kubeversion-v10) | Checks that the `Chart.yaml` file of the Helm chart includes the `kubeVersion` field (v1.0) and is a valid semantic version (v1.1). | +| [contains-values-schema v1.0](helm-chart-troubleshooting.md#contains-values-schema-v10) | [contains-values-schema v1.0](helm-chart-troubleshooting.md#contains-values-schema-v10) | [contains-values-schema v1.0](helm-chart-troubleshooting.md#contains-values-schema-v10) | [contains-values-schema v1.0](helm-chart-troubleshooting.md#contains-values-schema-v10) | Checks that the Helm chart contains a JSON schema file (`values.schema.json`) to validate the `values.yaml` file in the chart. | +| [not-contains-crds v1.0](helm-chart-troubleshooting.md#not-contains-crds-v10) | [not-contains-crds v1.0](helm-chart-troubleshooting.md#not-contains-crds-v10) | [not-contains-crds v1.0](helm-chart-troubleshooting.md#not-contains-crds-v10) | [not-contains-crds v1.0](helm-chart-troubleshooting.md#not-contains-crds-v10) | Checks that the Helm chart does not include custom resource definitions (CRDs). | +| [not-contain-csi-objects v1.0](helm-chart-troubleshooting.md#not-contain-csi-objects-v10) | [not-contain-csi-objects v1.0](helm-chart-troubleshooting.md#not-contain-csi-objects-v10) | [not-contain-csi-objects v1.0](helm-chart-troubleshooting.md#not-contain-csi-objects-v10) | [not-contain-csi-objects v1.0](helm-chart-troubleshooting.md#not-contain-csi-objects-v10) | Checks that the Helm chart does not include Container Storage Interface (CSI) objects. | +| [images-are-certified v1.1](helm-chart-troubleshooting.md#images-are-certified-v10) | [images-are-certified v1.1](helm-chart-troubleshooting.md#images-are-certified-v10) | [images-are-certified v1.0](helm-chart-troubleshooting.md#images-are-certified-v10) | [images-are-certified v1.0](helm-chart-troubleshooting.md#images-are-certified-v10) | Checks that the images referenced by the Helm chart are Red Hat-certified. | +| [helm-lint v1.0](helm-chart-troubleshooting.md#helm-lint-v10) | [helm-lint v1.0](helm-chart-troubleshooting.md#helm-lint-v10) | [helm-lint v1.0](helm-chart-troubleshooting.md#helm-lint-v10) | [helm-lint v1.0](helm-chart-troubleshooting.md#helm-lint-v10) | Checks that the chart is well formed by running the `helm lint` command. | +| [chart-testing v1.0](helm-chart-troubleshooting.md#chart-testing-v10) | [chart-testing v1.0](helm-chart-troubleshooting.md#chart-testing-v10) | [chart-testing v1.0](helm-chart-troubleshooting.md#chart-testing-v10) | [chart-testing v1.0](helm-chart-troubleshooting.md#chart-testing-v10) | Installs the chart and verifies it on a Red Hat OpenShift Container Platform cluster. | +| [contains-values v1.0](helm-chart-troubleshooting.md#contains-values-v10) | [contains-values v1.0](helm-chart-troubleshooting.md#contains-values-v10) | [contains-values v1.0](helm-chart-troubleshooting.md#contains-values-v10) | [contains-values v1.0](helm-chart-troubleshooting.md#contains-values-v10) | Checks that the Helm chart contains the `values`[¹](https://github.com/redhat-certification/chart-verifier/blob/main/docs/helm-chart-checks.md#-for-more-information-on-the-values-file-see-values-and-best-practices-for-using-values) file. | +| [required-annotations-present v1.0](helm-chart-troubleshooting.md#required-annotations-present-v10) | [required-annotations-present v1.0](helm-chart-troubleshooting.md#required-annotations-present-v10) | [required-annotations-present v1.0](helm-chart-troubleshooting.md#required-annotations-present-v10) | - | Checks that the Helm chart contains the annotation: ```charts.openshift.io/name```. | +| [signature-is-valid v1.0](helm-chart-troubleshooting.md#signature-is-valid-v10) | [signature-is-valid v1.0](helm-chart-troubleshooting.md#signature-is-valid-v10) | - | - | Verifies a signed chart based on a provided public key. | +| [has-notes v1.0](helm-chart-troubleshooting.md#has-notes-v10) | - | - | - | Checks that the Helm chart contains the `NOTES.txt` file in the templates directory. | # ###### ¹ For more information on the `values` file, see [`values`](https://helm.sh/docs/chart_template_guide/values_files/) and [Best Practices for using values](https://helm.sh/docs/chart_best_practices/values/). @@ -300,7 +301,15 @@ A profile defines a set of checks to run and an indication of whether each check - The default is the same as the partner profile and is used if a specific one is not specified. - All checks are mandatory. -Each profile also has a version and currently there are three profile versions: v1.0, v1.1 and v1.2. The `developer-console` just has one profile version v1.0. +Each profile also has a version and currently there are four profile versions: v1.0, v1.1, v1.2, and v1.3. The `developer-console` just has one profile version v1.0. + +### Profile v1.3 + +Compared to profile v1.2, adds a new check: + +| check | partner | RedHat | community | default | +|-------|---------|--------|-----------|--------- +| [has-notes v1.0](helm-chart-troubleshooting.md#has-notes-v10) | optional | optional | optional | optional ### Profile v1.2 @@ -327,7 +336,7 @@ Annotations added to a v1.1 profile report are common to all profile types: part #### Checks -This table shows which checks are preformed and whether or not they ar mnandatory or optional for each profile type. +This table shows which checks are preformed and whether or not they are mandatory or optional for each profile type. | check | partner | RedHat | community | default | |-------|---------|--------|-----------|--------- diff --git a/docs/helm-chart-troubleshooting.md b/docs/helm-chart-troubleshooting.md index f9ceae41..9ac26fb8 100644 --- a/docs/helm-chart-troubleshooting.md +++ b/docs/helm-chart-troubleshooting.md @@ -175,6 +175,10 @@ This check requires that the public key provided to the chart verifier is from a - pgp public key file does not have access to the signed chart. - ensure the public key matches the secret key used to sign the chart. +### `has-notes` v1.0 + +Requires a "NOTES.txt" file to exist in the templates directory of the chart. Any other spelling or +capitialisation of letters will result in the check failing. ## Report related submission failures diff --git a/internal/chartverifier/checks/checks.go b/internal/chartverifier/checks/checks.go index 4fcf7c3b..3144fb04 100644 --- a/internal/chartverifier/checks/checks.go +++ b/internal/chartverifier/checks/checks.go @@ -107,6 +107,7 @@ func HasReadme(opts *CheckOptions) (Result, error) { for _, f := range c.Files { if f.Name == "README.md" { r.SetResult(true, ReadmeExist) + break } } @@ -123,6 +124,7 @@ func HasNotes(opts *CheckOptions) (Result, error) { for _, f := range c.Templates { if f.Name == "templates/NOTES.txt" { r.SetResult(true, NotesExist) + break } }