Skip to content

Commit 5597ffa

Browse files
fix: disable download kubeconfig when apiserver not configured (#584)
* fix: disable download kubeconfig when apiserver not configured * fix: apiServer in otomiApi --------- Co-authored-by: Ferruh <63190600+ferruhcihan@users.noreply.github.com>
1 parent 18494d6 commit 5597ffa

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/components/NavConfig.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ export default function NavConfig() {
1313
const { ca, appsEnabled, oboTeamId, user, settings } = useSession()
1414
const hasExternalIDP = settings?.otomi?.hasExternalIDP ?? false
1515
const isManaged = settings?.otomi?.isPreInstalled ?? false
16+
const hasApiServerConfigured = settings?.cluster?.apiServer ?? false
17+
1618
const downloadOpts = {
1719
data: ca ?? '',
1820
title: 'Click to download the custom root CA used to generate the browser certs.',
@@ -90,7 +92,7 @@ export default function NavConfig() {
9092
title: 'Download KUBECFG',
9193
path: `/api/v1/kubecfg/${oboTeamId}`,
9294
icon: getIcon('download_icon.svg'),
93-
disabled: oboTeamId === 'admin' || !canDo(user, oboTeamId, 'downloadKubeconfig'),
95+
disabled: oboTeamId === 'admin' || !canDo(user, oboTeamId, 'downloadKubeconfig') || !hasApiServerConfigured,
9496
isDownload: true,
9597
},
9698
{

src/redux/otomiApi.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7244,6 +7244,7 @@ export type GetSettingsInfoApiResponse = /** status 200 The request is successfu
72447244
cluster?: {
72457245
name?: string
72467246
domainSuffix?: string
7247+
apiServer?: string
72477248
provider?: 'linode' | 'custom'
72487249
}
72497250
dns?: {

0 commit comments

Comments
 (0)