Skip to content
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

Merged

Conversation

GowthamShanmugam
Copy link
Contributor

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1910483

Signed-off-by: Gowtham Shanmugasundaram gshanmug@redhat.com

@openshift-ci-robot openshift-ci-robot added the component/ceph Related to ceph-storage-plugin label Dec 31, 2020
@openshift-ci-robot
Copy link
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@openshift-ci-robot openshift-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Dec 31, 2020
Comment on lines 83 to 84
if(!checked){
encryptOj.advanced = false;
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

@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.

/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 = {
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 encryptOj = {
const payload = {

Copy link
Contributor Author

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;
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
encryptOj.advanced = false;
payload.advanced = false;

Copy link
Contributor Author

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);
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
setEncryptionDispatch(ActionType.SET_ENCRYPTION, mode, dispatch, encryptOj);
setEncryptionDispatch(ActionType.SET_ENCRYPTION, mode, dispatch, payload);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ack

@openshift-ci-robot openshift-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 4, 2021
});
}
if(!checked){
payload.advanced = false;
Copy link
Contributor

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.

if (!checked) {
setEncryptionDispatch(ActionType.CLEAR_KMS_STATE, mode, dispatch);
}
};

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ack

...encryption,
clusterWide: checked,
});
}
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
}
};

Copy link
Contributor

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 

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me check this

@GowthamShanmugam GowthamShanmugam force-pushed the bz_1910483 branch 3 times, most recently from cf01817 to 1416c31 Compare January 4, 2021 18:32
if (!checked) {
payload.advanced = false;
payload.hasHandled = false;
Copy link
Contributor

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

Suggested change
payload.hasHandled = false;
payload.hasHandled = true;

Copy link
Contributor Author

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

Copy link
Contributor

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.

Copy link
Contributor

@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.

Squash the commits as well.

@GowthamShanmugam
Copy link
Contributor Author

@afreen23 test case passed, Please review

@cloudbehl
Copy link
Contributor

@GowthamShanmugam can you squash the commits.

@@ -76,14 +76,17 @@ export const EncryptionFormGroup: React.FC<EncryptionFormGroupProps> = ({
}, [encryption.clusterWide, encryption.storageClass, encryptionChecked]);
Copy link
Contributor Author

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

@GowthamShanmugam
Copy link
Contributor Author

@cloudbehl @afreen23 all changes are done, please review

@afreen23
Copy link
Contributor

afreen23 commented Jan 7, 2021

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 7, 2021
@openshift-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 7, 2021
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 08ea464 into openshift:master Jan 7, 2021
@spadgett spadgett added this to the v4.7 milestone Jan 7, 2021
@GowthamShanmugam GowthamShanmugam changed the title Fix for Storage cluster creation failed with 'Cannot read property "protocol" of null ' on adding& then cancelling Encryption Bug 1910483: Fix for Storage cluster creation failed with 'Cannot read property "protocol" of null ' on adding& then cancelling Encryption Jan 11, 2021
@openshift-ci-robot
Copy link
Contributor

@GowthamShanmugam: Bugzilla bug 1910483 is in an unrecognized state (MODIFIED) and will not be moved to the MODIFIED state.

In response to this:

Bug 1910483: Fix for Storage cluster creation failed with 'Cannot read property "protocol" of null ' on adding& then cancelling Encryption

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.

@cloudbehl
Copy link
Contributor

/Bugzilla refresh

@openshift-ci-robot
Copy link
Contributor

@cloudbehl: Bugzilla bug 1910483 is in an unrecognized state (MODIFIED) and will not be moved to the MODIFIED state.

In response to this:

/Bugzilla refresh

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.

@cloudbehl
Copy link
Contributor

/Bugzilla refresh

@openshift-ci-robot
Copy link
Contributor

@cloudbehl: All pull requests linked via external trackers have merged:

Bugzilla bug 1910483 has been moved to the MODIFIED state.

In response to this:

/Bugzilla refresh

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.

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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants