-
Notifications
You must be signed in to change notification settings - Fork 667
Kms cluster encryption #7153
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
Kms cluster encryption #7153
Conversation
6de77aa to
7213815
Compare
7213815 to
f064b54
Compare
cb38464 to
6dcb79e
Compare
6dcb79e to
dc1c90a
Compare
afreen23
left a comment
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.
High level review for now
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.
Fix import hierarchy
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.
The KMS connection is done after clicking create, this should be better
| Connect to external key management service: {kms.name} | |
| External key management service: {kms.name} |
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 prefer to make ocs-kms-vault-token a constant, since used at multiple places.
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.
It would be better to prefix names with kms- to understand what its for ?
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.
Please remove any restriction from individual steps, until we push validation based wizard.
| enableNext: state.encryption.hasHandled && hasConfiguredNetwork && state.kms.hasHandled, |
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.
It was decided to have Next button blocked wrt validations in the wizard.
@cloudbehl @yuvalgalanti
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.
yes that's what was planned.
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.
We have navs still clickable, I thnk we should block them as well.
(Possibly in another PR)
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.
+1 @afreen23
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.
| <p>Encryption Level: {getEncryptionType(encryption)}</p> | |
| <p>Encryption Level: {getEncryptionLevel(encryption)}</p> |
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.
| Connect to external key management service: {kms.name} | |
| External key management service: {kms.name} |
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.
As per UX, its Connected since its connected after Create button click, so changed it to Connect.
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.
Why not kms.hasHandled here ?
{encryption.advanced && (
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 have removed at the other place too, it's not required.
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 prefer to call it following, just to avoid confusion with root state dispatcher
| setDispatch(ActionType.SET_KMS_ENCRYPTION, kmsObject, mode, dispatch); | |
| setKms(ActionType.SET_KMS_ENCRYPTION, kmsObject, mode, dispatch); |
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.
missing new line
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.
| const setServiceName = (name: string) => { | |
| setDispatch(ActionType.SET_KMS_ENCRYPTION, { ...kms, name }, mode, dispatch); | |
| }; | |
| const setServiceName = (name: string) => setDispatch(ActionType.SET_KMS_ENCRYPTION, { ...kms, name }, mode, dispatch); |
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.
| const validateAddressMessage = () => { | |
| if (kms.address === '') { | |
| return 'This is a required field'; | |
| } | |
| return 'Please enter a URL'; | |
| }; | |
| const validateAddressMessage = () => (kms.address === '') ? | |
| 'This is a required field' : 'Please enter a URL'; |
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.
| const validatePort = () => { | |
| return _.isNaN(Number(kms.port)) || kms.port < 0 || !kms.port | |
| ? ValidatedOptions.error | |
| : ValidatedOptions.default; | |
| }; | |
| const validatePort = () => _.isNaN(Number(kms.port)) || kms.port < 0 || !kms.port | |
| ? ValidatedOptions.error | |
| : ValidatedOptions.default; |
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.
| const openAdvancedModal = () => { | |
| return advancedKMSModal({ | |
| const openAdvancedModal = () => advancedKMSModal({ |
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.
Fix import order.
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.
Why do we need another state here that is derived from another state? Can't we use dispatch and update the state over there.
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.
The advance modal has a Save button, on clicking which the data has to be added in the state, to locally store data, I have added local states.
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.
Why not use PF form?
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.
Then, we need to use PF form Modal as well. Console Modal's CSS breaks in PF4 form.
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.
Can we have a comment on why we are overriding using important?
813c34c to
e36ddc2
Compare
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.
| onChange={(e) => setKMSProvider(e)} | |
| onChange={setKMSProvider} |
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.
we are not setting the isDisabled.
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.
For 4.7, it will always be disabled.
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.
create a generic function and use it for all fields. Like isValid(name)
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.
nit: can be put in a shared folder. Will do in next PR.
e36ddc2 to
fef77ec
Compare
|
@bipuladh will address this comment(#7153 (comment)) with the follow up PR: #7330. Please review the rest. |
|
@afreen23 @cloudbehl please review. |
|
/retest |
fef77ec to
36b92b3
Compare
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.
id needs to match with FormGroup
| id="kms-provider-name" | |
| id="kms-provider" |
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.
here as well.
| id="kms-address" | |
| id="kms-service-address" |
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.
Fix id names
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.
| const serviceName = (name: string) => { | |
| const setServiceName = (name: 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.
Does not setting value helps here ?
Because anyways you are setting state. I think you can avoid the guard here
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 understand its not the part of PR, but this is a minor :)
| await Promise.all(promises).then(() => k8sCreate(OCSServiceModel, storageCluster)); | |
| await Promise.all(promises).then(() => k8sCreate(StorageClusterModel, storageCluster)); |
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 worries to take in another PR, this needs fix at various places.
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.
Then, we need to use PF form Modal as well. Console Modal's CSS breaks in PF4 form.
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.
| 'Vault enterprise namespaces are isolated environments that functionally exist as "Vaults within a Vault." They have separate login paths and support creating and managing data isolated to their namespace.'; | |
| 'Vault enterprise namespaces are isolated environments that functionally exist as "Vaults within a Vault". They have separate login paths and support creating and managing data isolated to their namespace.'; |
36b92b3 to
36a0469
Compare
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.
Just for consistency, can you use Object.assign as well similar to arbiter and network?
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.
Why payload optional ? Can't we pass empty params to the same action , used to set kms ActionType.SET_KMS_ENCRYPTION ?
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.
nit: pool-form-modal
| <Form onSubmit={submit} key="pool-form-modal"> | |
| <Form onSubmit={submit} 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.
Lets be consistent with names.
| export const kmsMaxFileUploadSize = 4000000; | |
| export const kmsFileSizeErrorMsg = 'Maximum file size exceeded. File limit is 4MB.'; | |
| export const KMSConfigMapName = 'ocs-kms-connection-details'; | |
| export const KMSSecretName = 'ocs-kms-token'; | |
| export const KMSMaxFileUploadSize = 4000000; | |
| export const KMSFileSizeErrorMsg = 'Maximum file size exceeded. File limit is 4MB.'; | |
| export const KMSConfigMapName = 'ocs-kms-connection-details'; | |
| export const KMSSecretName = 'ocs-kms-token'; |
Signed-off-by: Kanika Murarka <kmurarka@redhat.com>
36a0469 to
226c6f3
Compare
|
/test e2e-gcp-console |
afreen23
left a comment
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.
/lgtm
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: a2batic, afreen23 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Merged after: #7062

