Skip to content

Commit

Permalink
Merge pull request red-hat-storage#1404 from bipuladh/fix-client-fall…
Browse files Browse the repository at this point in the history
…back

Remove storage class prefix for client deployments
  • Loading branch information
openshift-merge-bot[bot] authored May 23, 2024
2 parents d59156f + 8253676 commit 241c066
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
TitleWithHelp,
} from '../persistent-internal/capacity-breakdown-card/capacity-breakdown-card';
import '../persistent-internal/capacity-breakdown-card/capacity-breakdown-card.scss';
import useClientFallback from './fallback-hook';
import getClientFallback from './client-fallback';

export const BreakdownCard: React.FC = () => {
const { t } = useCustomTranslation();
Expand All @@ -47,7 +47,7 @@ export const BreakdownCard: React.FC = () => {

// name of created StorageClasses are prefix by StorageCluster name
const storageClassName = systemFlags?.[clusterNs]?.ocsClusterName;
const storageClassNamePrefix = useClientFallback(storageClassName);
const storageClassNamePrefix = getClientFallback(storageClassName);

const { queries, model, metric } = getBreakdownMetricsQuery(
metricType,
Expand Down
13 changes: 13 additions & 0 deletions packages/ocs/dashboards/persistent-external/client-fallback.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* This hooks is for ODF Client Mode use case only.
* ODF client mode doesn't deploy ODF StorageCluster hence we will use no storage class prefix. We will rely on provisioners
*
*/
const getClientFallback = (storageClusterName: string) => {
if (storageClusterName) {
return storageClusterName;
}
return '';
};

export default getClientFallback;
37 changes: 0 additions & 37 deletions packages/ocs/dashboards/persistent-external/fallback-hook.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
INDEPENDENT_UTILIZATION_QUERIES,
} from '../../queries';
import { ODFSystemParams } from '../../types';
import useClientFallback from './fallback-hook';
import getClientFallback from './client-fallback';

export const UtilizationContent: React.FC = () => {
const { t } = useCustomTranslation();
Expand All @@ -25,7 +25,7 @@ export const UtilizationContent: React.FC = () => {

// name of created StorageClasses are prefix by StorageCluster name
const storageClassName = systemFlags?.[clusterNs]?.ocsClusterName;
const storageClassNamePrefix = useClientFallback(storageClassName);
const storageClassNamePrefix = getClientFallback(storageClassName);

return (
<UtilizationBody>
Expand Down

0 comments on commit 241c066

Please sign in to comment.