Skip to content

Commit

Permalink
Add flexibility to allow additional SecurityGroups to be attached fro…
Browse files Browse the repository at this point in the history
…m other sources
  • Loading branch information
powerkimhub committed May 3, 2024
1 parent 53be17a commit 75f73c0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions api-runtime/common-runtime/VMManager.go
Original file line number Diff line number Diff line change
Expand Up @@ -1154,11 +1154,16 @@ func getSetNameId(ConnectionName string, vmInfo *cres.VMInfo) error {
err := infostore.GetByConditionsAndContain(&iidInfo, CONNECTION_NAME_COLUMN, ConnectionName,
OWNER_VPC_NAME_COLUMN, vmInfo.VpcIID.NameId, SYSTEM_ID_COLUMN, getMSShortID(sgIID.SystemId))
if err != nil {
cblog.Error(err)
return err
// Additional SecurityGroups may be attached from other sources.
cblog.Info(err)
continue
}
vmInfo.SecurityGroupIIds[i].NameId = iidInfo.NameId
}
if len(vmInfo.SecurityGroupIIds) < 1 {
cblog.Infof("%s: SecurityGroupIIds is empty", vmInfo.IId.NameId)
return fmt.Errorf("%s: SecurityGroupIIds is empty", vmInfo.IId.NameId)
}

if vmInfo.KeyPairIId.SystemId != "" {
// set KeyPair NameId
Expand Down

0 comments on commit 75f73c0

Please sign in to comment.