Skip to content

Commit

Permalink
display the namespace, podname and volumename of snapshotted volumes (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
laverya authored May 10, 2024
1 parent 5a47e97 commit c791fb1
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
3 changes: 3 additions & 0 deletions pkg/kotsadmsnapshot/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -917,6 +917,9 @@ func listBackupVolumes(backupVolumes []velerov1.PodVolumeBackup) []types.Snapsho
for _, backupVolume := range backupVolumes {
v := types.SnapshotVolume{
Name: backupVolume.Name,
PodName: backupVolume.Spec.Pod.Name,
PodNamespace: backupVolume.Spec.Pod.Namespace,
PodVolumeName: backupVolume.Spec.Volume,
SizeBytesHuman: units.HumanSize(float64(backupVolume.Status.Progress.TotalBytes)),
DoneBytesHuman: units.HumanSize(float64(backupVolume.Status.Progress.BytesDone)),
Phase: string(backupVolume.Status.Phase),
Expand Down
3 changes: 3 additions & 0 deletions pkg/kotsadmsnapshot/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ type SnapshotHook struct {

type SnapshotVolume struct {
Name string `json:"name"`
PodName string `json:"podName"`
PodNamespace string `json:"podNamespace"`
PodVolumeName string `json:"podVolumeName"`
SizeBytesHuman string `json:"sizeBytesHuman"`
DoneBytesHuman string `json:"doneBytesHuman"`
CompletionPercent int `json:"completionPercent"`
Expand Down
9 changes: 8 additions & 1 deletion web/src/components/snapshots/SnapshotDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import ShowAllModal from "../modals/ShowAllModal";
import ViewSnapshotLogsModal from "../modals/ViewSnapshotLogsModal";
import ErrorModal from "../modals/ErrorModal";
import { Utilities } from "../../utilities/utilities";

dayjs.extend(minMax);
dayjs.extend(duration);

Expand Down Expand Up @@ -318,7 +319,13 @@ class SnapshotDetails extends Component {
>
<div className="flex1 u-paddingBottom--15 u-paddingTop--15 u-paddingLeft--10">
<p className="flex1 u-fontSize--large u-textColor--primary u-fontWeight--bold u-lineHeight--bold u-marginBottom--8">
{volume.name}
{volume.podNamespace}
{"/"}
{volume.podName} {volume.podVolumeName}
<span className="u-fontWeight--normal u-textColor--bodyCopy">
{" "}
{volume.name}
</span>
</p>
<p className="u-fontSize--normal u-textColor--accent u-fontWeight--bold u-lineHeight--normal u-marginRight--20">
Size:
Expand Down
9 changes: 9 additions & 0 deletions web/src/stories/ShowAllModal.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ export const Volumes = () => {
sizeBytesHuman: "582B",
startedAt: "2022-12-03T00:00:20Z",
timeRemainingSeconds: 0,
podName: "podName",
podNamespace: "podNamespace",
podVolumeName: "podVolumeName",
},
{
completionPercent: 100,
Expand All @@ -30,6 +33,9 @@ export const Volumes = () => {
sizeBytesHuman: "582B",
startedAt: "2022-12-03T00:00:20Z",
timeRemainingSeconds: 0,
podName: "podName",
podNamespace: "podNamespace",
podVolumeName: "podVolumeName",
},
{
completionPercent: 100,
Expand All @@ -40,6 +46,9 @@ export const Volumes = () => {
sizeBytesHuman: "582B",
startedAt: "2022-12-03T00:00:20Z",
timeRemainingSeconds: 0,
podName: "podName",
podNamespace: "podNamespace",
podVolumeName: "podVolumeName",
},
];
return volumes.map((volume) => {
Expand Down

0 comments on commit c791fb1

Please sign in to comment.