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 1811031: Change dashboard activation mechanism #5575
Bug 1811031: Change dashboard activation mechanism #5575
Conversation
Please add description and bugzilla. |
@bipuladh: This pull request references Bugzilla bug 1811031, which is invalid:
Comment 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. |
@bipuladh: This pull request references Bugzilla bug 1811031, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
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. |
@bipuladh: This pull request references Bugzilla bug 1811031, which is valid. 3 validation(s) were run on this bug
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. |
26add7d
to
e9acb98
Compare
/assign @vojtechszocs |
/lgtm |
@@ -44,6 +38,28 @@ const handleOCSError = (res, flags, dispatch, cb) => { | |||
} | |||
}; | |||
|
|||
export const detectOCS: FeatureDetector = async (dispatch) => { | |||
try { | |||
await k8sGet(OCSServiceModel, OCS_CONVERGED_CR_NAME, CEPH_STORAGE_NAMESPACE); |
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 could do both calls in parallel, this way the second k8sGet waits for the first one to finish
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.
This can be done as a follow-up 😃
@bipuladh Consider using Promise.all
to kick off & handle multiple async operations in parallel.
e9acb98
to
2a1a5e4
Compare
2a1a5e4
to
17bd1e5
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: a2batic, bipuladh, rawagner 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 |
@bipuladh: All pull requests linked via external trackers have merged: openshift/console#5575, openshift/console#4674. Bugzilla bug 1811031 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. |
/cherrypick release-4.5 |
@bipuladh: new pull request created: #5660 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. |
|
||
/* Key and Value should be same value received in CSV */ | ||
export const OCS_SUPPORT_FLAGS = { | ||
SNAPSHOT: 'SNAPSHOT', | ||
EXTERNAL: 'EXTERNAL', | ||
}; | ||
|
||
const handleOCSError = (res, flags, dispatch, cb) => { | ||
const handleError = (res: any, flags: string[], dispatch: Dispatch, cb: FeatureDetector) => { |
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'd suggest we adapt the existing handleError
function in public/actions/features.ts
to support this specific use case:
const retryFlagDetection = (dispatch: Dispatch, cb) => {
setTimeout(() => cb(dispatch), 15000);
};
export const handleError = (res, flags: string | string[], dispatch: Dispatch, cb) => {
const status = res?.response?.status;
if (_.includes([403, 502], status)) {
_.castArray(flags).forEach((f) => dispatch(setFlag(f, undefined)));
}
if (!_.includes([401, 403, 500], status)) {
retryFlagDetection(dispatch, cb);
}
};
@@ -44,6 +38,28 @@ const handleOCSError = (res, flags, dispatch, cb) => { | |||
} | |||
}; | |||
|
|||
export const detectOCS: FeatureDetector = async (dispatch) => { | |||
try { | |||
await k8sGet(OCSServiceModel, OCS_CONVERGED_CR_NAME, CEPH_STORAGE_NAMESPACE); |
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.
This can be done as a follow-up 😃
@bipuladh Consider using Promise.all
to kick off & handle multiple async operations in parallel.
Move the dashboard activation mechanism from CRD based to CR based.
Motivation: Until the Storage Cluster is created we don't know which dashboard to activate. We should not activate without being sure which dashboard to activate.