Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
Do not require VMs and filter them by activeNamespace in VM dialog (#409
Browse files Browse the repository at this point in the history
  • Loading branch information
suomiy authored and rawagner committed Jun 18, 2019
1 parent 21f2b48 commit 5476b1c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/public/kubevirt/components/modals/create-vm-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export const openCreateVmWizard = ( activeNamespace, createTemplate = false ) =>
resource: getResource(NamespaceModel),
},
virtualMachines: {
resource: getResource(VirtualMachineModel),
required: true,
resource: getResource(VirtualMachineModel, {namespace: activeNamespace}),
requiredIfAuthorized: true,
},
userTemplates: {
resource: getResource(TemplateModel, {namespace: activeNamespace, prop: 'userTemplates', matchLabels: {[TEMPLATE_TYPE_LABEL]: TEMPLATE_TYPE_VM}}),
Expand Down
2 changes: 2 additions & 0 deletions frontend/public/kubevirt/components/utils/withResources.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ class Resources extends React.Component {
if (resource) {
if (resource.loaded) {
childrenProps[resourceKey] = resource.data;
} else if (resourceConfig.requiredIfAuthorized && _.get(resource, 'loadError.json.code') !== 403){
loaded = false;
} else if (resourceConfig.required) {
loaded = false;
}
Expand Down

0 comments on commit 5476b1c

Please sign in to comment.