Skip to content

Commit a20c89d

Browse files
committed
fix: add check for v2 enabled in check vulnerability button
1 parent 2ee4950 commit a20c89d

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/components/ResourceBrowser/ResourceList/ResourceBrowserActionMenu.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,12 @@ const ResourceBrowserActionMenu: React.FC<ResourceBrowserActionMenuType> = ({
9999
setShowVulnerabilityModal(false)
100100
}
101101

102-
const showResourceScanModal = getShowResourceScanModal(
103-
selectedResource?.gvk?.Kind as NodeType,
104-
installedModuleMap.current?.[ModuleNameMap.SECURITY_TRIVY],
105-
)
102+
const showResourceScanModal =
103+
getShowResourceScanModal(
104+
selectedResource?.gvk?.Kind as NodeType,
105+
installedModuleMap.current?.[ModuleNameMap.SECURITY_TRIVY],
106+
) && window._env_.ENABLE_RESOURCE_SCAN_V2
107+
106108
return (
107109
<>
108110
<PopupMenu autoClose>

src/components/v2/appDetails/k8Resource/nodeType/PodPopup.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,9 @@ const PodPopup = ({
3131
handleShowVulnerabilityModal,
3232
}: PodPopupProps) => {
3333
const { installedModuleMap } = useMainContext()
34-
const showResourceScanModal = getShowResourceScanModal(
35-
kind as NodeType,
36-
installedModuleMap.current?.[ModuleNameMap.SECURITY_TRIVY],
37-
)
34+
const showResourceScanModal =
35+
window._env_.ENABLE_RESOURCE_SCAN_V2 &&
36+
getShowResourceScanModal(kind as NodeType, installedModuleMap.current?.[ModuleNameMap.SECURITY_TRIVY])
3837

3938
const handleDescribeEvents = () => {
4039
describeNode(NodeDetailTabs.EVENTS)

0 commit comments

Comments
 (0)