Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/commands/subcommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ import { OutputFormat } from '../types';
* @param validFormats - Array of valid format options
* @throws Exits process with error if format is invalid
*/
export function validateFormat(format: string, validFormats: string[]): void {
function validateFormat(format: string, validFormats: string[]): void {
if (!validFormats.includes(format)) {
logger.error(`Invalid format: ${format}. Must be one of: ${validFormats.join(', ')}`);
process.exit(1);
}
}

/**
* Predownload action handler — exported for testing.
* Module-internal action handler for the `predownload` subcommand.
*/
export async function handlePredownloadAction(options: {
async function handlePredownloadAction(options: {
imageRegistry: string;
imageTag: string;
agentImage: string;
Expand Down
3 changes: 2 additions & 1 deletion src/config-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import * as path from 'path';
import * as yaml from 'js-yaml';
import { validateWithSchema } from './schema-validator';

export interface AwfFileConfig {
/** @internal Used only within config-file.ts — not part of public API */
interface AwfFileConfig {
$schema?: string;
network?: {
allowDomains?: string[];
Expand Down
4 changes: 3 additions & 1 deletion src/host-iptables-network.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { execaResult, mockedExeca, setupHostIptablesTestSuite } from './test-helpers/host-iptables-test-setup';
import { cleanupFirewallNetwork } from './host-iptables-network';
import { testHelpers as networkTestHelpers } from './host-iptables-network';
import { ensureFirewallNetwork } from './host-iptables';
import { testHelpers } from './host-iptables-shared';

const { cleanupFirewallNetwork } = networkTestHelpers;

describe('host-iptables (network)', () => {
setupHostIptablesTestSuite(testHelpers.resetIpv6State);

Expand Down
5 changes: 4 additions & 1 deletion src/host-iptables-network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export async function ensureFirewallNetwork(): Promise<{
/**
* Removes the firewall network
*/
export async function cleanupFirewallNetwork(): Promise<void> {
async function cleanupFirewallNetwork(): Promise<void> {
logger.debug(`Removing firewall network '${NETWORK_NAME}'...`);

try {
Expand All @@ -62,3 +62,6 @@ export async function cleanupFirewallNetwork(): Promise<void> {
// Don't throw - cleanup should be best-effort
}
}

/** @internal Exposed for testing only */
export const testHelpers = { cleanupFirewallNetwork };
Loading