Add application migration workflow.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -22,6 +22,7 @@ import { CreateClusterPoolDto, UpdateClusterPoolDto } from './dto/cluster-pool.d
|
||||
import { ClusterStatus } from '../common/enums';
|
||||
import { ElasticsearchService } from '../kubernetes/elasticsearch.service';
|
||||
import { CreateApplicationDto } from '../applications/dto/application.dto';
|
||||
import { registerKubeconfigNoProxy } from '../common/kubernetes-proxy.util';
|
||||
|
||||
@Injectable()
|
||||
export class ClustersService implements OnModuleInit, OnModuleDestroy {
|
||||
@@ -77,8 +78,11 @@ export class ClustersService implements OnModuleInit, OnModuleDestroy {
|
||||
*/
|
||||
async testConnection(kubeconfig: string): Promise<{ connected: boolean; version?: string; error?: string }> {
|
||||
try {
|
||||
const decryptedKubeconfig = this.decryptKubeconfig(kubeconfig);
|
||||
registerKubeconfigNoProxy(decryptedKubeconfig);
|
||||
|
||||
const kc = new k8s.KubeConfig();
|
||||
kc.loadFromString(this.decryptKubeconfig(kubeconfig));
|
||||
kc.loadFromString(decryptedKubeconfig);
|
||||
|
||||
const versionApi = kc.makeApiClient(k8s.VersionApi);
|
||||
const result = await versionApi.getCode();
|
||||
@@ -702,6 +706,7 @@ export class ClustersService implements OnModuleInit, OnModuleDestroy {
|
||||
}
|
||||
|
||||
const kc = new k8s.KubeConfig();
|
||||
registerKubeconfigNoProxy(cluster.kubeconfig);
|
||||
kc.loadFromString(cluster.kubeconfig);
|
||||
const coreApi = kc.makeApiClient(k8s.CoreV1Api);
|
||||
|
||||
@@ -825,6 +830,7 @@ export class ClustersService implements OnModuleInit, OnModuleDestroy {
|
||||
*/
|
||||
async bootstrapCluster(kubeconfig: string): Promise<void> {
|
||||
const kc = new k8s.KubeConfig();
|
||||
registerKubeconfigNoProxy(kubeconfig);
|
||||
kc.loadFromString(kubeconfig);
|
||||
const coreApi = kc.makeApiClient(k8s.CoreV1Api);
|
||||
const appsApi = kc.makeApiClient(k8s.AppsV1Api);
|
||||
|
||||
Reference in New Issue
Block a user