Mastering-the-Marketplace icon indicating copy to clipboard operation
Mastering-the-Marketplace copied to clipboard

Poor error output when unable to validate Helm chart using cpa verify

Open davidnmbond opened this issue 1 year ago • 1 comments

The Helm chart is valid, and works fine with.

helm install --generate-name --dry-run --debug .

However, cpa verify is giving the following error output, which is unhelpful in figuring out where to go next. This is a blocker for us to publish to the Marketplace and risks us losing our partner status:

cpa verify
CPA Version:  1.3.22
By using the Azure Kubernetes CNAB Packaging Application, you agree to the License contained in the application. You can view the License at ~/LICENSE.
We collect telemetry data, if you would like to opt out of data collection please use the --telemetryOptOut flag.
Correlation Id: cb10c8e7-c344-4403-adb7-058339350909
Manifest file validated, 0 total failure(s)

Manifest verification successful.
Helm chart validated, 1 total failure(s)

  magicsuite-agent-cnabbundle:Invalid type. Expected: [array,null], given: object
2024/10/11 14:18:48
Correlation Id: cb10c8e7-c344-4403-adb7-058339350909, CPABuild: 1.3.22
2024/10/11 14:18:48 magicsuite-agent-cnabbundle:Invalid type. Expected: [array,null], given: object
2024/10/11 14:18:48
For more info refer to the documentation here: https://aka.ms/K8sOfferHelmChart
Marketplace package validated, 0 total failures(s)

2024/10/11 14:18:53 Verification of the helm chart and ARM templates failed.

davidnmbond avatar Oct 11 '24 14:10 davidnmbond

For anyone suffering the same issue, this turned out to be a problem in a deployments.yaml file, where environment variables had been incorrectly specified as:

        env:
            Agents__0__ApiUrl: "{{ .Values.apiUrl }}"

...instead of...

        env:
            - name: Agents__0__ApiUrl
              value: "{{ .Values.apiUrl }}"

The issue remains however - the tool should perform better input validation and provide clearer indication of the file (and preferably section) that is causing the issue.

davidnmbond avatar Oct 11 '24 17:10 davidnmbond