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
7 changes: 3 additions & 4 deletions cluster/hostname.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cluster
import (
"context"
"fmt"
"slices"
"strings"
"sync"

Expand Down Expand Up @@ -369,10 +370,8 @@ func (hs *hostnameService) PrepareHostnamesForTransfer(ctx context.Context, host
}

func (hs *hostnameService) isHostnameBlocked(hostname string) error {
for _, blockedHostname := range hs.blockedHostnames {
if blockedHostname == hostname {
return fmt.Errorf("%w: %q is blocked by this provider", ErrHostnameNotAllowed, hostname)
}
if slices.Contains(hs.blockedHostnames, hostname) {
return fmt.Errorf("%w: %q is blocked by this provider", ErrHostnameNotAllowed, hostname)
}

for _, blockedDomain := range hs.blockedDomains {
Expand Down
9 changes: 3 additions & 6 deletions pkg/apis/akash.network/v2beta2/node_info.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package v2beta2

import "slices"

type GPUCapabilities struct {
Vendor string `json:"vendor" capabilities:"vendor"`
Model string `json:"string" capabilities:"model"`
Expand All @@ -15,10 +17,5 @@ type NodeInfoCapabilities struct {
}

func (c *StorageCapabilities) HasClass(class string) bool {
for _, val := range c.Classes {
if val == class {
return true
}
}
return false
return slices.Contains(c.Classes, class)
}