Skip to content

Commit ae1b87c

Browse files
committed
CLOUDSTACK-7308: add tags to all security group rules
1 parent b55c114 commit ae1b87c

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎server/src/com/cloud/api/query/dao/SecurityGroupJoinDaoImpl.java‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,16 @@ public SecurityGroupResponse setSecurityGroupResponse(SecurityGroupResponse vsgD
172172
ruleData.setCidr(vsg.getRuleAllowedSourceIpCidr());
173173
}
174174

175+
// add the tags to the rule data
176+
List<ResourceTagJoinVO> tags = _resourceTagJoinDao.listBy(vsg.getRuleUuid(), ResourceTag.ResourceObjectType.SecurityGroupRule);
177+
Set<ResourceTagResponse> tagResponse = new HashSet<ResourceTagResponse>();
178+
for (ResourceTagJoinVO tag: tags) {
179+
tagResponse.add(ApiDBUtils.newResourceTagResponse(tag, false));
180+
}
181+
182+
// add the tags to the rule data
183+
ruleData.setTags(tagResponse);
184+
175185
if (vsg.getRuleType() == SecurityRuleType.IngressRule) {
176186
ruleData.setObjectName("ingressrule");
177187
vsgData.addSecurityGroupIngressRule(ruleData);

0 commit comments

Comments
 (0)