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 1829885: Snapshot code cleanup #5204
Bug 1829885: Snapshot code cleanup #5204
Conversation
handlePromise(k8sCreate(VolumeSnapshotModel, snapshotTemplate)) | ||
.then(close) | ||
.catch((error) => { | ||
// eslint-disable-next-line no-console | ||
console.error(error); | ||
}); |
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.
IMO logging can be avoided. Internally handlePromise
will throw error.
handlePromise(k8sCreate(VolumeSnapshotModel, snapshotTemplate)) | |
.then(close) | |
.catch((error) => { | |
// eslint-disable-next-line no-console | |
console.error(error); | |
}); | |
// eslint-disable-next-line promise/catch-or-return | |
handlePromise(k8sCreate(VolumeSnapshotModel, snapshotTemplate)) | |
.then(close) |
} from '@console/internal/components/factory'; | ||
import { SnapshotScheduleModel, VolumeSnapshotModel } from '../../../models'; | ||
import { cronLink, numberOfSnapshot, snapshotTypes } from './volume-snapshot'; | ||
import { VolumeSnapshotModel } from '../../../models'; | ||
import { snapshotTypes } from './volume-snapshot'; | ||
import { getName, getNamespace } from '@console/shared'; | ||
|
||
import { PersistentVolumeClaimModel } from '@console/internal/models'; |
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.
console/shared
and internal
could be moved up.
@@ -169,7 +162,7 @@ export const VolumeSnapshotTableRow: RowFunction<K8sResourceKind> = ({ | |||
export const VolumeSnapshotList: React.FC<TableProps> = (props) => ( | |||
<Table | |||
{...props} | |||
aria-label="Volume Snapshot" | |||
aria-label={VolumeSnapshotModel.labelPlural} |
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.
Should it not be more elaborate like Volume Snapshot List
?
// CronJob: 'CronJob', | ||
// Monthly: 'Monthly', | ||
// Weekly: 'Weekly', |
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.
A comment for commenting would be nice or rather remove it.
</TableData> | ||
<TableData className={snapshotTableColumnClasses[3]}> | ||
{obj?.status?.restoreSize || 'No Data'} | ||
{obj.status.restoreSize || 'No Data'} |
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.
In console if I am not wrong, if some data is not available then a dash is used -
for lists.
cb1c9b8
to
e4ee7e6
Compare
export const snapshotTypes = { | ||
Single: 'Single', | ||
/* Other ways to create snapshot |
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.
Since you have removed all the code for snapshot other than single, it makes sense to remove these comments too. WDYT?
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.
One minor comment.
@@ -169,7 +160,7 @@ export const VolumeSnapshotTableRow: RowFunction<K8sResourceKind> = ({ | |||
export const VolumeSnapshotList: React.FC<TableProps> = (props) => ( | |||
<Table | |||
{...props} | |||
aria-label="Volume Snapshot" | |||
aria-label={'Volume Snapshot List'} |
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.
aria-label={'Volume Snapshot List'} | |
aria-label='Volume Snapshot List' |
Fixes: https://issues.redhat.com/browse/RHSTOR-1057 Signed-off-by: Kanika <kmurarka@redhat.com>
e4ee7e6
to
91ee365
Compare
/retitle Bug 1829885: Snapshot code cleanup |
@a2batic: This pull request references Bugzilla bug 1829885, 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. |
/bugzilla refresh |
@a2batic: This pull request references Bugzilla bug 1829885, 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. |
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: a2batic, afreen23, bipuladh 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 |
@a2batic: All pull requests linked via external trackers have merged: openshift/console#5204. Bugzilla bug 1829885 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. |
The PR:
Fixes: https://issues.redhat.com/browse/RHSTOR-1057
Signed-off-by: Kanika kmurarka@redhat.com