diff --git a/packages/testcontainers/src/container-runtime/clients/client.ts b/packages/testcontainers/src/container-runtime/clients/client.ts index 59321607f..32ea68a1c 100644 --- a/packages/testcontainers/src/container-runtime/clients/client.ts +++ b/packages/testcontainers/src/container-runtime/clients/client.ts @@ -17,7 +17,7 @@ import { DockerImageClient } from "./image/docker-image-client"; import { ImageClient } from "./image/image-client"; import { DockerNetworkClient } from "./network/docker-network-client"; import { NetworkClient } from "./network/network-client"; -import { ComposeInfo, ContainerRuntimeInfo, Info, NodeInfo } from "./types"; +import { ContainerRuntimeInfo, Info, NodeInfo } from "./types"; export class ContainerRuntimeClient { constructor( @@ -123,9 +123,7 @@ async function initStrategy(strategy: ContainerRuntimeClientStrategy): Promise): Promise; pull(options: ComposeOptions, services?: Array): Promise; stop(options: ComposeOptions): Promise; @@ -13,18 +12,14 @@ export interface ComposeClient { export async function getComposeClient(environment: NodeJS.ProcessEnv): Promise { try { - const version = (await compose.version()).data.version; - return new DockerComposeClient(version, environment); + return new DockerComposeClient(environment); } catch (err) { - return new MissingComposeClient("N/A"); + return new MissingComposeClient(); } } class DockerComposeClient implements ComposeClient { - constructor( - public readonly version: string, - private readonly environment: NodeJS.ProcessEnv - ) {} + constructor(private readonly environment: NodeJS.ProcessEnv) {} async up(options: ComposeOptions, services: Array | undefined): Promise { try { @@ -94,7 +89,7 @@ class DockerComposeClient implements ComposeClient { } class MissingComposeClient implements ComposeClient { - constructor(public readonly version: string) {} + constructor() {} up(): Promise { throw new Error("Compose is not installed"); diff --git a/packages/testcontainers/src/container-runtime/clients/types.ts b/packages/testcontainers/src/container-runtime/clients/types.ts index baa9e9e53..ca2b38a46 100644 --- a/packages/testcontainers/src/container-runtime/clients/types.ts +++ b/packages/testcontainers/src/container-runtime/clients/types.ts @@ -1,7 +1,6 @@ export type Info = { node: NodeInfo; containerRuntime: ContainerRuntimeInfo; - compose: ComposeInfo; }; export type NodeInfo = { @@ -25,6 +24,4 @@ export type ContainerRuntimeInfo = { labels: string[]; }; -export type ComposeInfo = string; - export type HostIp = { address: string; family: number };