Fixing K8s PVC mounting
parent
a6af0478a3
commit
52612c8a89
|
|
@ -1325,8 +1325,6 @@ class Kubernetes {
|
||||||
core.info('Creating build job');
|
core.info('Creating build job');
|
||||||
yield this.kubeClientBatch.createNamespacedJob(this.namespace, jobSpec);
|
yield this.kubeClientBatch.createNamespacedJob(this.namespace, jobSpec);
|
||||||
core.info('Job created');
|
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));
|
this.setPodNameAndContainerName(yield kubernetes_utils_1.default.findPodFromJob(this.kubeClient, this.jobName, this.namespace));
|
||||||
core.info('Watching pod until running');
|
core.info('Watching pod until running');
|
||||||
yield kubernetes_utils_1.default.watchUntilPodRunning(this.kubeClient, this.podName, this.namespace);
|
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);
|
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`);
|
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);
|
core.setOutput('volume', pvcName);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -104,8 +104,6 @@ class Kubernetes implements CloudRunnerProviderInterface {
|
||||||
core.info('Creating build job');
|
core.info('Creating build job');
|
||||||
await this.kubeClientBatch.createNamespacedJob(this.namespace, jobSpec);
|
await this.kubeClientBatch.createNamespacedJob(this.namespace, jobSpec);
|
||||||
core.info('Job created');
|
core.info('Job created');
|
||||||
await KubernetesStorage.watchUntilPVCNotPending(this.kubeClient, this.pvcName, this.namespace);
|
|
||||||
core.info('PVC Bound');
|
|
||||||
this.setPodNameAndContainerName(
|
this.setPodNameAndContainerName(
|
||||||
await KubernetesUtilities.findPodFromJob(this.kubeClient, this.jobName, this.namespace),
|
await KubernetesUtilities.findPodFromJob(this.kubeClient, this.jobName, this.namespace),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,7 @@ class KubernetesStorage {
|
||||||
};
|
};
|
||||||
const result = await kubeClient.createNamespacedPersistentVolumeClaim(namespace, pvc);
|
const result = await kubeClient.createNamespacedPersistentVolumeClaim(namespace, pvc);
|
||||||
core.info(`Persistent Volume Claim ${result.body.metadata?.name} ${pvcName} created`);
|
core.info(`Persistent Volume Claim ${result.body.metadata?.name} ${pvcName} created`);
|
||||||
|
await this.watchUntilPVCNotPending(kubeClient, pvcName, namespace);
|
||||||
core.setOutput('volume', pvcName);
|
core.setOutput('volume', pvcName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue