Skip to content

Commit

Permalink
Merge pull request #100 from Mirantis/fix-hmc-version
Browse files Browse the repository at this point in the history
Use version instead of appVersion in templates generator
  • Loading branch information
Kshatrix authored Jul 17, 2024
2 parents 3155ed1 + 685f033 commit 08522e3
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 11 deletions.
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,17 @@ hmc-chart-generate: kustomize helmify yq ## Generate hmc helm chart
$(KUSTOMIZE) build config/default | $(HELMIFY) templates/hmc
$(YQ) eval -iN '' templates/hmc/values.yaml config/default/hmc_values.yaml

.PHONY: set-hmc-version
set-hmc-version:
$(YQ) eval '.version = "$(VERSION)"' -i templates/hmc/Chart.yaml
$(YQ) eval '.version = "$(VERSION)"' -i templates/hmc-templates/Chart.yaml

.PHONY: hmc-chart-release
hmc-chart-release: kustomize helmify yq ## Generate hmc helm chart
hmc-chart-release: kustomize helmify yq set-hmc-version templates-generate ## Generate hmc helm chart
rm -rf templates/hmc/values.yaml templates/hmc/templates/*.yaml
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
$(KUSTOMIZE) build config/default | $(HELMIFY) templates/hmc
$(YQ) eval -iN '' templates/hmc/values.yaml config/default/hmc_values.yaml
$(YQ) eval '.version = "$(VERSION)"' -i templates/hmc/Chart.yaml
$(YQ) eval '.version = "$(VERSION)"' -i templates/hmc-templates/Chart.yaml

.PHONY: hmc-dist-release
hmc-dist-release:
Expand Down
4 changes: 2 additions & 2 deletions hack/templates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ for chart in $TEMPLATES_DIR/*; do
if [ -d "$chart" ]; then
name=$(grep '^name:' $chart/Chart.yaml | awk '{print $2}')
if [ "$name" = "$HMC_TEMPLATES_CHART_NAME" ]; then continue; fi
appVersion=$(grep '^appVersion:' $chart/Chart.yaml | awk '{print $2}')
version=$(grep '^version:' $chart/Chart.yaml | awk '{print $2}')

cat <<EOF > $TEMPLATES_OUTPUT_DIR/$name.yaml
apiVersion: hmc.mirantis.com/v1alpha1
Expand All @@ -40,7 +40,7 @@ metadata:
spec:
helm:
chartName: $name
chartVersion: $appVersion
chartVersion: $version
EOF

echo "Generated $TEMPLATES_OUTPUT_DIR/$name.yaml"
Expand Down
2 changes: 1 addition & 1 deletion templates/hmc-templates/files/templates/aws-hosted-cp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ metadata:
spec:
helm:
chartName: aws-hosted-cp
chartVersion: "0.1.0"
chartVersion: 0.1.0
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ metadata:
spec:
helm:
chartName: aws-standalone-cp
chartVersion: "0.1.0"
chartVersion: 0.1.0
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ metadata:
spec:
helm:
chartName: cluster-api-provider-aws
chartVersion: "0.1.0"
chartVersion: 0.1.0
2 changes: 1 addition & 1 deletion templates/hmc-templates/files/templates/cluster-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ metadata:
spec:
helm:
chartName: cluster-api
chartVersion: "0.1.0"
chartVersion: 0.1.0
2 changes: 1 addition & 1 deletion templates/hmc-templates/files/templates/hmc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ metadata:
spec:
helm:
chartName: hmc
chartVersion: "0.1.0"
chartVersion: 0.1.0
2 changes: 1 addition & 1 deletion templates/hmc-templates/files/templates/k0smotron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ metadata:
spec:
helm:
chartName: k0smotron
chartVersion: "0.1.0"
chartVersion: 0.1.0

0 comments on commit 08522e3

Please sign in to comment.