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

Add option=terminate for delete mcis #959

Merged
merged 1 commit into from
Nov 11, 2021

Conversation

seokho-son
Copy link
Member

fix #948

DELETE "http://localhost:1323/tumblebug/ns/ns01/mcis/mcis01?option=terminate"

@@ -1376,7 +1387,7 @@ func DelMcis(nsId string, mcisId string, option string) error {
}
}
// Check MCIS status is Terminated (not Partial)
if !(!strings.Contains(mcisStatus.Status, "Partial-") && (strings.Contains(mcisStatus.Status, StatusTerminated) || strings.Contains(mcisStatus.Status, StatusUndefined) || strings.Contains(mcisStatus.Status, StatusFailed))) {
if mcisStatus.Id != "" && !(!strings.Contains(mcisStatus.Status, "Partial-") && (strings.Contains(mcisStatus.Status, StatusTerminated) || strings.Contains(mcisStatus.Status, StatusUndefined) || strings.Contains(mcisStatus.Status, StatusFailed))) {
Copy link
Member Author

Choose a reason for hiding this comment

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

아주 드물게 (spider가 중간에 죽는다거나 하는 상황) , mcis 정보에 오류가 포함되어 mcisStatus.Id 가 비어 있는 경우가 있습니다. 이 경우에는 force delete 로 처리되도록 안전옵션을 추가하였습니다.

// fmt.Printf("\n\n[Info] Sleep for 5 seconds for safe MCIS-VMs termination.\n\n")
// time.Sleep(5 * time.Second)
// with terminate option, do MCIS refine and terminate in advance
if strings.EqualFold(option, ActionTerminate) {
Copy link
Member Author

Choose a reason for hiding this comment

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

case in-sensitive 비교 방식 입니다. 사용자 입력을 string으로 받으니, 대소문자를 항상 처리해야 하니 좀 귀찮긴하네요.ㅎ

@jihoon-seo jihoon-seo merged commit 1131945 into cloud-barista:main Nov 11, 2021
@jihoon-seo jihoon-seo mentioned this pull request Nov 26, 2021
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.

Add new option for MCIS delete working with refine and terminate
2 participants