Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix. refactor create user-cluster #19

Merged
merged 3 commits into from
Jan 3, 2022

Conversation

ktkfree
Copy link
Contributor

@ktkfree ktkfree commented Dec 16, 2021

create usercluster 를 위한 I/F 를 변경합니다.
. AS-IS : create-tks-usercluster
. TO-BE : create-tks-usercluster-refactor

@ktkfree ktkfree requested a review from robertchoi80 December 16, 2021 05:26
revision := "main"
tks_admin := "tks-admin"
app_name := "tks-cluster"
manifestRepoUrl := "https://github.com/tks-management/" + clusterId + "-manifests"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기서 git token 값 붙여서 전달해야 하지 않나요??

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그러고보니 https://github.com/openinfradev/tks-cluster-lcm/blob/main/cmd/server/handlers.go#L370 에서도 site_repo_url 에만 token을 붙여주네요. manifest 쪽도 private repo인데 왜 필요가 없던 걸까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

엇 제가 이 이슈를 놓쳤었네요.

manifestRepoUrl 은 argocd 의 명령에 들어가는 parameter 일 뿐이므로 gittoken 이 없어도 되는 것 같고,
./argocd app create $ARGOCD_APP_NAME _**--repo $REPO**_ --revision $REVISION --path $SITE_NAME/$APP_GROUP/$PATH --dest-namespace $NAMESPACE --dest-name $TARGET_CLUSTER --project $APP_GROUP --label app=$ARGOCD_APP_LABEL --directory-recurse
site_repo_url 은 실제로 workflow instance 내에서 clone 등의 행위를 하기 때문인것 으로 보입니다.
repo = git.Repo.clone_from("{{inputs.parameters.**_site_repo_url_**}}", 'decapod-site')

gittoken 을 붙여 전달하는 것보다 gittoken 이 필요할 경우 gittoken 을 따로 전달받고, workflow 내에서 조합하여 사용하도록 workflow I/F 를 변경하는 것도 좋겠습니다.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

근데 argocd 도 실제로 app 배포시 manifest_repo_url 로부터 코드를 가져와 배포할 텐데 어떻게 토큰 없이 private repo로부터 가져오는지 궁금하네요

@robertchoi80 robertchoi80 merged commit 5bb3628 into main Jan 3, 2022
@robertchoi80 robertchoi80 deleted the feature/change_interface_for_cluster_creation branch January 3, 2022 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants