New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add VMs to Topology View #5041
Add VMs to Topology View #5041
Conversation
f358b18
to
d500587
Compare
d500587
to
07e93a1
Compare
07e93a1
to
2c9a1a8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeff-phillips-18 can you add screenshots of the Actions menu & if you've implemented the context sensitive actions within topology?
2c9a1a8
to
f0c00d2
Compare
This is looking great @jeff-phillips-18 ! |
This is all done within the plugin already. The badge comes from the model, the side panel details show is the same as the details panel for a VM, and the actions are defined in the existing kebab actions. |
ah, ok thanks. I'll file a bug on the CNV side then. |
Correct |
VM_STATUS_V2V_CONVERSION_IN_PROGRESS, | ||
VM_STATUS_V2V_CONVERSION_PENDING, | ||
VM_STATUS_VMI_WAITING, | ||
} from '../../../statuses/vm/constants'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very recently 2 new more statuses were added: VM_STATUS_V2V_VM_IMPORT_IN_PROGRESS (should go under kubevirt-m-importing) and VM_STATUS_V2V_VM_IMPORT_ERROR (should go under kubevirt-m-error)
8c526e1
to
040438e
Compare
@matthewcarleton Fixed the badge in the side panel. @jelkosz Added those statuses. |
@matthewcarleton The |
@jeff-phillips-18 it's very nitpicky I know so if will delay this getting in then don't worry about it. It really just comes down to VMs only ever using one pod so having Pod(s) could be a bit misleading. |
@matthewcarleton Jeff and I talked a bit about this. Here were the points we discussed:
|
be3e92e
to
53e3685
Compare
/retest |
ah I see what you're saying. I'm ok with Pods then. |
getServicesForResource, | ||
} from './resource-utils'; | ||
|
||
export class TransformResourceData { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably move this to dev-console
now?
{ | ||
isList: true, | ||
kind: VirtualMachineModel.kind, | ||
namespace, | ||
prop: 'virtualMachines', | ||
optional: true, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another area required for inclusion through extensions.
This is so inefficient to understand the app labels :(
I wonder if we could just sift through our redux store of resources instead of fetching all these upfront.
Something to consider as tech debt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const knativeComponentFactoryRef = React.useRef<KnativeComponentFactory>( | ||
new KnativeComponentFactory(serviceBinding), | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pattern you had before was better so that we don't always create new objects just to have them GC'd.
React.useEffect(() => { | ||
if (!displayFiltersRef.current) { | ||
displayFiltersRef.current = filters.display; | ||
return; | ||
} | ||
|
||
if ( | ||
(filters.display.eventSources && !displayFiltersRef.current.eventSources) || | ||
(filters.display.virtualMachines && !displayFiltersRef.current.virtualMachines) | ||
) { | ||
action(() => { | ||
visRef.current.getGraph().reset(); | ||
visRef.current.getGraph().layout(); | ||
})(); | ||
} | ||
displayFiltersRef.current = filters.display; | ||
}, [filters.display]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is too specific when what we really want is to run layout on nodes that change visibility.
As discussed, an event to notify of visibility change to let the layout handle this much like add / remove of nodes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also discussed doing such changes in a future issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
properties: { | ||
resources: virtualMachineConfigurations, | ||
required: FLAG_KUBEVIRT, | ||
utils: getVirtualMachines, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This calls a function which returns an empty object? why?
@@ -52,6 +57,43 @@ type ConsumedExtensions = | |||
|
|||
export const FLAG_KUBEVIRT = 'KUBEVIRT'; | |||
|
|||
export const virtualMachineConfigurations = (namespace: string): FirehoseResource[] => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why export this function? It doesn't seem to be used anywhere externally.
@@ -49,7 +49,7 @@ export const isPodSchedulable = (pod: PodKind) => { | |||
const isPodReady = (pod: PodKind): boolean => | |||
pod?.status?.phase === 'Running' && pod?.status?.containerStatuses?.every((s) => s.ready); | |||
|
|||
export const findVMIPod = ( | |||
export const getPodsForVMI = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really want a util to get all pods to display in the sidebar instead of just the one pod as displayed in their details page?
<div className="row"> | ||
<div className="col-sm-6"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we be using patternfly grid instead of bootstrap?
<div className="overview__sidebar-pane-head resource-overview__heading"> | ||
<h1 className="co-m-pane__heading"> | ||
<div className="co-m-pane__name co-resource-item"> | ||
<ResourceIcon className="co-m-resource-icon--lg" kind={vmObj.kind} /> | ||
{name && ( | ||
<Link | ||
to={resourcePathFromModel(modelFor(vmObj.kind), name, namespace)} | ||
className="co-resource-item__resource-name" | ||
> | ||
{name} | ||
</Link> | ||
)} | ||
</div> | ||
{actions?.length && ( | ||
<div className="co-actions"> | ||
<ActionsMenu actions={actions} /> | ||
</div> | ||
)} | ||
</h1> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These headings keep getting repeated. Create a tech debt to create a reusable component.
And maybe merge it with making the side panel more extensible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs rebase @jeff-phillips-18 |
53e3685
to
1262747
Compare
1262747
to
2b011fc
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: christianvogt, jeff-phillips-18 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest Please review the full test history for this PR and help us cut down flakes. |
Fixes:
https://issues.redhat.com/browse/ODC-3329
https://issues.redhat.com/browse/ODC-3497
Analysis / Root cause:
As a developer I want to quickly know which of my workloads are based on VMs.
As a developer I expect every node in topology to be selectable and show some details in the side panel. I want to quickly access information about my VMs.
Solution Description:
Add virtual machine items to the topology view. When a VM node is selected, show its details in the side panel.
Screen shots / Gifs for design review:
Browser conformance:
cc @openshift/team-devconsole-ux @serenamarie125 @sspeiche @jelkosz
/kind feature