fix tests and add inline doc

Signed-off-by: Matteo Silvestri <matteosilv@gmail.com>
This commit is contained in:
Matteo Silvestri
2022-09-02 11:02:44 +02:00
parent 691161fc49
commit c28b1f1826
2 changed files with 22 additions and 2 deletions
@@ -112,9 +112,9 @@ describeIfKubernetes('KubernetesContainerRunner', () => {
},
};
await expect(containerRunner.runContainer(runOptions)).rejects.toThrow(
`Mounted /notWorkdir/app dir should be subdirectories of '${
`Mounted '/notWorkdir/app' dir should be subdirectories of '${
options!.mountBase!.basePath
}`,
}'`,
);
});
@@ -32,11 +32,29 @@ import {
import { v4 as uuid } from 'uuid';
import { Request } from 'request';
/**
* An existing Kubernetes volume that will be used as base for mounts.
*
* Every mount must start with the 'basePath'.
*
* @public
*/
export type MountBaseOptions = {
volumeName: string;
basePath: string;
};
/**
* Options to create a {@link KubernetesContainerRunner}
*
* Kubernetes Jobs will be created on the provided 'namespace'
* and their names will be prefixed with the provided 'name'.
*
* 'podTemplate' defines a Pod template for the Jobs. It has to include
* a volume definition named as the {@link MountBaseOptions} 'volumeName'.
*
* @public
*/
export type KubernetesContainerRunnerOptions = {
kubeConfig: KubeConfig;
name: string;
@@ -49,6 +67,8 @@ export type KubernetesContainerRunnerOptions = {
/**
* A {@link ContainerRunner} for Kubernetes.
*
* Runs containers leveraging Jobs on a Kubernetes cluster
*
* @public
*/
export class KubernetesContainerRunner implements ContainerRunner {