Brettins
Brettins

Reputation: 952

Error: unknown command "chart" for "helm" on github actions

My CI deployments in github actions for helm/kubernetes have started failing with the following error:

Error: unknown command "chart" for "helm" on github actions

In my CI.yaml file, I have the following helm commands:


echo *****************
echo SAVING HELM CHART
echo *****************
# log in to aws and push the helm chart
aws ecr get-login-password --region us-west-2 | helm registry login --username AWS --password-stdin XXXX.amazonaws.com
helm chart save ./server-helm-chart/ XXXXX.amazonaws.com/test/helm:$helmChartVersion
echo *****************
echo PUSHING HELM CHART
echo *****************
helm chart push XXXX.amazonaws.com/test/helm:$helmChartVersion

Upvotes: 6

Views: 10061

Answers (1)

Brettins
Brettins

Reputation: 952

Helm has removed the chart functions, so they are now replaced by push and package.

enter image description here

These changes are listed here: https://github.com/helm/helm/releases/tag/v3.7.0

So I needed to rename my Chart.yaml to match the AWS registry name, and then my code became:

echo *****************
echo SAVING HELM CHART
echo *****************
# log in to aws and push the helm chart
# aws ecr get-login-password --region us-west-2 | helm registry login --username AWS --password-stdin XXXX.amazonaws.com
# export CHART_FILE=`helm package ./server-helm-chart/ | awk -F'[:]' '{gsub(/ /, "", $2); print $2}'`
echo *****************
echo PUSHING HELM CHART
echo *****************
# helm push $CHART_FILE oci://XXXX.dkr.ecr.us-west-2.amazonaws.com/staging/helm:$helmChartVersion

Upvotes: 15

Related Questions