Skip to content

fix: use RunMut for create/update commands that don't support --json#3

Merged
joshpollara merged 2 commits intomainfrom
fix/create-json-flag
Mar 19, 2026
Merged

fix: use RunMut for create/update commands that don't support --json#3
joshpollara merged 2 commits intomainfrom
fix/create-json-flag

Conversation

@joshpollara
Copy link
Member

Summary

  • Switch all resource Create/Update methods from RunJSONMut to RunMut for flyctl subcommands that don't support --json (create, update, attach)
  • After create/update, read back state via RunJSON with list/status commands (same pattern ip_address_resource.go already uses)
  • Fix double --json bug in redis and tigris Read methods where manual --json was added on top of RunJSON's automatic --json
  • 13 resource files and 14 test files updated

Test plan

  • go build ./... compiles cleanly
  • go test ./... — all tests pass
  • terraform apply with fly_mpg_cluster resource creates successfully

🤖 Generated with Claude Code

joshpollara and others added 2 commits March 19, 2026 20:08
RunJSONMut auto-appends --json to every command, but many flyctl
subcommands (create, update, attach) don't support that flag, causing
"unknown flag: --json" errors. Switch these to RunMut and read back
state via a subsequent RunJSON call (list/status), matching the pattern
ip_address_resource.go already uses correctly.

Also fixes double --json in redis and tigris Read/Update methods where
manual --json was added on top of RunJSON's automatic --json.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
These became unused after switching mpg_attachment Create to RunMut.
Fixes golangci-lint unused error.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@joshpollara joshpollara merged commit 8cfc15e into main Mar 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant