Resource fetching missing projectid: "-1" parameter

Aperta Adatta ai principianti
#14,070 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
88/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript
Ambito
frontend

Direzione di ricerca

Inizia in ui/src/components/view/VolumesTab.vue, nel metodo getVolumes e nella relativa chiamata API listVolumes. Verifica che la richiesta includa projectid: "-1", quindi riproduci lo scenario di project-scope indicato e conferma che la scheda Volumes dell'istanza visualizzi i relativi volumi nella vista predefinita.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug component:projects component:UI
problem

When viewing a resource, for example an instance, that is currently in a project that differs from the currently selected or global project scope, it will attempt to fetch volumes yet none will return as it is only filtering on the ones that are owned by this user (not the project user).

Image
versions

The only relevant version is the UI and management server; replicated on 4.23.0.0. Also replicated this issue to the current HEAD of main.

The steps to reproduce the bug
  1. Create a project "test".
  2. Create (for example) and instance under that project "instance-01".
  3. (Optionally) add another volume to this instance.
  4. Make sure you have no project enabled at the top of the page ("Default view").
  5. Go to instances, turn on the project slider and select "instance-01" in the list.
  6. Browse to the Volumes tab and notice that this list is empty.
What to do about it?

Add the {projectid: "-1"} parameter to this API call. Unsure whether this happens to other resources (like NICs), I have not tested this.

diff --git a/ui/src/components/view/VolumesTab.vue b/ui/src/components/view/VolumesTab.vue
index b65933a643..e4679c02dc 100644
--- a/ui/src/components/view/VolumesTab.vue
+++ b/ui/src/components/view/VolumesTab.vue
@@ -141,7 +141,7 @@ export default {
       }
     },
     getVolumes () {
-      getAPI('listVolumes', { listall: true, listsystemvms: true, virtualmachineid: this.vm.id }).then(json => {
+      getAPI('listVolumes', { listall: true, listsystemvms: true, projectid: "-1", virtualmachineid: this.vm.id }).then(json => {
         this.volumes = json.listvolumesresponse.volume
         if (this.volumes) {
           this.volumes.sort((a, b) => { return a.deviceid - b.deviceid })
Lingua principale
Java
Stelle
3.1k
Fork
1.4k
Merge medio
7g 5h
PR unite (30g)
28

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/cloudstack

Tutte le issue di apache/cloudstack

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.