Skip to content

Commit a566af3

Browse files
committed
Review comment on pull request #12436
1 parent 507c4cd commit a566af3

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

pull/12436

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
Thanks for the changes — overall these look reasonable, but I have a few comments and suggestions:
2+
3+
1) Bug in DeployVnfAppliance.vue
4+
- The new check uses .filter(...) in a boolean context:
5+
(this.vnfNicNetworks[deviceId].service.filter(svc => svc.name === 'SecurityGroupProvider'))
6+
- In JavaScript, an array (including an empty array) is truthy, so this condition will always evaluate to true even when there are no matching services. This is likely a functional bug.
7+
- Suggested fix: use .some or check length:
8+
this.vnfNicNetworks[deviceId].service && this.vnfNicNetworks[deviceId].service.some(svc => svc.name === 'SecurityGroupProvider')
9+
or
10+
Array.isArray(this.vnfNicNetworks[deviceId].service) && this.vnfNicNetworks[deviceId].service.filter(...).length > 0
11+
12+
2) Expanded details in network.js and VnfAppliancesTab.vue — performance and consistency
13+
- You expanded the API "details" from 'servoff,tmpl,nics' to 'group,nics,secgrp,tmpl,servoff,diskoff,iso,volume,affgrp,backoff'. That will return many more fields and could affect performance (more data transferred / processed). Please confirm all newly requested details are required for the UI use-cases in these views.
14+
- Also note an inconsistency in parameter casing:
15+
- ui/src/config/section/network.js uses isvnf: true (lowercase 'v')
16+
- ui/src/views/network/VnfAppliancesTab.vue uses isVnf: true (camelCase)
17+
Verify which exact param the backend expects (case-sensitive). Recommend standardizing to the correct form across files.
18+
19+
3) Logic change in DeployVnfAppliance.vue — intent clarification
20+
- Previously the code checked zone.securitygroupsenabled for Shared networks. The new code checks whether the network has the SecurityGroupProvider service. Please confirm this is the intended semantic change (i.e., switching from a zone-level setting to checking per-network provider capability). If both checks are relevant, combine them appropriately.
21+
22+
4) Localization text change
23+
- The new label "Configure network rules for VNF's management interfaces" is fine and shorter. Minor nit: consider removing the possessive and using "Configure network rules for VNF management interfaces" to match other labels' style, but this is optional.
24+
25+
5) Safety / defensive coding
26+
- In places where you access this.vnfNicNetworks[deviceId].service, add defensive checks (Array.isArray(...)) before calling array methods to avoid runtime errors if service is undefined.
27+
28+
6) Testing suggestions
29+
- Please test deploy flows in zones/networks:
30+
- Shared network with SecurityGroupProvider present
31+
- Shared network without SecurityGroupProvider
32+
- Isolated networks and VPC cases
33+
- Confirm that expanding "details" doesn't degrade list performance in views that call the API frequently.
34+
35+
If you'd like, I can re-run these checks or suggest a patch for the .some change. Thanks!

0 commit comments

Comments
 (0)