Skip to content

Commit 56960a3

Browse files
authored
Unexport LINUX_CAPABILITY_MAP from capability-filter.ts (#7928)
* Initial plan * fix: unexport LINUX_CAPABILITY_MAP, expose via testHelpers --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent 037c1fc commit 56960a3

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/capability-filter.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ import {
66
isCapDropSkipped,
77
filterCapDrop,
88
filterComposeCapDrop,
9-
LINUX_CAPABILITY_MAP,
9+
testHelpers,
1010
} from './capability-filter';
11+
12+
const { LINUX_CAPABILITY_MAP } = testHelpers;
1113
import { DockerComposeConfig } from './types';
1214
import { generateDockerCompose } from './compose-generator';
1315
import { WrapperConfig } from './types';

src/capability-filter.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { getLocalDockerEnv } from './docker-host';
77
* Map of standard Linux capability names (uppercase, without CAP_ prefix) to bit positions in CapBnd.
88
* Reference: Linux kernel include/uapi/linux/capability.h
99
*/
10-
export const LINUX_CAPABILITY_MAP: Record<string, number> = {
10+
const LINUX_CAPABILITY_MAP: Record<string, number> = {
1111
CHOWN: 0,
1212
DAC_OVERRIDE: 1,
1313
DAC_READ_SEARCH: 2,
@@ -164,3 +164,7 @@ export function filterComposeCapDrop(
164164
}
165165
return composeConfig;
166166
}
167+
168+
/** @internal Exposed for unit tests only. */
169+
// ts-prune-ignore-next
170+
export const testHelpers = { LINUX_CAPABILITY_MAP };

0 commit comments

Comments
 (0)