test k8s on startup by listing namespaces to confirm kubeclient access
parent
b759bce664
commit
61071092c1
|
|
@ -3034,6 +3034,8 @@ class Kubernetes {
|
||||||
this.secretName = `build-credentials-${this.buildGuid}`;
|
this.secretName = `build-credentials-${this.buildGuid}`;
|
||||||
this.jobName = `unity-builder-job-${this.buildGuid}`;
|
this.jobName = `unity-builder-job-${this.buildGuid}`;
|
||||||
this.containerName = `main`;
|
this.containerName = `main`;
|
||||||
|
const namespaceListTest = yield this.kubeClient.listNamespace();
|
||||||
|
cloud_runner_logger_1.default.log(`Init test ${namespaceListTest.body.items.length}`);
|
||||||
yield kubernetes_secret_1.default.createSecret(secrets, this.secretName, this.namespace, this.kubeClient);
|
yield kubernetes_secret_1.default.createSecret(secrets, this.secretName, this.namespace, this.kubeClient);
|
||||||
yield this.createNamespacedJob(commands, image, mountdir, workingdir, environment, secrets);
|
yield this.createNamespacedJob(commands, image, mountdir, workingdir, environment, secrets);
|
||||||
this.setPodNameAndContainerName(yield Kubernetes.findPodFromJob(this.kubeClient, this.jobName, this.namespace));
|
this.setPodNameAndContainerName(yield Kubernetes.findPodFromJob(this.kubeClient, this.jobName, this.namespace));
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -113,6 +113,8 @@ class Kubernetes implements ProviderInterface {
|
||||||
this.secretName = `build-credentials-${this.buildGuid}`;
|
this.secretName = `build-credentials-${this.buildGuid}`;
|
||||||
this.jobName = `unity-builder-job-${this.buildGuid}`;
|
this.jobName = `unity-builder-job-${this.buildGuid}`;
|
||||||
this.containerName = `main`;
|
this.containerName = `main`;
|
||||||
|
const namespaceListTest = await this.kubeClient.listNamespace();
|
||||||
|
CloudRunnerLogger.log(`Init test ${namespaceListTest.body.items.length}`);
|
||||||
await KubernetesSecret.createSecret(secrets, this.secretName, this.namespace, this.kubeClient);
|
await KubernetesSecret.createSecret(secrets, this.secretName, this.namespace, this.kubeClient);
|
||||||
await this.createNamespacedJob(commands, image, mountdir, workingdir, environment, secrets);
|
await this.createNamespacedJob(commands, image, mountdir, workingdir, environment, secrets);
|
||||||
this.setPodNameAndContainerName(await Kubernetes.findPodFromJob(this.kubeClient, this.jobName, this.namespace));
|
this.setPodNameAndContainerName(await Kubernetes.findPodFromJob(this.kubeClient, this.jobName, this.namespace));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue