Skip to content

Commit

Permalink
CNV-44956: Adjusting storage checkups new fields
Browse files Browse the repository at this point in the history
Signed-off-by: Matan Schatzman <[email protected]>
  • Loading branch information
metalice committed Jul 31, 2024
1 parent 000c071 commit 7dd4be0
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 20 deletions.
3 changes: 3 additions & 0 deletions locales/en/plugin__kubevirt-plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,7 @@
"GN Series": "GN Series",
"gn1": "gn1",
"Go to catalog": "Go to catalog",
"Golden image no DataSource": "Golden image no DataSource",
"Golden image not up to date": "Golden image not up to date",
"GPU devices": "GPU devices",
"GPU devices ({{gpusCount}})": "GPU devices ({{gpusCount}})",
Expand Down Expand Up @@ -942,6 +943,7 @@
"PVC": "PVC",
"PVC (auto import)": "PVC (auto import)",
"PVC (clone PVC)": "PVC (clone PVC)",
"PVC bound": "PVC bound",
"PVC name": "PVC name",
"PVC project": "PVC project",
"Quick create error": "Quick create error",
Expand Down Expand Up @@ -1168,6 +1170,7 @@
"Storage used": "Storage used",
"Storage with ReadWriteMany": "Storage with ReadWriteMany",
"StorageClass": "StorageClass",
"StorageProfiles with smart clone support (CSI/snapshot)": "StorageProfiles with smart clone support (CSI/snapshot)",
"StorageProfiles with spec claimPropertySets": "StorageProfiles with spec claimPropertySets",
"Store the key in a project secret.": "Store the key in a project secret.",
"Succeeded": "Succeeded",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,18 @@ import {
STORAGE_CHECKUP_LIVE_MIGRATION,
STORAGE_CHECKUP_TIMEOUT,
STORAGE_CHECKUPS_BOOT_GOLDEN_IMAGE,
STORAGE_CHECKUPS_GOLDEN_IMAGE_NO_DATA_SOURCE,
STORAGE_CHECKUPS_GOLDEN_IMAGE_NOT_UP_TO_DATE,
STORAGE_CHECKUPS_MISSING_VOLUME_SNAP_SHOT,
STORAGE_CHECKUPS_PVC_BOUND,
STORAGE_CHECKUPS_STORAGE_WITH_RWX,
STORAGE_CHECKUPS_UNSET_EFS_STORAGE_CLASS,
STORAGE_CHECKUPS_VM_HOT_PLUG_VOLUME,
STORAGE_CHECKUPS_VM_VOLUME_CLONE,
STORAGE_CHECKUPS_WITH_CLAIM_PROPERTY_SETS,
STORAGE_CHECKUPS_WITH_EMPTY_CLAIM_PROPERTY_SETS,
STORAGE_CHECKUPS_WITH_NON_RBD_STORAGE_CLASS,
STORAGE_CHECKUPS_WITH_SMART_CLONE,
} from '../utils/utils';

type CheckupsStorageDetailsPageSectionProps = {
Expand All @@ -45,6 +48,7 @@ const CheckupsStorageDetailsPageSection: FC<CheckupsStorageDetailsPageSectionPro
job,
}) => {
const { t } = useKubevirtTranslation();
const none = t('None');

return (
<>
Expand Down Expand Up @@ -76,35 +80,39 @@ const CheckupsStorageDetailsPageSection: FC<CheckupsStorageDetailsPageSectionPro
name={configMap?.data?.[STORAGE_CHECKUP_DEFAULT_STORAGE_CLASS]}
/>
) : (
t('None')
none
)
}
descriptionHeader={t('Default storage class')}
/>
<VirtualMachineDescriptionItem
descriptionData={
configMap?.data?.[STORAGE_CHECKUPS_WITH_CLAIM_PROPERTY_SETS] || t('None')
}
descriptionData={configMap?.data?.[STORAGE_CHECKUPS_PVC_BOUND] || none}
descriptionHeader={t('PVC bound')}
/>
<VirtualMachineDescriptionItem
descriptionData={configMap?.data?.[STORAGE_CHECKUPS_WITH_SMART_CLONE] || none}
descriptionHeader={t('StorageProfiles with smart clone support (CSI/snapshot)')}
/>
<VirtualMachineDescriptionItem
descriptionData={configMap?.data?.[STORAGE_CHECKUPS_WITH_CLAIM_PROPERTY_SETS] || none}
descriptionHeader={t('StorageProfiles with spec claimPropertySets')}
/>
<VirtualMachineDescriptionItem
descriptionData={
configMap?.data?.[STORAGE_CHECKUPS_MISSING_VOLUME_SNAP_SHOT] || t('None')
}
descriptionData={configMap?.data?.[STORAGE_CHECKUPS_MISSING_VOLUME_SNAP_SHOT] || none}
descriptionHeader={t('Storage missing VolumeSnapshotClass')}
/>
<VirtualMachineDescriptionItem
descriptionData={
configMap?.data?.[STORAGE_CHECKUPS_WITH_NON_RBD_STORAGE_CLASS] || t('None')
configMap?.data?.[STORAGE_CHECKUPS_WITH_NON_RBD_STORAGE_CLASS] || none
}
descriptionHeader={t('VirtualMachine with non-virt RBD StorageClass')}
/>
<VirtualMachineDescriptionItem
descriptionData={configMap?.data?.[STORAGE_CHECKUPS_BOOT_GOLDEN_IMAGE] || t('None')}
descriptionData={configMap?.data?.[STORAGE_CHECKUPS_BOOT_GOLDEN_IMAGE] || none}
descriptionHeader={t('VirtualMachine boot from golden image')}
/>
<VirtualMachineDescriptionItem
descriptionData={configMap?.data?.[STORAGE_CHECKUP_LIVE_MIGRATION] || t('None')}
descriptionData={configMap?.data?.[STORAGE_CHECKUP_LIVE_MIGRATION] || none}
descriptionHeader={t('VirtualMachine live migration')}
/>
<VirtualMachineDescriptionItem
Expand All @@ -125,7 +133,7 @@ const CheckupsStorageDetailsPageSection: FC<CheckupsStorageDetailsPageSectionPro
descriptionHeader={t('Namespace')}
/>
<VirtualMachineDescriptionItem
descriptionData={configMap?.data?.[STATUS_FAILURE_REASON] || t('None')}
descriptionData={configMap?.data?.[STATUS_FAILURE_REASON] || none}
descriptionHeader={t('Failure reason')}
/>
<VirtualMachineDescriptionItem
Expand All @@ -138,32 +146,36 @@ const CheckupsStorageDetailsPageSection: FC<CheckupsStorageDetailsPageSectionPro
/>
<VirtualMachineDescriptionItem
descriptionData={
configMap?.data?.[STORAGE_CHECKUPS_WITH_EMPTY_CLAIM_PROPERTY_SETS] || t('None')
configMap?.data?.[STORAGE_CHECKUPS_WITH_EMPTY_CLAIM_PROPERTY_SETS] || none
}
descriptionHeader={t('Storage class with empty claimPropertySets')}
/>
<VirtualMachineDescriptionItem
descriptionData={configMap?.data?.[STORAGE_CHECKUPS_STORAGE_WITH_RWX] || t('None')}
descriptionData={configMap?.data?.[STORAGE_CHECKUPS_STORAGE_WITH_RWX] || none}
descriptionHeader={t('Storage with ReadWriteMany')}
/>
<VirtualMachineDescriptionItem
descriptionData={
configMap?.data?.[STORAGE_CHECKUPS_GOLDEN_IMAGE_NOT_UP_TO_DATE] || t('None')
configMap?.data?.[STORAGE_CHECKUPS_GOLDEN_IMAGE_NOT_UP_TO_DATE] || none
}
descriptionHeader={t('Golden image not up to date')}
/>
<VirtualMachineDescriptionItem
descriptionData={
configMap?.data?.[STORAGE_CHECKUPS_UNSET_EFS_STORAGE_CLASS] || t('None')
configMap?.data?.[STORAGE_CHECKUPS_GOLDEN_IMAGE_NO_DATA_SOURCE] || none
}
descriptionHeader={t('Golden image no DataSource')}
/>
<VirtualMachineDescriptionItem
descriptionData={configMap?.data?.[STORAGE_CHECKUPS_UNSET_EFS_STORAGE_CLASS] || none}
descriptionHeader={t('VirtualMachine with unset EFS StorageClass')}
/>
<VirtualMachineDescriptionItem
descriptionData={configMap?.data?.[STORAGE_CHECKUPS_VM_VOLUME_CLONE] || t('None')}
descriptionData={configMap?.data?.[STORAGE_CHECKUPS_VM_VOLUME_CLONE] || none}
descriptionHeader={t('VirtualMachine volume clone')}
/>
<VirtualMachineDescriptionItem
descriptionData={configMap?.data?.[STORAGE_CHECKUPS_VM_HOT_PLUG_VOLUME] || t('None')}
descriptionData={configMap?.data?.[STORAGE_CHECKUPS_VM_HOT_PLUG_VOLUME] || none}
descriptionHeader={t('VirtualMachine hotplug volume')}
/>
<VirtualMachineDescriptionItem
Expand Down
10 changes: 7 additions & 3 deletions src/views/checkups/storage/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,17 @@ export const STORAGE_CHECKUP_TIMEOUT = 'spec.timeout';
export const STORAGE_CHECKUP_DEFAULT_STORAGE_CLASS = 'status.result.defaultStorageClass';
export const STORAGE_CHECKUP_LIVE_MIGRATION = 'status.result.vmLiveMigration';
export const STORAGE_CHECKUPS_GOLDEN_IMAGE_NOT_UP_TO_DATE = 'status.result.goldenImagesNotUpToDate';
export const STORAGE_CHECKUPS_GOLDEN_IMAGE_NO_DATA_SOURCE =
'status.result.goldenImagesNoDataSource';
export const STORAGE_CHECKUPS_WITH_SMART_CLONE = 'status.result.storageProfilesWithSmartClone';
export const STORAGE_CHECKUPS_PVC_BOUND = 'status.result.pvcBound';
export const STORAGE_CHECKUPS_MISSING_VOLUME_SNAP_SHOT =
'status.result.storageMissingVolumeSnapshotClass';
'status.result.storageProfileMissingVolumeSnapshotClass';
export const STORAGE_CHECKUPS_WITH_CLAIM_PROPERTY_SETS =
'status.result.storageProfilesWithSpecClaimPropertySets';
export const STORAGE_CHECKUPS_WITH_EMPTY_CLAIM_PROPERTY_SETS =
'storageProfilesWithEmptyClaimPropertySets';
export const STORAGE_CHECKUPS_STORAGE_WITH_RWX = 'status.result.storageWithRWX';
'status.result.storageProfilesWithEmptyClaimPropertySets';
export const STORAGE_CHECKUPS_STORAGE_WITH_RWX = 'status.result.storageProfilesWithRWX';
export const STORAGE_CHECKUPS_BOOT_GOLDEN_IMAGE = 'status.result.vmBootFromGoldenImage';
export const STORAGE_CHECKUPS_VM_HOT_PLUG_VOLUME = 'status.result.vmHotplugVolume';
export const STORAGE_CHECKUPS_VM_VOLUME_CLONE = 'status.result.vmVolumeClone';
Expand Down

0 comments on commit 7dd4be0

Please sign in to comment.