Copilot commented on code in PR #13156:
URL: https://github.com/apache/cloudstack/pull/13156#discussion_r3281285313


##########
ui/src/views/tools/ImportUnmanagedInstance.vue:
##########
@@ -724,14 +686,30 @@ export default {
         forced: this.switches.forced,
         forcemstoimportvmfiles: this.switches.forceMsToImportVmFiles,
         domainid: null,
-        account: null
+        accountid: null
       })

Review Comment:
   `initForm()` initializes `form.accountid`, but the submission path populates 
and forwards `account` (account name) to the API. This mismatch leaves an 
unused field in the form model and makes the code harder to reason about (and 
can lead to stale/incorrect resets). Consider removing `accountid` from the 
form model and relying exclusively on `owner.account`, or renaming/aligning 
fields consistently with the API parameter (`account`).



##########
ui/src/views/tools/ImportUnmanagedInstance.vue:
##########
@@ -315,8 +265,8 @@
                 <multi-network-selection
                   :items="nics"
                   :zoneId="cluster.zoneid"
-                  :domainid="form.domainid"
-                  :account="form.account"
+                  :domainid="this.owner.domainid"
+                  :accountid="this.owner.account"

Review Comment:
   `MultiNetworkSelection` declares props `domainid` and `account`, but this 
usage passes `:accountid`. As a result the component never receives the account 
filter and will not scope `listNetworks` by the selected owner 
(domain/account), which is a regression for admins selecting ownership.
   



##########
ui/src/views/tools/ImportUnmanagedInstance.vue:
##########
@@ -588,9 +539,20 @@ export default {
             showicon: true
           },
           field: 'templateid'
+        },
+        accounts: {
+          list: 'listAccounts',
+          isLoad: true,
+          options: {
+            domainid: this.domainid
+          },
+          field: 'accountid'

Review Comment:
   The newly added `accounts` fetch configuration uses `options: { domainid: 
this.domainid }`, but `domainid` is not defined anywhere in this component. 
This will send an undefined domain filter and (because `fetchOptions` forces 
`listall=true`) can trigger an unscoped `listAccounts` call, which is 
potentially very expensive on large deployments.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to