From 2d022ba88cd9d72ccd152101e4677c803a556d10 Mon Sep 17 00:00:00 2001 From: Andrei Pavlov Date: Mon, 7 Oct 2024 11:51:23 +0700 Subject: [PATCH] Update templates generation to support multiple versions Signed-off-by: Andrei Pavlov --- hack/templates.sh | 5 +++-- .../{aws-hosted-cp.yaml => aws-hosted-cp-0-0-1.yaml} | 0 .../{aws-standalone-cp.yaml => aws-standalone-cp-0-0-1.yaml} | 0 .../{azure-hosted-cp.yaml => azure-hosted-cp-0-0-1.yaml} | 0 ...ure-standalone-cp.yaml => azure-standalone-cp-0-0-1.yaml} | 0 .../{ingress-nginx.yaml => ingress-nginx-4-11-0.yaml} | 0 .../files/templates/{kyverno.yaml => kyverno-3-2-6.yaml} | 0 .../{vsphere-hosted-cp.yaml => vsphere-hosted-cp-0-0-1.yaml} | 0 ...e-standalone-cp.yaml => vsphere-standalone-cp-0-0-1.yaml} | 0 9 files changed, 3 insertions(+), 2 deletions(-) rename templates/provider/hmc-templates/files/templates/{aws-hosted-cp.yaml => aws-hosted-cp-0-0-1.yaml} (100%) rename templates/provider/hmc-templates/files/templates/{aws-standalone-cp.yaml => aws-standalone-cp-0-0-1.yaml} (100%) rename templates/provider/hmc-templates/files/templates/{azure-hosted-cp.yaml => azure-hosted-cp-0-0-1.yaml} (100%) rename templates/provider/hmc-templates/files/templates/{azure-standalone-cp.yaml => azure-standalone-cp-0-0-1.yaml} (100%) rename templates/provider/hmc-templates/files/templates/{ingress-nginx.yaml => ingress-nginx-4-11-0.yaml} (100%) rename templates/provider/hmc-templates/files/templates/{kyverno.yaml => kyverno-3-2-6.yaml} (100%) rename templates/provider/hmc-templates/files/templates/{vsphere-hosted-cp.yaml => vsphere-hosted-cp-0-0-1.yaml} (100%) rename templates/provider/hmc-templates/files/templates/{vsphere-standalone-cp.yaml => vsphere-standalone-cp-0-0-1.yaml} (100%) diff --git a/hack/templates.sh b/hack/templates.sh index 44f0e4592..e1fa62301 100755 --- a/hack/templates.sh +++ b/hack/templates.sh @@ -34,12 +34,13 @@ for type in "$TEMPLATES_DIR"/*; do if [ "$name" = "$HMC_TEMPLATES_CHART_NAME" ]; then continue; fi version=$(grep '^version:' $chart/Chart.yaml | awk '{print $2}') template_name=$name-$(echo "$version" | sed 's/^v//; s/\./-/g') + if [ "$kind" = "ProviderTemplate" ]; then file_name=$name; else file_name=$template_name; fi - cat < $TEMPLATES_OUTPUT_DIR/$name.yaml + cat < $TEMPLATES_OUTPUT_DIR/$file_name.yaml apiVersion: hmc.mirantis.com/v1alpha1 kind: $kind EOF - cat <> $TEMPLATES_OUTPUT_DIR/$name.yaml + cat <> $TEMPLATES_OUTPUT_DIR/$file_name.yaml metadata: name: $template_name annotations: diff --git a/templates/provider/hmc-templates/files/templates/aws-hosted-cp.yaml b/templates/provider/hmc-templates/files/templates/aws-hosted-cp-0-0-1.yaml similarity index 100% rename from templates/provider/hmc-templates/files/templates/aws-hosted-cp.yaml rename to templates/provider/hmc-templates/files/templates/aws-hosted-cp-0-0-1.yaml diff --git a/templates/provider/hmc-templates/files/templates/aws-standalone-cp.yaml b/templates/provider/hmc-templates/files/templates/aws-standalone-cp-0-0-1.yaml similarity index 100% rename from templates/provider/hmc-templates/files/templates/aws-standalone-cp.yaml rename to templates/provider/hmc-templates/files/templates/aws-standalone-cp-0-0-1.yaml diff --git a/templates/provider/hmc-templates/files/templates/azure-hosted-cp.yaml b/templates/provider/hmc-templates/files/templates/azure-hosted-cp-0-0-1.yaml similarity index 100% rename from templates/provider/hmc-templates/files/templates/azure-hosted-cp.yaml rename to templates/provider/hmc-templates/files/templates/azure-hosted-cp-0-0-1.yaml diff --git a/templates/provider/hmc-templates/files/templates/azure-standalone-cp.yaml b/templates/provider/hmc-templates/files/templates/azure-standalone-cp-0-0-1.yaml similarity index 100% rename from templates/provider/hmc-templates/files/templates/azure-standalone-cp.yaml rename to templates/provider/hmc-templates/files/templates/azure-standalone-cp-0-0-1.yaml diff --git a/templates/provider/hmc-templates/files/templates/ingress-nginx.yaml b/templates/provider/hmc-templates/files/templates/ingress-nginx-4-11-0.yaml similarity index 100% rename from templates/provider/hmc-templates/files/templates/ingress-nginx.yaml rename to templates/provider/hmc-templates/files/templates/ingress-nginx-4-11-0.yaml diff --git a/templates/provider/hmc-templates/files/templates/kyverno.yaml b/templates/provider/hmc-templates/files/templates/kyverno-3-2-6.yaml similarity index 100% rename from templates/provider/hmc-templates/files/templates/kyverno.yaml rename to templates/provider/hmc-templates/files/templates/kyverno-3-2-6.yaml diff --git a/templates/provider/hmc-templates/files/templates/vsphere-hosted-cp.yaml b/templates/provider/hmc-templates/files/templates/vsphere-hosted-cp-0-0-1.yaml similarity index 100% rename from templates/provider/hmc-templates/files/templates/vsphere-hosted-cp.yaml rename to templates/provider/hmc-templates/files/templates/vsphere-hosted-cp-0-0-1.yaml diff --git a/templates/provider/hmc-templates/files/templates/vsphere-standalone-cp.yaml b/templates/provider/hmc-templates/files/templates/vsphere-standalone-cp-0-0-1.yaml similarity index 100% rename from templates/provider/hmc-templates/files/templates/vsphere-standalone-cp.yaml rename to templates/provider/hmc-templates/files/templates/vsphere-standalone-cp-0-0-1.yaml