Skip to content

Commit

Permalink
remove volume mounts when execution environment is disabled (#1503)
Browse files Browse the repository at this point in the history
  • Loading branch information
audgirka authored Aug 12, 2024
1 parent 21c587e commit dd2335b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions packages/ansible-language-server/test/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ export async function enableExecutionEnvironmentSettings(
{
src: ANSIBLE_COLLECTIONS_FIXTURES_BASE_PATH,
dest: ANSIBLE_COLLECTIONS_FIXTURES_BASE_PATH,
options: undefined,
options: "ro", // read-only option for volume mounts
},
{
src: ANSIBLE_ADJACENT_COLLECTIONS__PATH,
dest: ANSIBLE_ADJACENT_COLLECTIONS__PATH,
options: undefined,
options: "ro", // read-only option for volume mounts
},
];
}
Expand All @@ -72,6 +72,7 @@ export async function disableExecutionEnvironmentSettings(
docSettings: Thenable<ExtensionSettings>,
): Promise<void> {
(await docSettings).executionEnvironment.enabled = false;
(await docSettings).executionEnvironment.volumeMounts = [];
}

export function resolveDocUri(filename: string): string {
Expand Down
3 changes: 2 additions & 1 deletion test/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,15 @@ export async function enableExecutionEnvironmentSettings(): Promise<void> {
{
src: ANSIBLE_COLLECTIONS_FIXTURES_BASE_PATH,
dest: ANSIBLE_COLLECTIONS_FIXTURES_BASE_PATH,
options: undefined,
options: "ro", // read-only option for volume mounts
},
];
await updateSettings("executionEnvironment.volumeMounts", volumeMounts);
}

export async function disableExecutionEnvironmentSettings(): Promise<void> {
await updateSettings("executionEnvironment.enabled", false);
await updateSettings("executionEnvironment.volumeMounts", []);
}

export async function enableLightspeedSettings(): Promise<void> {
Expand Down

0 comments on commit dd2335b

Please sign in to comment.