Skip to content

Commit

Permalink
Merge pull request #1649 from SanjalKatiyar/not_found_encryption
Browse files Browse the repository at this point in the history
Bug 2312118: Fix 'Not Found' error with encryption form
  • Loading branch information
openshift-merge-bot[bot] authored Oct 21, 2024
2 parents c5952c7 + 861fdcf commit 637f39f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/ocs/storage-class/sc-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ import {
} from '@odf/shared/types';
import { useCustomTranslation } from '@odf/shared/useCustomTranslationHook';
import { isOCSStorageSystem, referenceForModel } from '@odf/shared/utils';
import { getInfrastructurePlatform } from '@odf/shared/utils';
import { getInfrastructurePlatform, isNotFoundError } from '@odf/shared/utils';
import {
ProvisionerProps,
useK8sWatchResource,
Expand Down Expand Up @@ -930,7 +930,7 @@ export const StorageClassEncryptionKMSID: React.FC<ProvisionerProps> = ({
<StatusBox
loadError={
infraLoadError ||
csiConfigMapLoadError ||
(!isNotFoundError(csiConfigMapLoadError) && csiConfigMapLoadError) ||
secretsLoadError ||
odfNsLoadError
}
Expand Down
3 changes: 3 additions & 0 deletions packages/shared/src/utils/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ const betaDefaultStorageClassAnnotation =
'storageclass.beta.kubernetes.io/is-default-class';
export const LAST_LANGUAGE_LOCAL_STORAGE_KEY = 'bridge/last-language';

export const isNotFoundError = (loadError): boolean =>
_.get(loadError, 'response.status') === 404;

export const getAPIVersionForModel: GetAPIVersionForModel = (model) =>
!model?.apiGroup ? model.apiVersion : `${model.apiGroup}/${model.apiVersion}`;

Expand Down

0 comments on commit 637f39f

Please sign in to comment.