Skip to content

Commit

Permalink
Fix mc-infra scaleout error
Browse files Browse the repository at this point in the history
  • Loading branch information
cb-github-robot authored Oct 22, 2024
2 parents deefda9 + 142711d commit e69ac01
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
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

0 comments on commit e69ac01

Please sign in to comment.