Skip to content
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

fix: Modify Cloudchamber deployment labels in interactive mode #7124

Merged
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
5 changes: 5 additions & 0 deletions .changeset/odd-lions-warn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wrangler": patch
---

fix: Modify Cloudchamber deployment labels in interactive mode
6 changes: 3 additions & 3 deletions packages/wrangler/src/__tests__/cloudchamber/modify.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function mockDeployment() {
"*/deployments/1234/v2",
async ({ request }) => {
expect(await request.text()).toBe(
`{"image":"hello:modify","location":"sfo06","environment_variables":[{"name":"HELLO","value":"WORLD"},{"name":"YOU","value":"CONQUERED"}],"vcpu":3,"memory":"40MB"}`
`{"image":"hello:modify","location":"sfo06","environment_variables":[{"name":"HELLO","value":"WORLD"},{"name":"YOU","value":"CONQUERED"}],"labels":[{"name":"appname","value":"helloworld"},{"name":"region","value":"wnam"}],"vcpu":3,"memory":"40MB"}`
);
return HttpResponse.json(MOCK_DEPLOYMENTS_COMPLEX[0]);
},
Expand Down Expand Up @@ -94,7 +94,7 @@ describe("cloudchamber modify", () => {
setWranglerConfig({});
mockDeployment();
await runWrangler(
"cloudchamber modify 1234 --image hello:modify --location sfo06 --var HELLO:WORLD --var YOU:CONQUERED --vcpu 3 --memory 40MB"
"cloudchamber modify 1234 --image hello:modify --location sfo06 --var HELLO:WORLD --var YOU:CONQUERED --label appname:helloworld --label region:wnam --vcpu 3 --memory 40MB"
);
expect(std.err).toMatchInlineSnapshot(`""`);
// so testing the actual UI will be harder than expected
Expand All @@ -112,7 +112,7 @@ describe("cloudchamber modify", () => {
});
mockDeployment();
await runWrangler(
"cloudchamber modify 1234 --var HELLO:WORLD --var YOU:CONQUERED"
"cloudchamber modify 1234 --var HELLO:WORLD --var YOU:CONQUERED --label appname:helloworld --label region:wnam"
);
expect(std.err).toMatchInlineSnapshot(`""`);
expect(std.out).toMatchInlineSnapshot(EXPECTED_RESULT);
Expand Down
1 change: 1 addition & 0 deletions packages/wrangler/src/cloudchamber/modify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ async function handleModifyCommand(
location,
ssh_public_key_ids: keys,
environment_variables: selectedEnvironmentVariables,
labels: selectedLabels,
vcpu: args.vcpu ?? config.cloudchamber.vcpu,
memory: args.memory ?? config.cloudchamber.memory,
})
Expand Down
Loading