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
7 changes: 7 additions & 0 deletions src/image-resolver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
resolveRuntimeImage,
validateCustomImageManifest,
} from './image-resolver';
import * as imageResolverExports from './image-resolver';
import { parseImageTag } from './image-tag';
import type { WrapperConfig } from './types';
import { validateAwfFileConfig } from './config-file';
Expand All @@ -26,6 +27,12 @@ describe('custom runtime image manifest', () => {
resetRuntimeImageLedger();
});

it('keeps default image constants internal to the resolver', () => {
expect(imageResolverExports).not.toHaveProperty('DEFAULT_IMAGE_REGISTRY');
expect(imageResolverExports).not.toHaveProperty('DEFAULT_DIND_STAGING_IMAGE');
expect(imageResolverExports).not.toHaveProperty('DEFAULT_DOH_PROXY_IMAGE');
});

it('resolves only the digest-pinned configured image', () => {
const result = resolveRuntimeImage(
config({ squid: image('squid') }),
Expand Down
6 changes: 3 additions & 3 deletions src/image-resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ const MANIFEST_KEY: Record<RuntimeImageName, ManifestKey> = {
'doh-proxy': 'dohProxy',
};

export const DEFAULT_IMAGE_REGISTRY = 'ghcr.io/github/gh-aw-firewall';
export const DEFAULT_DIND_STAGING_IMAGE = 'ghcr.io/github/gh-aw-firewall/agent:latest';
export const DEFAULT_DOH_PROXY_IMAGE = 'cloudflare/cloudflared:latest';
const DEFAULT_IMAGE_REGISTRY = 'ghcr.io/github/gh-aw-firewall';
const DEFAULT_DIND_STAGING_IMAGE = 'ghcr.io/github/gh-aw-firewall/agent:latest';
const DEFAULT_DOH_PROXY_IMAGE = 'cloudflare/cloudflared:latest';

/**
* Roles whose default (non-manifest) image is not published under the AWF
Expand Down
Loading