From c17f9ca662772a204a8122ec970842649e4f7efe Mon Sep 17 00:00:00 2001 From: Jim Gauld Date: Sun, 10 May 2020 23:22:17 -0400 Subject: [PATCH] Add support for Helm v3 This adds support for Helm v3. - 'helm init' and initialization is no longer required - 'chartmuseum' is used as a drop-in replacement for 'helm serv' - all Charts require the tag: apiVersion: v1 (or v2) Story: 2007000 Task: 39718 Depends-On: https://review.opendev.org/719962 Signed-off-by: Jim Gauld Change-Id: I605adb96a529100167f7a55bcdabf22f1ef58407 --- portieris-helm/centos/portieris-helm.spec | 25 +++---------------- .../centos/stx-portieris-helm.spec | 24 +++--------------- 2 files changed, 7 insertions(+), 42 deletions(-) diff --git a/portieris-helm/centos/portieris-helm.spec b/portieris-helm/centos/portieris-helm.spec index 78a5c86..55000ca 100644 --- a/portieris-helm/centos/portieris-helm.spec +++ b/portieris-helm/centos/portieris-helm.spec @@ -31,6 +31,7 @@ Source6: serverKey.pem BuildArch: noarch BuildRequires: helm +BuildRequires: chartmuseum %description StarlingX portieris charts @@ -39,30 +40,12 @@ StarlingX portieris charts %setup -n portieris %build -# initialize helm -# helm init --client-only does not work if there is no networking -# The following commands do essentially the same as: helm init -%define helm_home %{getenv:HOME}/.helm -mkdir %{helm_home} -mkdir %{helm_home}/repository -mkdir %{helm_home}/repository/cache -mkdir %{helm_home}/repository/local -mkdir %{helm_home}/plugins -mkdir %{helm_home}/starters -mkdir %{helm_home}/cache -mkdir %{helm_home}/cache/archive - -# Stage a repository file that only has a local repo -cp %{SOURCE1} %{helm_home}/repository/repositories.yaml - -# Stage a local repo index that can be updated by the build -cp %{SOURCE2} %{helm_home}/repository/local/index.yaml - # Host a server for the charts -helm serve --repo-path . & -helm repo rm local +chartmuseum --debug --port=8879 --context-path='/charts' --storage="local" --storage-local-rootdir="." & +sleep 2 helm repo add local http://localhost:8879/charts + # Create a chart tarball compliant with sysinv kube-app.py %define app_staging %{_builddir}/staging %define app_tarball portieris-%{version}.tgz diff --git a/stx-portieris-helm/centos/stx-portieris-helm.spec b/stx-portieris-helm/centos/stx-portieris-helm.spec index 3a89dce..af1078f 100644 --- a/stx-portieris-helm/centos/stx-portieris-helm.spec +++ b/stx-portieris-helm/centos/stx-portieris-helm.spec @@ -22,6 +22,7 @@ Source0: %{name}-%{version}.tar.gz BuildArch: noarch BuildRequires: helm +BuildRequires: chartmuseum BuildRequires: portieris-helm Requires: portieris-helm @@ -32,28 +33,9 @@ StarlingX Portieris Armada Helm Charts %setup %build -# initialize helm and build the toolkit -# helm init --client-only does not work if there is no networking -# The following commands do essentially the same as: helm init -%define helm_home %{getenv:HOME}/.helm -mkdir %{helm_home} -mkdir %{helm_home}/repository -mkdir %{helm_home}/repository/cache -mkdir %{helm_home}/repository/local -mkdir %{helm_home}/plugins -mkdir %{helm_home}/starters -mkdir %{helm_home}/cache -mkdir %{helm_home}/cache/archive - -# Stage a repository file that only has a local repo -cp files/repositories.yaml %{helm_home}/repository/repositories.yaml - -# Stage a local repo index that can be updated by the build -cp files/index.yaml %{helm_home}/repository/local/index.yaml - # Host a server for the charts -helm serve --repo-path . & -helm repo rm local +chartmuseum --debug --port=8879 --context-path='/charts' --storage="local" --storage-local-rootdir="." & +sleep 2 helm repo add local http://localhost:8879/charts # terminate helm server (the last backgrounded task)