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 1910483: Fix for Storage cluster creation failed with 'Cannot read property "protocol" of null ' on adding& then cancelling Encryption #7688
Conversation
Hi @GowthamShanmugam. Thanks for your PR. I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
if(!checked){ | ||
encryptOj.advanced = 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.
why you want to set advance encryption
to true
when checked is set to 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.
I am setting advance encryption false only when Encryption is unchecked or set to 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.
/ok-to-test
Nit: Some naming suggestions.
@@ -76,10 +76,14 @@ export const EncryptionFormGroup: React.FC<EncryptionFormGroupProps> = ({ | |||
}, [encryption.clusterWide, encryption.storageClass, encryptionChecked]); | |||
|
|||
const toggleEncryption = (checked: boolean) => { | |||
setEncryptionDispatch(ActionType.SET_ENCRYPTION, mode, dispatch, { | |||
const encryptOj = { |
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 encryptOj = { | |
const payload = { |
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
}); | ||
} | ||
if(!checked){ | ||
encryptOj.advanced = 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.
encryptOj.advanced = false; | |
payload.advanced = 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.
ack
if(!checked){ | ||
encryptOj.advanced = false; | ||
} | ||
setEncryptionDispatch(ActionType.SET_ENCRYPTION, mode, dispatch, encryptOj); |
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.
setEncryptionDispatch(ActionType.SET_ENCRYPTION, mode, dispatch, encryptOj); | |
setEncryptionDispatch(ActionType.SET_ENCRYPTION, mode, dispatch, payload); |
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
}); | ||
} | ||
if(!checked){ | ||
payload.advanced = 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.
We should also set all encryption level and both encryption and kms states to initial value when the high level encryption box is unchecked.
This is to ensure that stale states dont cause errors,
payload.advanced = false;
payload.storageClass = false;
payload.hasHandled = false;
There is already one check for clearing kms state on L88, please merge the above with this one.
Lines 88 to 91 in c29d749
if (!checked) { | |
setEncryptionDispatch(ActionType.CLEAR_KMS_STATE, 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.
ack
...encryption, | ||
clusterWide: checked, | ||
}); | ||
} |
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 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.
You are getting formatting errors hence tests are failing:
/go/src/github.com/openshift/console/frontend/packages/ceph-storage-plugin/src/components/ocs-install/install-wizard/configure.tsx
82:6 error Insert `;` prettier/prettier
83:7 error Replace `(!checked)` with `·(!checked)·` prettier/prettier
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.
Let me check this
cf01817
to
1416c31
Compare
if (!checked) { | ||
payload.advanced = false; | ||
payload.hasHandled = 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.
That seems weird but it is used for validation and need to be set to true
payload.hasHandled = false; | |
payload.hasHandled = true; |
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 dont understand what validation, let me check the code again
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 initial state sets "hasHandled" to true, lets follow the same defaults.
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.
Squash the commits as well.
@afreen23 test case passed, Please review |
@GowthamShanmugam can you squash the commits. |
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1910483 Signed-off-by: Gowtham Shanmugasundaram <gshanmug@redhat.com>
1416c31
to
b60f62e
Compare
@@ -76,14 +76,17 @@ export const EncryptionFormGroup: React.FC<EncryptionFormGroupProps> = ({ | |||
}, [encryption.clusterWide, encryption.storageClass, 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.
@afreen23 I can see a separate useEffect is to set "hasHandled" flag for all cases, Setting a flag is kind of redundant and leads to unpredicted behavior, so I removed it from my latest change
@cloudbehl @afreen23 all changes are done, please review |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: afreen23, GowthamShanmugam 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. |
@GowthamShanmugam: Bugzilla bug 1910483 is in an unrecognized state (MODIFIED) and will not be 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. |
/Bugzilla refresh |
@cloudbehl: Bugzilla bug 1910483 is in an unrecognized state (MODIFIED) and will not be 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. |
/Bugzilla refresh |
@cloudbehl: All pull requests linked via external trackers have merged: Bugzilla bug 1910483 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. |
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1910483
Signed-off-by: Gowtham Shanmugasundaram gshanmug@redhat.com