getNamespace(nic.vm || nic.vmTemplate) may result in undefined, while the expected result is the template namespace.
This PR use ~err to the side of safety by using~ the ~longer~ phrase:
~getNamespace(nic.vm) || getNamespace(nic.vmTemplate)~ getNamespace(nic.vmTemplate || nic.vm)
EDIT:
getNamespace(nic.vmTemplate || nic.vm) is OK because vmTemplate is only defined when calling from the template details page, and undefined when calling from the vm page.
In #265 I made a mistake resulting in
undefined
namespace
when callingNIC
fromVmTemplateDetails
page.In: https://github.com/kubevirt/web-ui/blob/master/frontend/public/kubevirt/components/vm-template/vm-template-detail.jsx#L44
vm
may be defined ( e.g. notundefined
) but missing anamespace
label.getNamespace(nic.vm || nic.vmTemplate)
may result in undefined, while the expected result is the template namespace.This PR use ~err to the side of safety by using~ the ~longer~ phrase: ~
getNamespace(nic.vm) || getNamespace(nic.vmTemplate)
~ getNamespace(nic.vmTemplate || nic.vm)EDIT:
getNamespace(nic.vmTemplate || nic.vm)
is OK becausevmTemplate
is only defined when calling from the template details page, and undefined when calling from thevm
page.