@@ -29,7 +29,13 @@ func (c *NebiusClient) GetInstanceTypes(ctx context.Context, args v1.GetInstance
2929 // Default behavior: check ALL regions to show all available quota
3030 var locations []v1.Location
3131
32- if len (args .Locations ) > 0 && ! args .Locations .IsAll () {
32+ if args .Locations .IsAll () { //nolint:gocritic // prefer if statement over switch statement
33+ allLocations , err := c .GetLocations (ctx , v1.GetLocationsArgs {})
34+ if err != nil {
35+ return nil , errors .WrapAndTrace (err )
36+ }
37+ locations = allLocations
38+ } else if len (args .Locations ) > 0 {
3339 // User requested specific locations - filter to those
3440 allLocations , err := c .GetLocations (ctx , v1.GetLocationsArgs {})
3541 if err == nil {
@@ -48,15 +54,8 @@ func (c *NebiusClient) GetInstanceTypes(ctx context.Context, args v1.GetInstance
4854 locations = []v1.Location {{Name : c .location }}
4955 }
5056 } else {
51- // Default behavior: enumerate ALL regions for quota-aware discovery
52- // This shows users all instance types they have quota for, regardless of region
53- allLocations , err := c .GetLocations (ctx , v1.GetLocationsArgs {})
54- if err == nil {
55- locations = allLocations
56- } else {
57- // Fallback to client's configured location if we can't get all locations
58- locations = []v1.Location {{Name : c .location }}
59- }
57+ // Fallback to client's configured location if we can't get all locations
58+ locations = []v1.Location {{Name : c .location }}
6059 }
6160
6261 // Get quota information for all regions
0 commit comments