Skip to content

Conversation

@yaacov
Copy link
Member

@yaacov yaacov commented Jan 14, 2020

Show VMI as type of Virtual Machine

Design:
openshift/openshift-origin-design#310

Screenshot:
VM Details page:
OKD
VMI Details page:
OKD(1)
OKD(2)
OKD(3)
OKD(4)
OKD(5)
OKD(6)
OKD(7)
VM List page:
Virtual Machines · OKD(1)

@openshift-ci-robot openshift-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. component/kubevirt Related to kubevirt-plugin labels Jan 14, 2020
@yaacov
Copy link
Member Author

yaacov commented Jan 14, 2020

@irosenzw @glekner @suomiy hi, this is a none-working/moving draft, but any comment/help will be appreciated, keep in mind the code is changing.

@yaacov yaacov force-pushed the kubevirt-vmi-details-in-vm-page branch 4 times, most recently from 09d0362 to b521dba Compare January 15, 2020 05:06
@yaacov
Copy link
Member Author

yaacov commented Jan 15, 2020

/test analyze
/test e2e-gcp-console

@yaacov
Copy link
Member Author

yaacov commented Jan 15, 2020

/test analyze
/test e2e-gcp-console

@yaacov yaacov force-pushed the kubevirt-vmi-details-in-vm-page branch from 99a0bb4 to 2332126 Compare January 21, 2020 09:18
@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 21, 2020
@yaacov yaacov force-pushed the kubevirt-vmi-details-in-vm-page branch 2 times, most recently from 2194862 to 205472c Compare January 21, 2020 13:20
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we already have this function: Please see findVMPod

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merged findVMPod and findLauncherPod

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe it would make sense to enhance the VMLikeEntityKind with VMIKind. WDYT?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vmi is now a vmilike kind 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could use getVMLikeModel here if we enhance VMLikeEntityKind

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should take into account that the data should not be editable in the VMI like boot order/nics etc.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 disabled edit kebabs on nics and discs

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we rather move this to VirtualMachinesDetailsPage and listen there on what is missing?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this kind be conditional as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea of this component is to always point to the .../virtualmachines/... path.
so if someone press the VMI link we want them to always end up in the .../virtualmachines/... page.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looked at the docs, no need to share paths, yeee :-) , removed the code that share vm and vmi paths 👍

Copy link
Member

@atiratree atiratree Jan 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO we should refactor VM statuses. Nevertheless could we separate VMI status and do it in a followup?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for refactoring, leaving as is for now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merged the vm and vmi get status methods

@yaacov yaacov force-pushed the kubevirt-vmi-details-in-vm-page branch from 205472c to f38743f Compare January 21, 2020 17:00
@openshift-ci-robot openshift-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 21, 2020
@yaacov yaacov force-pushed the kubevirt-vmi-details-in-vm-page branch from f38743f to 952547b Compare January 21, 2020 17:15
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 21, 2020
@yaacov yaacov changed the title [WIP] Show VMI details Show VMI details Jan 21, 2020
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 21, 2020
@yaacov yaacov force-pushed the kubevirt-vmi-details-in-vm-page branch 2 times, most recently from 63ede6f to 5d8d8d2 Compare January 21, 2020 22:02
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we rename this to isOff? - it is really confusing this way

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we name it vmLike?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vmiLike

Copy link
Member

@atiratree atiratree Jan 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(vm && isWaitingForVMI(vm)) ||
(!vmi && vm && isWaitingForVMI(vm)) ||

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO isBeingStopped and isCreated (wrong usage now) can be used with just a presence of VMI.

We just need to substitute isVMCreated(vm) with just a presence of VMI and we can check the underlying pods in both these methods

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO we should not overuse this type. We should use it in places which can trully handle all 3 types, which is not this case. Can you please make another type for vm and vmi or change it back to VMKind | VMIKind

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

voluems ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

although in the future these selectors could handle VMLikeEntityKind and add spec.template when needed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these selectors would need a second thought - lets not get into this right now

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still wrong

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we keep the old ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we refine the types here and in other places?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is wrong with this function? Why can't we keep it ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

switched back :-)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets make another type for VMKind | VMIKind and use these where needed

you can even do

export type VMILikeEntityKind = VMKind | VMIKind;
export type VMLikeEntityKind = VMILikeEntityKind | TemplateKind;

Copy link
Member

@atiratree atiratree Jan 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are places where we dont expect VMI. What about?

export type VMILikeEntityKind = VMKind | VMIKind;
export type VMLikeEntityKind = VMKind | TemplateKind;
export type VMGenericLikeEntityKind = VMLikeEntityKind | VMILikeEntityKind

still not sure about the naming
thoughts?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

edited

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can keep these functions

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's please check the ownerReferences first before we show that

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changes the text to make sense also when this VMI is owned :-)

p.s.
for this PR users should not end up in a VMI details if it's owned because we removed the easy links to it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if this is a good solution. Please consider removing it or making it conditional.

Btw they will end up here quite easily when they click on a link in VM events

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just making sure that this is correct?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, the idea is to have the same page ... for vm and vmi, It do have different path now, but user should see the same breadcrumbs for both ...

p.s.
when changing namespace it will get to the wrong list, but this will have to be looked at at later time.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the detail, shouldn't hurt removing the namespace select altogether

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense to me too, this is a console wise change, so not for this PR, I agree we should look how to do this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should lookup the vm if it has one - for the status.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should pass down a flag - what kind of page we are showing as both vm and vmi can be present. The user can easily navigate to VMI even if VM is there

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can show it but it should not be editable

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not editable

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but it should be at least visible

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we removing the VMI instance link? I though Pod link should be removed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:-) things change ... the reason is that the vm and vmi page show the same data ... so no new info ...
p.s.
leaving it will require the page to know if it's a vm of vmi page ...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets please forbid editing for flavor and dedicated resources as well

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw, does it make sense to create a <Context> for all components to check if it is a vm or vmi to set editability of their fields? E.g. annotations and description should be editable and others most likely not

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be nice to know if we are in vm or vmi, but we can do it in a follow up because it will need to be tested and we may introduce new bugs if we do it too quickly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

editing still possible

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getVmiIpAddressesString can be removed now

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

menuActions need to be fixed to take VMI into account + also the Consoles

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice !

@yaacov yaacov force-pushed the kubevirt-vmi-details-in-vm-page branch from 0cc4846 to cb94102 Compare January 22, 2020 14:57
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the vmi check should go inside so we check for the status of the launcher pod

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still wrong

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we have to check for the spec?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if this is a good solution. Please consider removing it or making it conditional.

Btw they will end up here quite easily when they click on a link in VM events

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

editing still possible

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but it should be at least visible

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should work for vmi as well

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

working and visible :-)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please change the name as it is a duplicate

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks 👍

@yaacov yaacov force-pushed the kubevirt-vmi-details-in-vm-page branch 2 times, most recently from a546fcc to 6bb1d80 Compare January 23, 2020 08:08
@yaacov
Copy link
Member Author

yaacov commented Jan 23, 2020

@suomiy hi, conflict was with #3985
I checked and unpause looks like still working

@yaacov
Copy link
Member Author

yaacov commented Jan 23, 2020

/test analyze

@openshift-ci-robot openshift-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 23, 2020
@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 23, 2020
- move around imports to prevent circular dependencies
- better naming?
- add flavor/workload/os to the vmi when creating the vms
- show all VMI details correctly and without editing possibilities (except description)
- fix types
- do not load unnecesary resources in vm console
- fix description editing when empty
- do not show empty template link in VMI
- unify selectors for VMWrapper and VMIWrapper
@atiratree atiratree force-pushed the kubevirt-vmi-details-in-vm-page branch from 9582e13 to 7e1c078 Compare January 23, 2020 21:22
@jelkosz
Copy link

jelkosz commented Jan 23, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 23, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jelkosz, yaacov

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 23, 2020
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 0711f4b into openshift:master Jan 24, 2020
@openshift-ci-robot
Copy link
Contributor

@yaacov: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/e2e-gcp-console 7e1c078 link /test e2e-gcp-console

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. component/kubevirt Related to kubevirt-plugin lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants