Skip to content

Commit

Permalink
adding customkubeconfig to HostedClusterK8sResource type
Browse files Browse the repository at this point in the history
  • Loading branch information
nitin-dhevar committed Feb 25, 2025
1 parent ba0292b commit 41b8af1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ const HypershiftKubeconfigDownload = ({
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 @@ -41,7 +43,7 @@ const HypershiftKubeconfigDownload = ({
variant={ButtonVariant.secondary}
// eslint-disable-next-line @typescript-eslint/no-misused-promises
onClick={handleKubeconfigDownload}
isDisabled={!hostedCluster.status?.kubeconfig?.name}
isDisabled={!kubeconfigSecretName}
>
{t('ai:Download kubeconfig')}
</Button>
Expand Down
9 changes: 6 additions & 3 deletions libs/ui-lib/lib/cim/components/Hypershift/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ export type HostedClusterK8sResource = K8sResourceCommon & {
endpointAccess: 'Public';
kubeCloudControllerCreds: { name?: string };
nodePoolManagementCreds: { name?: string };
region: 'us-west-2';
region: string;
resourceTags: [
{
key: 'kubernetes.io/cluster/feng-hs-scale-74zxh';
value: 'owned';
key: string;
value: string;
},
];
};
Expand All @@ -157,6 +157,9 @@ export type HostedClusterK8sResource = K8sResourceCommon & {
kubeconfig?: {
name: string;
};
customkubeconfig?: {
name: string;
};
kubeadminPassword?: {
name: string;
};
Expand Down

0 comments on commit 41b8af1

Please sign in to comment.