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
Bug 1925024: removes form validation from net(sasl/tls) section for kafkaSource #8051
Conversation
@invincibleJai: This pull request references Bugzilla bug 1925024, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
In response to this:
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. |
We could add a test spec against the net section
|
@invincibleJai: This pull request references Bugzilla bug 1925024, which is valid. 3 validation(s) were run on this bug
In response to this:
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. |
ad0dcd2
to
5e9c5b1
Compare
expect( | ||
isSecretKeyRefPresent({ secretKeyRef: { name: 'my-sasl-secret', key: '' } }), | ||
).toBeTruthy(); | ||
expect(isSecretKeyRefPresent({ secretKeyRef: { name: '', key: 'user' } })).toBeTruthy(); |
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.
When asserting against a exact boolean value we should go for .toBe(true)
or .toBe(false)
.
see this - https://jestjs.io/docs/en/expect#tobetruthy
In JavaScript, there are six falsy values: false, 0, '', null, undefined, and NaN. Everything else is truthy.
}); | ||
|
||
it('expect false if secretKeyRef is not there for name and key', () => { | ||
expect(isSecretKeyRefPresent({ secretKeyRef: { name: '', key: '' } })).toBeFalsy(); |
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.
same here
@@ -297,4 +299,83 @@ describe('sanitizeSourceToForm always returns valid Event Source', () => { | |||
expect(formData.application.name).toEqual(''); | |||
expect(formData.application.selectedKey).toEqual(UNASSIGNED_KEY); | |||
}); | |||
|
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.
Pls Add the null test as well
expect(isSecretKeyRefPresent(null)).toBe(false); |
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.
added
aba54f3
to
b9867f3
Compare
b9867f3
to
08c4148
Compare
Verified locally, works fine |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: invincibleJai, karthikjeeyar 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 |
@invincibleJai: All pull requests linked via external trackers have merged: Bugzilla bug 1925024 has been moved to the MODIFIED state. In response to this:
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. |
/cherry-pick release-4.6 |
@invincibleJai: #8051 failed to apply on top of branch "release-4.6":
In response to this:
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. |
Fixes:
https://issues.redhat.com/browse/ODC-5458
Analysis / Root cause:
In form view for kafksSource if sasl/tls are enebled then other fields i.e user , password or caCert, cert, key where shown as required field which shouldn't be the case
Solution Description:
Removed required validation from net section and rely on API validation for same
Screen shots / Gifs for design review:
Test:
Test setup:
Browser conformance: