mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
security group name fix
This commit is contained in:
@@ -271,11 +271,14 @@ func (self *SRegion) GetSecurityGroupDetails(secGroupId string) (*SSecurityGroup
|
||||
|
||||
permissions := self.getSecRules(s.IpPermissions, s.IpPermissionsEgress)
|
||||
|
||||
tagspec := TagSpec{ResourceType: "scuritygroup"}
|
||||
tagspec.LoadingEc2Tags(s.Tags)
|
||||
|
||||
return &SSecurityGroup{
|
||||
vpc: vpc,
|
||||
Description: *s.Description,
|
||||
SecurityGroupId: *s.GroupId,
|
||||
SecurityGroupName: *s.GroupName,
|
||||
SecurityGroupName: tagspec.GetNameTag(),
|
||||
VpcId: *s.VpcId,
|
||||
Permissions: permissions,
|
||||
RegionId: self.RegionId,
|
||||
@@ -442,12 +445,15 @@ func (self *SRegion) GetSecurityGroups(vpcId string, secgroupIdTag string, offse
|
||||
continue
|
||||
}
|
||||
|
||||
tagspec := TagSpec{ResourceType: "scuritygroup"}
|
||||
tagspec.LoadingEc2Tags(item.Tags)
|
||||
|
||||
permissions := self.getSecRules(item.IpPermissions, item.IpPermissionsEgress)
|
||||
group := SSecurityGroup{
|
||||
vpc: vpc,
|
||||
Description: *item.Description,
|
||||
SecurityGroupId: *item.GroupId,
|
||||
SecurityGroupName: *item.GroupName,
|
||||
SecurityGroupName: tagspec.GetNameTag(),
|
||||
VpcId: *item.VpcId,
|
||||
Permissions: permissions,
|
||||
RegionId: self.RegionId,
|
||||
|
||||
@@ -226,7 +226,7 @@ func yunionPortRangeToAws(r secrules.SecurityRule) []portRange {
|
||||
portranges = append(portranges, portRange{int64(start), int64(end)})
|
||||
}
|
||||
|
||||
for i, _ := range r.Ports {
|
||||
for i := range r.Ports {
|
||||
port := r.Ports[i]
|
||||
if port <= 0 && (r.Protocol == "tcp" || r.Protocol == "udp") {
|
||||
portranges = append(portranges, portRange{0, 65535})
|
||||
@@ -323,7 +323,7 @@ func YunionSecRuleToAws(rule secrules.SecurityRule) ([]*ec2.IpPermission, error)
|
||||
portranges := yunionPortRangeToAws(rule)
|
||||
protocol := yunionProtocolToAws(rule)
|
||||
permissions := []*ec2.IpPermission{}
|
||||
for i, _ := range portranges {
|
||||
for i := range portranges {
|
||||
port := portranges[i]
|
||||
permission := ec2.IpPermission{
|
||||
FromPort: &port.Start,
|
||||
|
||||
Reference in New Issue
Block a user