Skip to content

Commit

Permalink
Merge pull request #114 from openinfradev/cluster_template
Browse files Browse the repository at this point in the history
Cluster template 지원 및 contract/cluster Git 저장소에 META 정보 추가
  • Loading branch information
zugwan authored Sep 29, 2022
2 parents 80eb758 + a0cccde commit 2da08ed
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions github_repo/create-cluster-repo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -37,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
Expand Down Expand Up @@ -81,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 "[email protected]"
Expand Down Expand Up @@ -123,7 +126,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:
Expand Down
2 changes: 2 additions & 0 deletions github_repo/create-contract-repo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions tks-cluster/create-usercluster-wftpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 2da08ed

Please sign in to comment.