Shorten version strings

This fixes the following issue in which the unique version created for a
git repo chart results in a name that is too long for kubernetes.

  Invalid value:
  "provisioner-3.0.0_source.ffc0607e10d59e4240e838af27fb821bce8f3653d340c7353df63653603b54f5":
  must be no more than 63 characters

Change-Id: I81032ffdd16a0de8faa51cfc3e218d066e9cc711
This commit is contained in:
Ian Howell 2020-07-06 12:48:07 -05:00
parent 116eb2cc93
commit f90d7cd20d

View File

@ -18,7 +18,7 @@
cmd: |
sha=$(sha256sum <<< "{{ chart | to_json }}" | cut -f1 -d' ')
version=$(helm show chart /tmp/{{ chart['name'] | quote }}/{{ chart['path'] | quote }} | yq -r .version)
printf "%s+source.%s" "$version" "$sha"
printf "%s+source.%s" "$version" "$sha" | cut -c 1-63
register: chart_version
- name: package charts into /charts directory