Skip to content

Commit 937b93c

Browse files
authored
Merge pull request #2722 from devtron-labs/fix/bulk-drain
fix: super admin check for cluster config
2 parents d74acb3 + 5c95734 commit 937b93c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/ClusterNodes/ClusterOverview.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import {
3131
StatusComponent,
3232
StatusType,
3333
useAsync,
34+
useMainContext,
3435
} from '@devtron-labs/devtron-fe-common-lib'
3536

3637
import { getUpgradeCompatibilityTippyConfig } from '@Components/ResourceBrowser/ResourceList/utils'
@@ -120,6 +121,8 @@ function ClusterOverview({ selectedCluster, addTab }: ClusterOverviewProps) {
120121
namespace: string
121122
}>()
122123

124+
const { isSuperAdmin } = useMainContext()
125+
123126
const history = useHistory()
124127
const { path } = useRouteMatch()
125128
const [clusterConfig, setClusterConfig] = useState<InstallationClusterConfigType | null>(null)
@@ -129,7 +132,7 @@ function ClusterOverview({ selectedCluster, addTab }: ClusterOverviewProps) {
129132
const getClusterConfigAbortControllerRef = useRef(new AbortController())
130133

131134
const fetchClusterConfig = async (clusterName: string) => {
132-
if (!getInstallationClusterConfig) {
135+
if (!getInstallationClusterConfig || !isSuperAdmin) {
133136
return
134137
}
135138

0 commit comments

Comments
 (0)