Skip to content

Commit

Permalink
adding custom kubeconfig in hypershift download
Browse files Browse the repository at this point in the history
Signed-off-by: Nitin Dhevar <[email protected]>
  • Loading branch information
nitin-dhevar committed Feb 26, 2025
1 parent cf1fc2c commit f1587d4
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ type HypershiftKubeconfigDownloadProps = {

const HypershiftKubeconfigDownload = ({ hostedCluster, fetchSecret }: HypershiftKubeconfigDownloadProps) => {
const { t } = useTranslation()
const kubeconfigSecretName = hostedCluster?.status?.customkubeconfig
? hostedCluster.status.customkubeconfig?.name
: hostedCluster?.status?.kubeconfig?.name
const handleKubeconfigDownload = async () => {
const kubeconfigSecretName = hostedCluster?.status?.kubeconfig?.name
const kubeconfigSecretNamespace = hostedCluster?.metadata?.namespace

if (kubeconfigSecretName && kubeconfigSecretNamespace) {
Expand All @@ -33,11 +35,7 @@ const HypershiftKubeconfigDownload = ({ hostedCluster, fetchSecret }: Hypershift
}

return (
<Button
variant={ButtonVariant.link}
onClick={handleKubeconfigDownload}
isDisabled={!hostedCluster?.status?.kubeconfig?.name}
>
<Button variant={ButtonVariant.link} onClick={handleKubeconfigDownload} isDisabled={!kubeconfigSecretName}>
{t('Download kubeconfig')}
</Button>
)
Expand Down

0 comments on commit f1587d4

Please sign in to comment.