Skip to content

Commit 9494535

Browse files
authored
Revert "Resolves: MTV-3618 | can't upload vddk tarball from private namespace…" (#2087)
This reverts commit 73bd919.
1 parent 73bd919 commit 9494535

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/components/VddkUploader/hooks/useVddkBuildImage.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
import { useK8sWatchResource } from '@openshift-console/dynamic-plugin-sdk';
1+
import { useActiveNamespace, useK8sWatchResource } from '@openshift-console/dynamic-plugin-sdk';
2+
import { Namespace } from '@utils/constants';
23
import { isEmpty } from '@utils/helpers';
34
import { getDefaultNamespace } from '@utils/namespaces';
45

56
import type { VddkBuild } from '../utils/types';
67
import { getVddkImageBuildResponse } from '../utils/utils';
78

89
export const useVddkBuildImage = (buildName: string) => {
10+
const [activeNamespace] = useActiveNamespace();
11+
const namespace =
12+
activeNamespace === Namespace.AllProjects ? getDefaultNamespace() : activeNamespace;
13+
914
const [vddkBuild] = useK8sWatchResource<VddkBuild>(
1015
buildName
1116
? {
@@ -15,7 +20,7 @@ export const useVddkBuildImage = (buildName: string) => {
1520
version: 'v1',
1621
},
1722
name: buildName,
18-
namespace: getDefaultNamespace(),
23+
namespace,
1924
}
2025
: null,
2126
);

0 commit comments

Comments
 (0)