Fixing K8s PVC mounting

pull/289/head
mdugdale 2021-08-21 19:51:01 +01:00
parent a6af0478a3
commit 52612c8a89
4 changed files with 3 additions and 5 deletions

3
dist/index.js vendored
View File

@ -1325,8 +1325,6 @@ class Kubernetes {
core.info('Creating build job');
yield this.kubeClientBatch.createNamespacedJob(this.namespace, jobSpec);
core.info('Job created');
yield kubernetes_storage_1.default.watchUntilPVCNotPending(this.kubeClient, this.pvcName, this.namespace);
core.info('PVC Bound');
this.setPodNameAndContainerName(yield kubernetes_utils_1.default.findPodFromJob(this.kubeClient, this.jobName, this.namespace));
core.info('Watching pod until running');
yield kubernetes_utils_1.default.watchUntilPodRunning(this.kubeClient, this.podName, this.namespace);
@ -1927,6 +1925,7 @@ class KubernetesStorage {
};
const result = yield kubeClient.createNamespacedPersistentVolumeClaim(namespace, pvc);
core.info(`Persistent Volume Claim ${(_a = result.body.metadata) === null || _a === void 0 ? void 0 : _a.name} ${pvcName} created`);
yield this.watchUntilPVCNotPending(kubeClient, pvcName, namespace);
core.setOutput('volume', pvcName);
});
}

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -104,8 +104,6 @@ class Kubernetes implements CloudRunnerProviderInterface {
core.info('Creating build job');
await this.kubeClientBatch.createNamespacedJob(this.namespace, jobSpec);
core.info('Job created');
await KubernetesStorage.watchUntilPVCNotPending(this.kubeClient, this.pvcName, this.namespace);
core.info('PVC Bound');
this.setPodNameAndContainerName(
await KubernetesUtilities.findPodFromJob(this.kubeClient, this.jobName, this.namespace),
);

View File

@ -51,6 +51,7 @@ class KubernetesStorage {
};
const result = await kubeClient.createNamespacedPersistentVolumeClaim(namespace, pvc);
core.info(`Persistent Volume Claim ${result.body.metadata?.name} ${pvcName} created`);
await this.watchUntilPVCNotPending(kubeClient, pvcName, namespace);
core.setOutput('volume', pvcName);
}
}