Skip to content

Conversation

@a2batic
Copy link
Contributor

@a2batic a2batic commented Nov 8, 2020

Merged after: #7062
screencapture-localhost-9000-k8s-ns-openshift-storage-clusterserviceversions-ocs-operator-v4-6-0-ocs-openshift-io-v1-StorageCluster-new-2020-11-18-17_17_46
Screenshot from 2020-11-18 17-18-01

@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 8, 2020
@a2batic a2batic marked this pull request as draft November 8, 2020 20:06
@openshift-ci-robot openshift-ci-robot added the component/ceph Related to ceph-storage-plugin label Nov 8, 2020
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 8, 2020
@a2batic a2batic force-pushed the kms-cluster-encryption branch from 6de77aa to 7213815 Compare November 18, 2020 06:26
@a2batic a2batic force-pushed the kms-cluster-encryption branch from 7213815 to f064b54 Compare November 18, 2020 12:01
@a2batic a2batic marked this pull request as ready for review November 18, 2020 13:22
@a2batic a2batic changed the title [WIP] Kms cluster encryption Kms cluster encryption Nov 18, 2020
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 18, 2020
@a2batic a2batic force-pushed the kms-cluster-encryption branch 3 times, most recently from cb38464 to 6dcb79e Compare November 23, 2020 20:21
@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 23, 2020
@a2batic a2batic force-pushed the kms-cluster-encryption branch from 6dcb79e to dc1c90a Compare November 23, 2020 20:43
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 23, 2020
Copy link

@afreen23 afreen23 left a 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

Comment on lines 16 to 22

Choose a reason for hiding this comment

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

Fix import hierarchy

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

Suggested change
Connect to external key management service: {kms.name}
External key management service: {kms.name}

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.

Comment on lines 61 to 58

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 ?

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.

Suggested change
enableNext: state.encryption.hasHandled && hasConfiguredNetwork && state.kms.hasHandled,

Copy link
Contributor Author

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

Copy link
Contributor

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.

Copy link

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)

Choose a reason for hiding this comment

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

Choose a reason for hiding this comment

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

Suggested change
<p>Encryption Level: {getEncryptionType(encryption)}</p>
<p>Encryption Level: {getEncryptionLevel(encryption)}</p>

Choose a reason for hiding this comment

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

Suggested change
Connect to external key management service: {kms.name}
External key management service: {kms.name}

Copy link
Contributor Author

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.

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 && (

Copy link
Contributor Author

@a2batic a2batic Nov 29, 2020

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.

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

Suggested change
setDispatch(ActionType.SET_KMS_ENCRYPTION, kmsObject, mode, dispatch);
setKms(ActionType.SET_KMS_ENCRYPTION, kmsObject, mode, dispatch);

Choose a reason for hiding this comment

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

missing new line

Comment on lines 28 to 38
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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);

Comment on lines 48 to 86
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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';

Comment on lines 55 to 59
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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;

Comment on lines 84 to 96
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const openAdvancedModal = () => {
return advancedKMSModal({
const openAdvancedModal = () => advancedKMSModal({

Comment on lines 30 to 31
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix import order.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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?

Copy link

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.

Copy link
Contributor

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?

@a2batic a2batic force-pushed the kms-cluster-encryption branch 3 times, most recently from 813c34c to e36ddc2 Compare November 29, 2020 13:55
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
onChange={(e) => setKMSProvider(e)}
onChange={setKMSProvider}

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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)

Copy link
Contributor

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.

@a2batic a2batic force-pushed the kms-cluster-encryption branch from e36ddc2 to fef77ec Compare December 1, 2020 15:12
@a2batic
Copy link
Contributor Author

a2batic commented Dec 1, 2020

@bipuladh will address this comment(#7153 (comment)) with the follow up PR: #7330. Please review the rest.

@a2batic
Copy link
Contributor Author

a2batic commented Dec 1, 2020

@afreen23 @cloudbehl please review.

@a2batic
Copy link
Contributor Author

a2batic commented Dec 1, 2020

/retest

@a2batic a2batic force-pushed the kms-cluster-encryption branch from fef77ec to 36b92b3 Compare December 1, 2020 16:01
Copy link

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

Suggested change
id="kms-provider-name"
id="kms-provider"

Copy link

Choose a reason for hiding this comment

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

here as well.

Suggested change
id="kms-address"
id="kms-service-address"

Comment on lines 141 to 175
Copy link

Choose a reason for hiding this comment

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

Fix id names

Copy link

Choose a reason for hiding this comment

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

Suggested change
const serviceName = (name: string) => {
const setServiceName = (name: string) => {

Comment on lines 98 to 120
Copy link

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

Copy link

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 :)

Suggested change
await Promise.all(promises).then(() => k8sCreate(OCSServiceModel, storageCluster));
await Promise.all(promises).then(() => k8sCreate(StorageClusterModel, storageCluster));

Copy link

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.

Copy link

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.

Copy link

Choose a reason for hiding this comment

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

Suggested change
'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.';

@a2batic a2batic force-pushed the kms-cluster-encryption branch from 36b92b3 to 36a0469 Compare December 1, 2020 17:02
Comment on lines 144 to 151
Copy link

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?

Copy link

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 ?

Copy link

Choose a reason for hiding this comment

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

nit: pool-form-modal

Suggested change
<Form onSubmit={submit} key="pool-form-modal">
<Form onSubmit={submit} key="">

Comment on lines 57 to 60
Copy link

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.

Suggested change
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>
@a2batic a2batic force-pushed the kms-cluster-encryption branch from 36a0469 to 226c6f3 Compare December 1, 2020 20:46
@a2batic
Copy link
Contributor Author

a2batic commented Dec 2, 2020

/test e2e-gcp-console

Copy link

@afreen23 afreen23 left a comment

Choose a reason for hiding this comment

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

/lgtm

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

[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

Details 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-merge-robot openshift-merge-robot merged commit d73d98e into openshift:master Dec 2, 2020
@spadgett spadgett added this to the v4.7 milestone Dec 9, 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/ceph Related to ceph-storage-plugin lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants