Skip to content

Commit 18c5a4a

Browse files
authored
Merge pull request #986 from threefoldtech/development_zos4_fallback_to_zos3
fallback in case of no zos4 nodes found
2 parents a005a3f + 379ca8f commit 18c5a4a

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

GNUmakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ integration: clean build-dev
2929
tests: unittests integrationtests
3030

3131
clean:
32-
rm -rf $(GARBAGE)
32+
rm -f $(GARBAGE)
3333

3434
lint:
3535
@echo "Running $@"

internal/provider/scheduler/scheduler.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ import (
55
"context"
66
"fmt"
77
"math/rand"
8+
"slices"
89

910
"github.com/pkg/errors"
11+
"github.com/threefoldtech/tfgrid-sdk-go/grid-client/zos"
1012
proxy "github.com/threefoldtech/tfgrid-sdk-go/grid-proxy/pkg/client"
1113
proxyTypes "github.com/threefoldtech/tfgrid-sdk-go/grid-proxy/pkg/types"
1214
)
@@ -162,9 +164,13 @@ func (n *Scheduler) gridProxySchedule(ctx context.Context, r *Request) (uint32,
162164
if err != nil {
163165
return 0, errors.Wrap(err, "couldn't list nodes from the grid proxy")
164166
}
165-
if len(nodes) == 0 {
167+
if len(nodes) == 0 && slices.Contains(f.Features, zos.NetworkType) {
166168
return 0, NoNodesFoundErr
167169
}
170+
if len(nodes) == 0 {
171+
f.Features = []string{zos.NetworkType, zos.ZMachineType}
172+
continue
173+
}
168174
n.addNodes(nodes)
169175
node = n.getNode(ctx, r)
170176
if l.Page == 1 && l.Size == 10 {

0 commit comments

Comments
 (0)