From f26ff3480a7833eb4dc51929f2dd207c4a4aeb6e Mon Sep 17 00:00:00 2001 From: Jugwan Eom Date: Wed, 28 Sep 2022 04:21:07 +0000 Subject: [PATCH 1/2] use template_name parameter as intended --- github_repo/create-cluster-repo.yaml | 4 +--- tks-cluster/create-usercluster-wftpl.yaml | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/github_repo/create-cluster-repo.yaml b/github_repo/create-cluster-repo.yaml index 92e68d4d..e0508264 100644 --- a/github_repo/create-cluster-repo.yaml +++ b/github_repo/create-cluster-repo.yaml @@ -12,8 +12,6 @@ spec: - name: cluster_id value: "cluster_uuid" - name: template_name - value: "template-std" - - name: test_template_name value: "aws-reference" templates: @@ -123,7 +121,7 @@ spec: - name: CLUSTER_ID value: "{{workflow.parameters.cluster_id}}" - name: TEMPLATE_NAME - value: "{{workflow.parameters.test_template_name}}" + value: "{{workflow.parameters.template_name}}" - name: CLUSTER_INFO value: "{{inputs.parameters.cluster_info}}" volumeMounts: diff --git a/tks-cluster/create-usercluster-wftpl.yaml b/tks-cluster/create-usercluster-wftpl.yaml index deb5e888..be9ca1b6 100644 --- a/tks-cluster/create-usercluster-wftpl.yaml +++ b/tks-cluster/create-usercluster-wftpl.yaml @@ -14,8 +14,6 @@ spec: - name: site_name value: "{{ workflow.parameters.cluster_id }}" - name: template_name - value: "template-std" - - name: test_template_name value: "aws-reference" - name: git_account value: "tks-management" From a0cccdef3d21648cc1561dd36c138209cfe7f2e4 Mon Sep 17 00:00:00 2001 From: Jugwan Eom Date: Wed, 28 Sep 2022 04:22:49 +0000 Subject: [PATCH 2/2] maintain origin repo's revision and commit id --- github_repo/create-cluster-repo.yaml | 5 +++++ github_repo/create-contract-repo.yaml | 2 ++ 2 files changed, 7 insertions(+) diff --git a/github_repo/create-cluster-repo.yaml b/github_repo/create-cluster-repo.yaml index e0508264..433c435a 100644 --- a/github_repo/create-cluster-repo.yaml +++ b/github_repo/create-cluster-repo.yaml @@ -35,6 +35,10 @@ spec: git clone https://$(echo -n $TOKEN)@github.com/${USERNAME}/${CONTRACT_ID}.git + cd ${CONTRACT_ID} + CONTRACT_COMMIT_ID=$(git rev-parse HEAD) + cd .. + # Get cluster-api infra provider in the template INFRA_PROVIDER="$(cat ${CONTRACT_ID}/$TEMPLATE_NAME/tks-cluster/kustomization.yaml | grep /infra/ | awk -F \/ '{print $3}')" echo ${INFRA_PROVIDER} | tee /mnt/out/infra_provider.txt @@ -79,6 +83,7 @@ spec: esac echo "Contract ID: "${CONTRACT_ID} > ${CLUSTER_ID}/META + echo "Contract Repo Commit: "${CONTRACT_COMMIT_ID} >> ${CLUSTER_ID}/META echo "Template Name: "${TEMPLATE_NAME} >> ${CLUSTER_ID}/META git config --global user.email "taco_support@sk.com" diff --git a/github_repo/create-contract-repo.yaml b/github_repo/create-contract-repo.yaml index 0e2b102d..0bd9f2a7 100644 --- a/github_repo/create-contract-repo.yaml +++ b/github_repo/create-contract-repo.yaml @@ -37,6 +37,8 @@ spec: git clone -b ${REVISION} https://github.com/openinfradev/decapod-site cd decapod-site + echo "Decapod Site Repo Revision: "${REVISION} > META + echo "Decapod Site Repo Commit: "$(git rev-parse HEAD) >> META mv .github _github