Skip to content

Resolve container image name when modifying #9923

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 10, 2025
Merged

Conversation

gpanders
Copy link
Member

@gpanders gpanders commented Jul 10, 2025

The container image name should be resolved into the full (namespaced) image name both when creating an application and when modifying an application.

Move the image name resolution out of the create path and into the shared code path taken for both creation and modification.


  • Tests
    • Tests included
    • Tests not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: bug fix
  • Wrangler V3 Backport
    • Wrangler PR:
    • Not necessary because: containers change

@gpanders gpanders requested review from a team as code owners July 10, 2025 15:22
Copy link

changeset-bot bot commented Jul 10, 2025

🦋 Changeset detected

Latest commit: 99ec92b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@cloudflare/containers-shared Patch
wrangler Patch
@cloudflare/vite-plugin Patch
@cloudflare/vitest-pool-workers Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Jul 10, 2025
Copy link

pkg-pr-new bot commented Jul 10, 2025

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@9923

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@9923

miniflare

npm i https://pkg.pr.new/miniflare@9923

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@9923

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@9923

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@9923

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@9923

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@9923

wrangler

npm i https://pkg.pr.new/wrangler@9923

commit: 99ec92b

@gpanders gpanders force-pushed the push-nunwqontxqtp branch 2 times, most recently from 7ac4444 to 3e3bc9a Compare July 10, 2025 15:46
│ image = \\"${registry}/hello:1.0\\"
│ image = \\"${registry}/some-account-id/hello:1.0\\"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before, we were also omitting the namespace (account ID) in the diff that we showed to the user. This ends up being more trouble than it's worth, so we include the namespace (account ID) in the diff now. Updated this test to reflect that.

Copy link
Contributor

Failed to automatically backport this PR's changes to Wrangler v3. Please manually create a PR targeting the v3-maintenance branch with your changes. Thank you for helping us keep Wrangler v3 supported!

Depending on your changes, running git rebase --onto v3-maintenance main push-nunwqontxqtp might be a good starting point.

Notes:

  • your PR branch should be named v3-backport-9923
  • add the skip-v3-pr label to the current PR to stop this workflow from failing

name: "my-container-app",
instances: 3,
class_name: "DurableObjectClass",
image: `${registry}/hello:1.0`,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: image name does not include namespace (account ID) in Wrangler config here

account_id: "1",
scheduling_policy: SchedulingPolicy.REGIONAL,
configuration: {
image: `${registry}/some-account-id/hello:1.0`,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But in the API, we do include namespace (account ID) in the image name

├ EDIT my-container-app
│ [containers.configuration]
│ image = \\"${registry}/some-account-id/hello:1.0\\"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And the namespace (account ID) is included in the diff here as well (unmodified).

The container image name should be resolved into the full (namespaced)
image name both when creating an application and when modifying an
application.

Move the image name resolution out of the create path and into the
shared code path taken for both creation and modification.
@gpanders gpanders force-pushed the push-nunwqontxqtp branch from 3e3bc9a to 6f02c57 Compare July 10, 2025 15:49
@gpanders gpanders added the skip-v3-pr Skip validation of presence of a v3 backport PR label Jul 10, 2025
@edmundhung edmundhung merged commit c01c4ee into main Jul 10, 2025
32 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Jul 10, 2025
@edmundhung edmundhung deleted the push-nunwqontxqtp branch July 10, 2025 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-v3-pr Skip validation of presence of a v3 backport PR
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants