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
Refactor VM node selector scenario #5742
Conversation
rhrazdil
commented
Jun 15, 2020
- Created model for Node Selector modal dialog
- updated node-selector.scenario.ts
5384557
to
b5e9cf7
Compare
|
||
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 = { |
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.
I would suggest adding at least two labels for this tests to make sure it works well. And then refactor deleteLabel
to deleteLabels
.
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.
updated, adding and removing 2 key:value labels, added deleteNodeSelectors
method.
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.
Looks good.
b5e9cf7
to
db0d569
Compare
db0d569
to
bdd9ae9
Compare
@@ -39,4 +53,28 @@ export class VirtualMachine extends BaseVirtualMachine { | |||
timeout, | |||
); | |||
} | |||
|
|||
async addNodeSelectors(labels: MatchLabels) { |
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.
Is it better to move addNodeSelectors
and deleteNodeSelectors
to kubevirtUIResource.ts
?
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.
No, scheduling is relevant for Virtual Machine only, it cannot be edited in VMI or Virtual Machine Templates
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.
okay.
* Adds new row if needed. | ||
* Returns string with index of next empty row. | ||
*/ | ||
async addRow(): Promise<string> { |
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.
Other place like Tolerations
and affinity
may use addRow
as well, then we can move it to utils
or console-shared
.
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.
Better place would probably be some scheduling.dialog.view.ts file, utils and console-shared are for more general purpose utility methods
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.
okay, if you decide not to do it in this one, then it looks good to me.
@suomiy can you review please? |
/lgtm |
[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 |
/retest Please review the full test history for this PR and help us cut down flakes. |
2 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |