Skip to content

Commit 04a1aad

Browse files
Docker runtimes may be undefined (#795)
1 parent 794ebc4 commit 04a1aad

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

packages/modules/ollama/src/ollama-container.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
import {
2-
AbstractStartedContainer,
3-
GenericContainer,
4-
getContainerRuntimeClient,
5-
StartedTestContainer,
6-
Wait,
7-
} from "testcontainers";
1+
import { AbstractStartedContainer, GenericContainer, getContainerRuntimeClient, Wait } from "testcontainers";
82

93
export const OLLAMA_PORT = 11434;
104

@@ -34,10 +28,6 @@ export class OllamaContainer extends GenericContainer {
3428
}
3529

3630
export class StartedOllamaContainer extends AbstractStartedContainer {
37-
constructor(startedTestContainer: StartedTestContainer) {
38-
super(startedTestContainer);
39-
}
40-
4131
public getPort(): number {
4232
return this.startedTestContainer.getMappedPort(OLLAMA_PORT);
4333
}

packages/testcontainers/src/container-runtime/clients/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ async function initStrategy(strategy: ContainerRuntimeClientStrategy): Promise<C
122122
architecture: dockerodeInfo.Architecture,
123123
cpus: dockerodeInfo.NCPU,
124124
memory: dockerodeInfo.MemTotal,
125-
runtimes: Object.keys(dockerodeInfo.Runtimes),
125+
runtimes: dockerodeInfo.Runtimes ? Object.keys(dockerodeInfo.Runtimes) : [],
126126
};
127127

128128
const composeInfo: ComposeInfo = composeClient.info;

0 commit comments

Comments
 (0)