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 mc-infra scaleout error #1872

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/core/infra/provisioning.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ func CreateMciGroupVm(nsId string, mciId string, vmRequest *model.TbVmReq, newSu
}
vmInfoData.ResourceType = model.StrVM
vmInfoData.Id = vmInfoData.Name
vmInfoData.Uid = common.GenUid()

vmInfoData.Description = vmRequest.Description
vmInfoData.PublicIP = "empty"
Expand Down Expand Up @@ -1531,7 +1532,7 @@ func CreateVm(nsId string, mciId string, vmInfoData *model.TbVmInfo, option stri
_, err = SetBastionNodes(nsId, mciId, vmInfoData.Id, "")
if err != nil {
// just log error and continue
log.Info().Err(err).Msg("")
log.Debug().Err(err).Msg("")
}

return nil
Expand Down
6 changes: 3 additions & 3 deletions src/core/resource/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,15 +395,15 @@ func GetSpec(nsId string, specKey string) (model.TbSpecInfo, error) {

// ex: img-487zeit5
spec = model.TbSpecInfo{Namespace: nsId, CspSpecName: specKey}
has, err = model.ORM.Where("LOWER(Namespace) = ? AND LOWER(CspResourceName) = ?", nsId, specKey).Get(&spec)
has, err = model.ORM.Where("LOWER(Namespace) = ? AND LOWER(CspSpecName) = ?", nsId, specKey).Get(&spec)
if err != nil {
log.Info().Err(err).Msgf("Failed to get spec %s by CspResourceName", specKey)
log.Info().Err(err).Msgf("Failed to get spec %s by CspSpecName", specKey)
}
if has {
return spec, nil
}

return model.TbSpecInfo{}, fmt.Errorf("The specKey %s not found by any of ID, CspResourceName", specKey)
return model.TbSpecInfo{}, fmt.Errorf("The specKey %s not found by any of ID, CspSpecName", specKey)
}

// FilterSpecsByRange accepts criteria ranges for filtering, and returns the list of filtered TB spec objects
Expand Down