-
Notifications
You must be signed in to change notification settings - Fork 31
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
[RHSTOR-5140] Adds Ceph mon count update for 5 zones #1117
[RHSTOR-5140] Adds Ceph mon count update for 5 zones #1117
Conversation
2da5945
to
9ccc69f
Compare
const [errorMessage, setErrorMessage] = React.useState(''); | ||
const [inProgress, setProgress] = React.useState(false); | ||
|
||
//Todo(bipuladh): Update it to use information from the alert |
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.
sorry for adding such a strange suggestion on the PR, but I am adding comments prefixed with term // ToDo (epic 4422)
so that it will be easier to search for all such instances later and make updates related to multiple storagecluster epic...
//Todo(bipuladh): Update it to use information from the alert | |
// ToDo (epic 4422) (bipuladh): Update it to use information from the alert |
direction={{ default: 'column' }} | ||
spaceItems={{ default: 'spaceItemsNone' }} | ||
> | ||
<FlexItem>{t('Failure domains: 5')}</FlexItem> |
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.
just asking, should we determine the count from the rack/zone labels and then display, instead of exact value ?? assuming there can be more than 5 racks/FD as well (as per epic's title)...
spaceItems={{ default: 'spaceItemsNone' }} | ||
> | ||
<FlexItem>{t('Failure domains: 5')}</FlexItem> | ||
<FlexItem>{t('Monitor count: 3')}</FlexItem> |
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.
same here, just asking, should we read it from StorageCluster CR ?? we are already polling for it...
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 alert will only be raised for scenarios when mon count is 3. so this is safe.
setProgress(false); | ||
}) | ||
.catch((err) => { | ||
setErrorMessage(err); |
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.
no need to add setProgress(false); for error case?
<Trans t={t as any} ns="plugin__odf-console"> | ||
To enhance system resilience, align Ceph monitors with the | ||
available node failure zones. | ||
</Trans> |
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 tag here? can't we use a t function?
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.
It's the same thing. Used it here because the sentence is a bit long.
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 agree it is the same, But I prefer to use the t
function rather than <Trans>
So we can change the ns
anytime. In case of refactoring, it will be easy to change the ns
. I use <Trans"
only when I have any HTML tags in between.
It just an optional suggestion
</Text> | ||
</FlexItem> | ||
</Flex> | ||
{errorMessage && ( |
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.
{errorMessage && ( | |
{!!errorMessage && ( |
</Flex> | ||
{errorMessage && ( | ||
<Alert isInline variant="danger" title={t('An error occurred')}> | ||
{(errorMessage as any)?.message || errorMessage} |
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 prefer to create one common util function to fetch error messages in a shared folder. but it is just an optional suggestion.
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 can take it up in a different PR.
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
bbd3835
to
06c94ec
Compare
useSafeK8sGet(StorageClusterModel, null, odfNamespace); | ||
const [nodes, nodesLoaded, nodesLoadError] = useK8sList<NodeKind>(NodeModel); | ||
const failureDomains = | ||
nodesLoaded && !nodesLoadError ? groupNodesByZones(nodes)?.length : []; |
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.
not for this PR, but make sense to rename the function later...
nodesLoaded && !nodesLoadError ? groupNodesByZones(nodes)?.length : []; | |
nodesLoaded && !nodesLoadError ? groupNodesByFailureDomain(nodes)?.length : []; |
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.
/lgtm
/retest |
1 similar comment
/retest |
CI un-blocked by: #1125 (PR#1125 is needed because of OCP react-router-dom updates, else components using imports will break). |
Signed-off-by: Bipul Adhikari <[email protected]>
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bipuladh, SanjalKatiyar 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 |
79af2c7
into
red-hat-storage:master
Adds support for updating Ceph Mon count for 5 zones
Screenshot: