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

Set saas endpoint as global to skip region checks #483

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
1 change: 1 addition & 0 deletions pkg/api/client_runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ var globalPath = map[string]bool{
"users": true,
"billing": true,
"organizations": true,
"saas": true,
}

type newRuntimeFunc func(region string) *runtimeclient.Runtime
Expand Down
11 changes: 11 additions & 0 deletions pkg/api/client_runtime_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,17 @@ func TestCloudClientRuntime_getRuntime(t *testing.T) {
}},
want: &runtimeclient.Runtime{BasePath: "/api/v1"},
},
{
name: "/saas operation uses the regionless path",
fields: fields{
newRegionRuntime: mocknewRuntimeFunc,
runtime: regionless,
},
args: args{op: &runtime.ClientOperation{
PathPattern: "/saas/billing/prices",
}},
want: &runtimeclient.Runtime{BasePath: "/api/v1"},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down
Loading