Skip to content
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 Virtual Hardware tab to Create VM Wizard #3237

Merged
merged 1 commit into from Jan 7, 2020

Conversation

glekner
Copy link
Contributor

@glekner glekner commented Nov 5, 2019

Changes

  • Created a new Virtual Hardware tab for attaching CD-ROMs to a VM/Template
  • Updated DiskModal to support CD-ROM Add/Edit
  • Removed CD-ROMs from the Disks table (Create VM Storage Tab, Overview Disks tab)
  • Removed redundant Type Column from Disks table (Create VM Storage Tab, Overview Disks tab)

Screen Shot 2019-11-21 at 16 06 57

Screen Shot 2019-11-19 at 13 26 22

@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. component/kubevirt Related to kubevirt-plugin labels Nov 5, 2019
@matthewcarleton
Copy link
Contributor

matthewcarleton commented Nov 5, 2019

@glekner I think this would be similar to what we had for the disk tab where we don't have a specific action for CD-ROMs but incorporate it into the "Add disk" flow. I can put together some designs for it today. I also wonder how this is impacted by advanced > virtual hardware, that could be the right place for this too.

@glekner glekner force-pushed the wizard-attach-cd branch 2 times, most recently from c9cdc67 to 265ae41 Compare November 7, 2019 13:33
@matthewcarleton
Copy link
Contributor

matthewcarleton commented Nov 7, 2019

@glekner ya I think we need to determine the priority of the action. I don't see a lot of reasons to add CD-ROMs manually. @jelkosz do you have any thoughts on this? It seems Windows Guest tools are the primary reason we'd see CD-ROMs here. They really are edge cases when we consider there are no physical CD-ROMs to pass through to the VM it's just another PVC.
If we are changing this to add CD-ROMs and Disks I wonder if this should be "Add storage" rather than "Add disk"?
If we are going to show CD-ROMs in the list we might want to call the whole thing just storage and not disks too.
Screen Shot 2019-11-07 at 7 40 55 PM
This would indicate there is more than just disks but not highlight CD-ROMs specifically.

@glekner glekner force-pushed the wizard-attach-cd branch 2 times, most recently from 4829b55 to 4561234 Compare November 19, 2019 11:11
@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 Nov 19, 2019
@glekner glekner force-pushed the wizard-attach-cd branch 3 times, most recently from 0495163 to db2a1a8 Compare November 21, 2019 14:09
@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 21, 2019
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 21, 2019
@glekner glekner force-pushed the wizard-attach-cd branch 4 times, most recently from 05f1719 to 1b00f13 Compare November 21, 2019 15:41
@glekner glekner changed the title Attach CD through VM Wizard Add Virtual Hardware tab to Create VM Wizard Nov 21, 2019
@glekner glekner force-pushed the wizard-attach-cd branch 4 times, most recently from e260dcc to 4e9afb3 Compare November 28, 2019 13:00
@openshift-ci-robot openshift-ci-robot added component/dev-console Related to dev-console component/knative Related to knative-plugin labels Dec 1, 2019
@glekner glekner force-pushed the wizard-attach-cd branch 5 times, most recently from f09100a to b4cab28 Compare December 16, 2019 15:14
export const getAvailableCDName = (cds: CD[]) => {
let index = 1;
let name = `cd-drive-${index}`;
cds.sort(compareCDS).forEach((cd) => {
Copy link
Member

Choose a reason for hiding this comment

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

I still think #3237 (comment) is a better solution:

Please do not modify the input array with sort as this is an unexpected behaviour for this function

bus: DiskBus.VIRTIO,
});

const addButton = () => (
Copy link
Member

Choose a reason for hiding this comment

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

there is no need for this to be a function

),
});

const getActions = (
Copy link
Member

Choose a reason for hiding this comment

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

these actions seem to be the same as the one in vm-wizard-storage-row. Can we export them from there and delete them here?

<CDSimpleRow
data={{ ...restData, name }}
validation={{
name: validations.name || validations.url || validations.container || validations.pvc,
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 be content now?

@@ -77,7 +67,7 @@ const menuActionDelete = (
),
});

const getActions = (
export const getActions = (
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 this export for?

@glekner
Copy link
Contributor Author

glekner commented Dec 22, 2019

  • Added isEditing prop to DiskModal usages on disk-row and vm-wizard-storage-row
  • Using Set now in getAvailableCDName
    @suomiy

@glekner glekner force-pushed the wizard-attach-cd branch 2 times, most recently from d770ebd to cac72a8 Compare December 22, 2019 09:49
@@ -217,7 +218,7 @@ export type VMWizardStorage = {

export type VMWizardStorageWithWrappers = VMWizardStorage & {
diskWrapper: DiskWrapper;
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 make it all optional to be consistent

@@ -34,6 +34,9 @@
"**/bower_components": true,
"**/.cache-loader": true,
"**/public/dist": true
},
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 rather go into a separate PR?

@atiratree
Copy link
Member

two nits, but otherwise looks good

@glekner
Copy link
Contributor Author

glekner commented Jan 3, 2020

done @suomiy

<VMCDsTable
columnClasses={cdTableColumnClasses}
data={virtualStorages}
customData={{ isDisabled: disableAddCD, withProgress, removeStorage, wizardReduxID }}
Copy link
Member

Choose a reason for hiding this comment

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

why is the editing and deleting disabled once we reach 2 cds?

Copy link

Choose a reason for hiding this comment

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

@suomiy thats a design decision. A bit controversial I agree, but a reasoning is that it is not needed to have more than 2 - you can have 1 for OS and 1 for drivers but there is no need to have a 3th. ...aaaand we should expose only things which are actually needed...

Copy link

Choose a reason for hiding this comment

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

Ah, sorry, I've misunderstood your comment. Also the delete and edit is disabled here, so it is incorrect I agree. Only the add has to be disabled.

Copy link
Contributor 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.

it should still reference isLocked

@atiratree
Copy link
Member

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: glekner, suomiy

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 6, 2020
@atiratree
Copy link
Member

/retest

@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.

@glekner
Copy link
Contributor Author

glekner commented Jan 7, 2020

/retest

@openshift-merge-robot openshift-merge-robot merged commit db156e8 into openshift:master Jan 7, 2020
@spadgett spadgett added this to the v4.4 milestone Jan 14, 2020
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/dev-console Related to dev-console component/knative Related to knative-plugin component/kubevirt Related to kubevirt-plugin lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants