Skip to content

Commit 28d6806

Browse files
authored
Show regions with GPU capabilities as part of fly platform regions (#2800)
1 parent c7497d4 commit 28d6806

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

internal/command/platform/regions.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"sort"
77

88
"github.com/spf13/cobra"
9+
"golang.org/x/exp/slices"
910

1011
"github.com/superfly/flyctl/iostreams"
1112

@@ -16,6 +17,10 @@ import (
1617
"github.com/superfly/flyctl/internal/render"
1718
)
1819

20+
// Hardcoded list of regions with GPUs
21+
// TODO: fetch this list from the graphql endpoint once it is there
22+
var gpuRegions = []string{"iad", "sjc", "syd", "ams"}
23+
1924
func newRegions() (cmd *cobra.Command) {
2025
const (
2126
long = `View a list of regions where Fly has edges and/or datacenters
@@ -58,13 +63,19 @@ func runRegions(ctx context.Context) error {
5863
if region.RequiresPaidPlan {
5964
paidPlan = "✓"
6065
}
66+
gpuAvailable := ""
67+
if slices.Contains(gpuRegions, region.Code) {
68+
gpuAvailable = "✓"
69+
}
70+
6171
rows = append(rows, []string{
6272
region.Name,
6373
region.Code,
6474
gateway,
6575
paidPlan,
76+
gpuAvailable,
6677
})
6778
}
6879

69-
return render.Table(out, "", rows, "Name", "Code", "Gateway", "Paid Plan Only")
80+
return render.Table(out, "", rows, "Name", "Code", "Gateway", "Paid-Only", "GPUs")
7081
}

0 commit comments

Comments
 (0)