Skip to content

Commit f52d8bd

Browse files
Move AccountClient to libs/command (#2447)
## Changes Move the AccountClient reader and setter from the root package to `libs/command`. ## Why This allows us to read the account client set in the context in all CLI packages. This was not possible before because using `root.AccountClient` would often result in an import cycle. This is a natural follow-up to #2440 and #2444. ## Tests Existing tests and one new unit test. NO_CHANGELOG=true
1 parent 052b9d9 commit f52d8bd

File tree

41 files changed

+232
-161
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+232
-161
lines changed

.codegen/service.go.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ func new{{.PascalName}}() *cobra.Command {
241241
cmd.PreRunE = root.Must{{if .Service.IsAccounts}}Account{{else}}Workspace{{end}}Client
242242
cmd.RunE = func(cmd *cobra.Command, args []string) (err error) {
243243
ctx := cmd.Context()
244-
{{if .Service.IsAccounts}}a := root.AccountClient(ctx){{else}}w := command.WorkspaceClient(ctx){{end}}
244+
{{if .Service.IsAccounts}}a := command.AccountClient(ctx){{else}}w := command.WorkspaceClient(ctx){{end}}
245245
{{- if .Request }}
246246
{{ if $canUseJson }}
247247
if cmd.Flags().Changed("json") {

cmd/account/access-control/access-control.go

+4-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/account/billable-usage/billable-usage.go

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/account/budget-policy/budget-policy.go

+6-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/account/budgets/budgets.go

+6-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/account/credentials/credentials.go

+5-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/account/csp-enablement-account/csp-enablement-account.go

+3-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/account/custom-app-integration/custom-app-integration.go

+6-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/account/disable-legacy-features/disable-legacy-features.go

+4-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/account/enable-ip-access-lists/enable-ip-access-lists.go

+4-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)