Skip to content

Commit

Permalink
Add filter fo storage
Browse files Browse the repository at this point in the history
  • Loading branch information
Negashev committed Mar 25, 2024
1 parent 4b657c0 commit f36129f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rancher-vcloud-director-node-driver-ui-plugin",
"version": "0.2.6",
"version": "0.2.7",
"private": false,
"engines": {
"node": ">=12"
Expand Down
2 changes: 1 addition & 1 deletion pkg/vcd-node-driver/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vcd-node-driver",
"description": "vCloud Director node-driver plugin for rancher",
"version": "0.2.6",
"version": "0.2.7",
"private": false,
"rancher": {
"annotations": {
Expand Down
8 changes: 6 additions & 2 deletions pkg/vcd-node-driver/vcd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ export class Vcd {
}

public async getStorage(value: any, initial?: string) {
return await this.getOptions(value, '/query?type=orgVdcStorageProfile&pageSize=1000', 'record', undefined, initial);
return await this.getOptions(value, '/query?type=orgVdcStorageProfile&pageSize=1000', 'record', (storage: any) => {
if (storage.vdcName === this.vdc) {
return storage;
}
}, initial);
}

public async getVAppVms(value: any, api: string, initial?: string) {
Expand Down Expand Up @@ -233,7 +237,7 @@ export class Vcd {
private convertToOptions(list: any) {
const sorted = (list || []).sort((a: any, b: any) => a.name.localeCompare(b.name));

return sorted.map((p: any) => {
return sorted.filter(item => item !== undefined).map((p: any) => {
return {
label: p.name,
value: p
Expand Down

0 comments on commit f36129f

Please sign in to comment.