rancher / charts-build-scripts

Apache License 2.0
9 stars 31 forks source link

failed to parse the Chart.yaml file when there are multiple line comments #33

Closed jiaqiluo closed 2 years ago

jiaqiluo commented 3 years ago
./bin/charts-build-scripts --version                             
charts-build-scripts version v0.0.4 (567c991)

When there are multiple-line comments in the Chart.yaml file of the dependencies chart, like the following

apiVersion: v2
name: sachet
description: Sachet is an SMS alerting tool for the Prometheus Alertmanager
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: 0.2.3

Running the make prepare on the main chart will fail with the following error

> PACKAGE=rancher-alerting-driver make prepare
...
FATA[0001] Encountered error while preparing main chart: Encountered error while trying to prepare dependencies in charts: error unpacking sachet in rancher-alerting-driver: cannot load Chart.yaml: error converting YAML to JSON: yaml: line 19: could not find expected ':' 
make: *** [prepare] Error 1
aiyengar2 commented 3 years ago

Seems like a similar root cause to https://github.com/rancher/charts-build-scripts/issues/36.