Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ACM-17500: Adding customkubeconfig to HostedClusterK8sResource type #2809

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading