Skip to content
Open
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
10 changes: 1 addition & 9 deletions v1/providers/sfcompute/instancetype.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package v1
import (
"context"
"fmt"
"slices"
"strings"
"time"

Expand All @@ -24,8 +23,6 @@ const (
diskTypeSSD = "ssd"
)

var allowedZones = []string{"hayesvalley", "yerba"}

func makeDefaultInstanceTypePrice(amount string, currencyCode string) currency.Amount {
instanceTypePrice, err := currency.NewAmount(amount, currencyCode)
if err != nil {
Expand Down Expand Up @@ -186,12 +183,7 @@ func (c *SFCClient) getZones(ctx context.Context, includeUnavailable bool) ([]sf

zones := make([]sfcnodes.ZoneListResponseData, 0, len(resp.Data))
for _, zone := range resp.Data {
// If the zone is not allowed, skip it
if !slices.Contains(allowedZones, strings.ToLower(zone.Name)) {
continue
}

// If the there is no available capacity, and skip it
// If the there is no available capacity, skip it
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence still doesn't quite make sense 😆

if len(zone.AvailableCapacity) == 0 && !includeUnavailable {
continue
}
Expand Down
3 changes: 1 addition & 2 deletions v1/providers/sfcompute/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ func TestValidationFunctions(t *testing.T) {
config := validation.ProviderConfig{
Credential: NewSFCCredential("validation-test", apiKey),
StableIDs: []v1.InstanceTypeID{
"hayesvalley-noSub-h100",
"yerba-noSub-h100",
"richmond-noSub-h100",
},
}

Expand Down
Loading