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

Refactor VM node selector scenario #5742

Merged

Conversation

rhrazdil
Copy link

  • Created model for Node Selector modal dialog
  • updated node-selector.scenario.ts

@openshift-ci-robot openshift-ci-robot added component/kubevirt Related to kubevirt-plugin approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jun 15, 2020

describe('KubeVirt VM detail - edit Node Selector', () => {
const testVM = getVMManifest('Container', testName, `node-selector-vm-${getRandStr(5)}`);
const vm = new VirtualMachine(testVM.metadata);
const vm: VirtualMachine = new VirtualMachine(testVM.metadata);
const labels: MatchLabels = {
Copy link
Contributor

@gouyang gouyang Jun 17, 2020

Choose a reason for hiding this comment

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

I would suggest adding at least two labels for this tests to make sure it works well. And then refactor deleteLabel to deleteLabels.

Copy link
Author

Choose a reason for hiding this comment

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

updated, adding and removing 2 key:value labels, added deleteNodeSelectors method.

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good.

@@ -39,4 +53,28 @@ export class VirtualMachine extends BaseVirtualMachine {
timeout,
);
}

async addNodeSelectors(labels: MatchLabels) {
Copy link
Contributor

@gouyang gouyang Jun 18, 2020

Choose a reason for hiding this comment

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

Is it better to move addNodeSelectors and deleteNodeSelectors to kubevirtUIResource.ts?

Copy link
Author

Choose a reason for hiding this comment

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

No, scheduling is relevant for Virtual Machine only, it cannot be edited in VMI or Virtual Machine Templates

Copy link
Contributor

Choose a reason for hiding this comment

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

okay.

* Adds new row if needed.
* Returns string with index of next empty row.
*/
async addRow(): Promise<string> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Other place like Tolerations and affinity may use addRow as well, then we can move it to utils or console-shared.

Copy link
Author

Choose a reason for hiding this comment

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

Better place would probably be some scheduling.dialog.view.ts file, utils and console-shared are for more general purpose utility methods

Copy link
Contributor

Choose a reason for hiding this comment

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

okay, if you decide not to do it in this one, then it looks good to me.

@rhrazdil
Copy link
Author

@suomiy can you review please?

@atiratree
Copy link
Member

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rhrazdil, 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-bot
Copy link
Contributor

/retest

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

2 similar comments
@openshift-bot
Copy link
Contributor

/retest

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

@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 6401fe9 into openshift:master Jun 23, 2020
@spadgett spadgett added this to the v4.6 milestone Jun 24, 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/kubevirt Related to kubevirt-plugin lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants