Skip to content

Commit ea6fbec

Browse files
Remove image registry validation for containers on deploy (#11559)
* remove image validation on wrangler deploy * changeset
1 parent 632fb6d commit ea6fbec

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

.changeset/slow-states-arrive.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"wrangler": patch
3+
---
4+
5+
Remove image validation for containers on wrangler deploy.
6+
7+
Internal customers are able to use additional image registries and will run into failures with this validation. Image registry validation will now be handled by the API.

packages/wrangler/src/__tests__/containers/config.test.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ describe("getNormalizedContainerOptions", () => {
652652
});
653653

654654
describe("image validation and resolution", async () => {
655-
it("should reject unsupported image registries", async () => {
655+
it("should allow any image registry", async () => {
656656
const config: Config = {
657657
name: "test-worker",
658658
configPath: "/test/wrangler.toml",
@@ -676,12 +676,11 @@ describe("getNormalizedContainerOptions", () => {
676676
],
677677
},
678678
} as Partial<Config> as Config;
679-
await expect(getNormalizedContainerOptions(config, {})).rejects
680-
.toThrowErrorMatchingInlineSnapshot(`
681-
[Error: docker.io is not a supported image registry.
682-
Currently we support the following non-Cloudflare registries: AWS ECR.
683-
To use an existing image from another repository, see https://developers.cloudflare.com/containers/platform-details/image-management/#using-pre-built-container-images]
684-
`);
679+
const result = await getNormalizedContainerOptions(config, {});
680+
expect(result).toHaveLength(1);
681+
expect(result[0]).toMatchObject({
682+
image_uri: "docker.io/test:latest",
683+
});
685684
});
686685
it("should not try and add an account id to non containers registry uris", async () => {
687686
const config: Config = {

packages/wrangler/src/containers/config.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import assert from "node:assert";
22
import path, { dirname } from "node:path";
33
import {
4-
getAndValidateRegistryType,
54
InstanceType,
65
isDockerfile,
76
resolveImageName,
@@ -175,7 +174,6 @@ export const getNormalizedContainerOptions = async (
175174
image_vars: container.image_vars,
176175
});
177176
} else {
178-
getAndValidateRegistryType(container.image);
179177
normalizedContainers.push({
180178
...shared,
181179
...instanceTypeOrLimits,

0 commit comments

Comments
 (0)