Skip to content

Commit

Permalink
CNV-48451: Windows autoattend.xml can not be created as a regular user
Browse files Browse the repository at this point in the history
Signed-off-by: Aviv Turgeman <[email protected]>
  • Loading branch information
avivtur committed Sep 18, 2024
1 parent 3b71631 commit 241c160
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/utils/components/SysprepModal/hooks/useConfigMaps.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ConfigMapModel, modelToGroupVersionKind } from '@kubevirt-ui/kubevirt-api/console';
import { IoK8sApiCoreV1ConfigMap } from '@kubevirt-ui/kubevirt-api/kubernetes';
import { isEmpty } from '@kubevirt-utils/utils/utils';
import { useK8sWatchResource, WatchK8sResult } from '@openshift-console/dynamic-plugin-sdk';

import { AUTOUNATTEND, UNATTEND } from '../sysprep-utils';
Expand All @@ -16,7 +17,10 @@ const useSysprepConfigMaps = (namespace: string): WatchK8sResult<IoK8sApiCoreV1C
namespace,
namespaced: true,
});

const sysprepConfigMaps = configmaps?.filter((configmap) => {
if (isEmpty(configmap?.data)) return false;

const dataKeys = Object.keys(configmap?.data);
const hasSysprepXMLData = dataKeys.some((key) => {
return (
Expand Down

0 comments on commit 241c160

Please sign in to comment.