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
Add Encryption workflow for storage cluster creation #7062
Add Encryption workflow for storage cluster creation #7062
Conversation
<> | ||
<FormGroup | ||
fieldId="kms-service-name" | ||
label="Service Name" | ||
className="co-m-pane__form ocs-install-encryption__form-body" | ||
isRequired | ||
> | ||
<TextInput | ||
value={serviceName} | ||
onChange={getServiceName} | ||
isRequired | ||
type="text" | ||
id="kms-service-name" | ||
name="kms-service-name" | ||
/> | ||
</FormGroup> | ||
</> |
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.
<> | |
<FormGroup | |
fieldId="kms-service-name" | |
label="Service Name" | |
className="co-m-pane__form ocs-install-encryption__form-body" | |
isRequired | |
> | |
<TextInput | |
value={serviceName} | |
onChange={getServiceName} | |
isRequired | |
type="text" | |
id="kms-service-name" | |
name="kms-service-name" | |
/> | |
</FormGroup> | |
</> | |
<FormGroup | |
fieldId="kms-service-name" | |
label="Service Name" | |
className="co-m-pane__form ocs-install-encryption__form-body" | |
isRequired | |
> | |
<TextInput | |
value={serviceName} | |
onChange={getServiceName} | |
isRequired | |
type="text" | |
id="kms-service-name" | |
name="kms-service-name" | |
/> | |
</FormGroup> |
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.
There will be more FormGroup
to be added https://github.com/openshift/console/pull/7062/files#diff-ae3d56459b2491d83b6fe9502d3c74b3910fc605496fef5d596dcf713a097af6R12
case CreateStepsSC.CONFIGURE: | ||
return !state.hasEncryptionHandled; | ||
case CreateStepsSC.REVIEWANDCREATE: | ||
return state.nodes.length < MINIMUM_NODES || !getName(state.storageClass); |
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 want to disable the create storage cluster step instead.
And for configure step, we dont need to disable but show a warning and also reflect the same warning on review step.
This is the current convention for wizard flow.
case CreateStepsSC.CONFIGURE: | |
return !state.hasEncryptionHandled; | |
case CreateStepsSC.REVIEWANDCREATE: | |
return state.nodes.length < MINIMUM_NODES || !getName(state.storageClass); | |
case CreateStepsSC.REVIEWANDCREATE: | |
return state.nodes.length < MINIMUM_NODES || !getName(state.storageClass) || !state.hasEncryptionHandled; |
match: RouterMatch<{ appName: string; ns: string }>; | ||
setIsNewSCToBeCreated?: React.Dispatch<boolean>; | ||
setHasNoProvSC?: React.Dispatch<boolean>; | ||
}; |
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 dont want to delete this file for now, in order to allow backporting of bugs.
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.
ack
<Alert | ||
variant="danger" | ||
className="co-alert ocs-install-encryption__form-alert" | ||
title="Select at least 1 encryption level or disable encryption" | ||
isInline | ||
/> |
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.
Use ValidationMessage
for consistency.
console/frontend/packages/ceph-storage-plugin/src/utils/common-ocs-install-el.tsx
Line 113 in a6b7e84
export const ValidationMessage: React.FC<ValidationMessageProps> = ({ className, validation }) => { |
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.
ack
enableNext: state.hasEncryptionHandled, | ||
}, |
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.
enableNext: state.hasEncryptionHandled, | |
}, | |
}, |
Same here, we want to disable storage cluster creation instead.
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.
And put relevant validations/warnings on review and the corresponding step.
className="ocs-install-encryption__form-checkbox" | ||
/> | ||
<Checkbox | ||
id="pv-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.
Why are we calling it pv encryption when on UI it represents the storage class 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.
ya, internally its encryption PVs, so I kept PV encryption. Will change it to storage class encyption for better understanding.
setDispatch(ActionType.SET_ENCRYPTION_VALID, true); | ||
} | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, [clusterWideChecked, pvChecked, encryptionChecked]); |
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 cannot follow , why we need to do this ? can you elaborate ?
import { KMSConfigure } from '../../kms-config/kms-config'; | ||
import './install-wizard.scss'; | ||
|
||
const PVEncryptionLabel: React.FC = () => ( |
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 PVEncryptionLabel: React.FC = () => ( | |
const StorageClassEncryptionLabel: React.FC = () => ( |
|
||
const toggleEncryption = (checked: boolean) => | ||
dispatch({ type: ActionType.SET_ENABLE_ENCRYPTION, payload: checked }); | ||
|
||
return ( | ||
<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.
if you are setting isRequired
then either you put manual validation or set browser defaults by setting following:
<Form> | |
<Form noValidate={false}> |
fieldId="kms-service-name" | ||
label="Service Name" | ||
className="co-m-pane__form ocs-install-encryption__form-body" | ||
isRequired |
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 set a custom validation since PF Form disables vanilla html or enable the latter by setting noValidate=false
0515e44
to
56098b4
Compare
Signed-off-by: Kanika Murarka <kmurarka@redhat.com>
56098b4
to
080c9c3
Compare
if (!kms.name) { | ||
setDispatch(ActionType.SET_KMS_ENCRYPTION, { ...kms, hasHandled: false }, mode, dispatch); | ||
} else { | ||
setDispatch(ActionType.SET_KMS_ENCRYPTION, { ...kms, hasHandled: true }, 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.
I think this would suffice.
if (!kms.name) { | |
setDispatch(ActionType.SET_KMS_ENCRYPTION, { ...kms, hasHandled: false }, mode, dispatch); | |
} else { | |
setDispatch(ActionType.SET_KMS_ENCRYPTION, { ...kms, hasHandled: true }, mode, dispatch); | |
} | |
setDispatch(ActionType.SET_KMS_ENCRYPTION, { ...kms, hasHandled: !kms.name }, mode, dispatch); |
<TextInput | ||
value={kms.name} | ||
onChange={getServiceName} | ||
isRequired |
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: Shift isRequired at the end.
@cloudbehl ack, will add these changes in KMS related PR #7153 |
React.useEffect(() => { | ||
if (!kms.name) { | ||
setDispatch(ActionType.SET_KMS_ENCRYPTION, { ...kms, hasHandled: false }, mode, dispatch); | ||
} else { | ||
setDispatch(ActionType.SET_KMS_ENCRYPTION, { ...kms, hasHandled: true }, mode, dispatch); | ||
} | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, [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.
If this needs change on "kms name" , then move it to the "onChnage" handler for kms name
<FormGroup | ||
fieldId="kms-service-name" | ||
label="Service Name" | ||
className="co-m-pane__form ocs-install-encryption__form-body" |
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:
className="co-m-pane__form ocs-install-encryption__form-body" | |
className="co-m-pane__form ocs-install-encryption__form-group" |
/lgtm okay to take #7062 (comment) |
[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
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. |
/retest |
JIRA: https://issues.redhat.com/browse/RHSTOR-1445
Signed-off-by: Kanika Murarka kmurarka@redhat.com