Skip to content

Commit 9e19646

Browse files
committed
more
1 parent dac3698 commit 9e19646

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/lib/clusters/clusters.tsx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ import type { Command } from "commander";
22
import { apiClient } from "../../apiClient.ts";
33
import { logAndQuit } from "../../helpers/errors.ts";
44
import { decryptSecret, getKeys } from "./keys.tsx";
5+
import { createKubeConfigString } from "./kubeconfig.ts";
6+
import { Box, render, Text } from "ink";
7+
import React from "react";
58

69
export function registerClusters(program: Command) {
710
const clusters = program
@@ -183,6 +186,20 @@ async function listClusterUsersAction({ returnJson, token }: { returnJson?: bool
183186
continue;
184187
}
185188
const res = decryptSecret(item.encrypted_token, privateKey);
186-
console.log(res);
189+
190+
const kubeconfig = createKubeConfigString({
191+
cluster: {
192+
name: item.cluster.name,
193+
kubernetesApiUrl: item.cluster.kubernetes_api_url || "",
194+
certificateAuthorityData: item.cluster.kubernetes_ca_cert || "",
195+
namespace: item.cluster.kubernetes_namespace || "",
196+
},
197+
user: {
198+
name: item.username || "",
199+
token: res,
200+
},
201+
});
202+
203+
console.log(kubeconfig, "\n#--\n\n");
187204
}
188205
}

0 commit comments

Comments
 (0)