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
Remove method searchYAML from console-shared #5074
Remove method searchYAML from console-shared #5074
Conversation
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.
👍 thank you
@@ -225,8 +225,12 @@ describe('Test clone VM.', () => { | |||
|
|||
it('Cloned VM has vm.kubevirt.io/name label.', () => { | |||
expect( | |||
searchYAML(`vm.kubevirt.io/name: ${vm.name}`, clonedVM.name, clonedVM.namespace, 'vm'), | |||
).toBeTruthy(); | |||
_.get( |
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.
Consider _.has
or optional chaining here.
https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#optional-chaining
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.
Thanks, updated
_.get( | ||
getLabels(getResourceObject(vm.name, vm.namespace, 'vmi')), | ||
'vm.kubevirt.io/name', | ||
undefined, |
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 need to pass the third arg here. If no default is passed, undefined
would be returned anyway.
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 wanted to be explicit, but yeah, it's unnecessary. Removed it.
638d8e9
to
5cb3ae0
Compare
CI keeps failing |
/retest |
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.
/approve
/lgtm
/hold cancel |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rhrazdil, spadgett 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 |
As pointed out by @spadgett in #2125,
searchYAML has several pitfalls and should not be used.
Removed this method from console-shared and updated test cases that used this method.