Skip to content

Commit afc908a

Browse files
authored
Merge pull request #1350 from threefoldtech/development_multiple_backends_support
Support multiple gateway backends
2 parents b9f54c4 + e06a294 commit afc908a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+244
-335
lines changed

go.work.sum

Lines changed: 83 additions & 0 deletions
Large diffs are not rendered by default.

grid-cli/cmd/deploy_gateway.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package cmd
44
import (
55
"github.com/rs/zerolog/log"
66
"github.com/spf13/cobra"
7-
"github.com/threefoldtech/zos/pkg/gridtypes/zos"
7+
"github.com/threefoldtech/zosbase/pkg/gridtypes/zos"
88
)
99

1010
// deployGatewayCmd represents the deploy gateway command

grid-cli/cmd/deploy_zdb.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"github.com/threefoldtech/tfgrid-sdk-go/grid-cli/internal/filters"
1313
"github.com/threefoldtech/tfgrid-sdk-go/grid-client/deployer"
1414
"github.com/threefoldtech/tfgrid-sdk-go/grid-client/workloads"
15-
"github.com/threefoldtech/zos/pkg/gridtypes/zos"
15+
"github.com/threefoldtech/zosbase/pkg/gridtypes/zos"
1616
)
1717

1818
// deployZDBCmd represents the deploy zdb command

grid-cli/go.mod

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require (
1010
github.com/stretchr/testify v1.10.0
1111
github.com/threefoldtech/tfgrid-sdk-go/grid-client v0.15.18
1212
github.com/threefoldtech/tfgrid-sdk-go/grid-proxy v0.15.18
13-
github.com/threefoldtech/zos v0.5.6-0.20240902110349-172a0a29a6ee
13+
github.com/threefoldtech/zosbase v0.1.4
1414
github.com/vedhavyas/go-subkey v1.0.3
1515
)
1616

@@ -47,9 +47,8 @@ require (
4747
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
4848
github.com/rs/cors v1.10.1 // indirect
4949
github.com/spf13/pflag v1.0.5 // indirect
50-
github.com/threefoldtech/tfchain/clients/tfchain-client-go v0.0.0-20241007205731-5e76664a3cc4 // indirect
51-
github.com/threefoldtech/tfgrid-sdk-go/rmb-sdk-go v0.15.18 // indirect
52-
github.com/threefoldtech/zos4 v0.5.6-0.20241008102757-02d898c580c4 // indirect
50+
github.com/threefoldtech/tfchain/clients/tfchain-client-go v0.0.0-20241127100051-77e684bcb1b2 // indirect
51+
github.com/threefoldtech/tfgrid-sdk-go/rmb-sdk-go v0.16.1-0.20241229121208-76ac3fea5e67 // indirect
5352
golang.org/x/crypto v0.31.0 // indirect
5453
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect
5554
golang.org/x/sync v0.10.0 // indirect

grid-cli/go.sum

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,10 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
122122
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
123123
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
124124
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
125-
github.com/threefoldtech/tfchain/clients/tfchain-client-go v0.0.0-20241007205731-5e76664a3cc4 h1:XIXVdFrum50Wnxv62sS+cEgqHtvdInWB2Co8AJVJ8xs=
126-
github.com/threefoldtech/tfchain/clients/tfchain-client-go v0.0.0-20241007205731-5e76664a3cc4/go.mod h1:cOL5YgHUmDG5SAXrsZxFjUECRQQuAqOoqvXhZG5sEUw=
127-
github.com/threefoldtech/zos v0.5.6-0.20240902110349-172a0a29a6ee h1:pqpYVM0qkXujplHNfH6w5GDqcY5sLJAgOc4/hlR6+Xw=
128-
github.com/threefoldtech/zos v0.5.6-0.20240902110349-172a0a29a6ee/go.mod h1:lut72yYMJhgK0QRvF0Wd/mB3+OfIoXWz04DQuXck3Sw=
129-
github.com/threefoldtech/zos4 v0.5.6-0.20241008102757-02d898c580c4 h1:JCExxpPL32G7evO/+gHwlZLfAX1+l9QN9t55tnPDCp0=
130-
github.com/threefoldtech/zos4 v0.5.6-0.20241008102757-02d898c580c4/go.mod h1:7KFtZaCcEFwQ1/cz/+hkYK616Ww04ISZgmMqLWHz6To=
125+
github.com/threefoldtech/tfchain/clients/tfchain-client-go v0.0.0-20241127100051-77e684bcb1b2 h1:VW2J36F8g/kJn4IkY0JiRFmb1gFcdjiOyltfJLJ0mYU=
126+
github.com/threefoldtech/tfchain/clients/tfchain-client-go v0.0.0-20241127100051-77e684bcb1b2/go.mod h1:cOL5YgHUmDG5SAXrsZxFjUECRQQuAqOoqvXhZG5sEUw=
127+
github.com/threefoldtech/zosbase v0.1.4 h1:ZLm06TujSSIU8rX28X5Dx7utWQhiDqKBoTqGKBKOwDI=
128+
github.com/threefoldtech/zosbase v0.1.4/go.mod h1:rxc49wA04S4IsBOYe0omVO7nu7GXridueh2PJh34gSo=
131129
github.com/tklauser/go-sysconf v0.3.11 h1:89WgdJhk5SNwJfu+GKyYveZ4IaJ7xAkecBo+KdJV0CM=
132130
github.com/tklauser/go-sysconf v0.3.11/go.mod h1:GqXfhXY3kiPa0nAXPDIQIWzJbMCB7AmcWpGR8lSZfqI=
133131
github.com/tklauser/numcpus v0.6.0 h1:kebhY2Qt+3U6RNK7UqpYNA+tJ23IBEGKkB7JQBfDYms=

grid-client/deployer/deployer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
"github.com/threefoldtech/tfgrid-sdk-go/grid-client/zos"
2020
proxy "github.com/threefoldtech/tfgrid-sdk-go/grid-proxy/pkg/client"
2121
proxyTypes "github.com/threefoldtech/tfgrid-sdk-go/grid-proxy/pkg/types"
22-
"github.com/threefoldtech/zos/pkg/gridtypes"
22+
"github.com/threefoldtech/zosbase/pkg/gridtypes"
2323
"golang.org/x/sync/errgroup"
2424
)
2525

grid-client/deployer/deployer_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ import (
1818
"github.com/threefoldtech/tfgrid-sdk-go/grid-client/workloads"
1919
zosTypes "github.com/threefoldtech/tfgrid-sdk-go/grid-client/zos"
2020
proxyTypes "github.com/threefoldtech/tfgrid-sdk-go/grid-proxy/pkg/types"
21-
"github.com/threefoldtech/zos/pkg/gridtypes"
22-
"github.com/threefoldtech/zos/pkg/gridtypes/zos"
21+
"github.com/threefoldtech/zosbase/pkg/gridtypes"
22+
"github.com/threefoldtech/zosbase/pkg/gridtypes/zos"
2323
"github.com/vedhavyas/go-subkey"
2424
)
2525

grid-client/deployer/deployment_deployer_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ import (
1919
"github.com/threefoldtech/tfgrid-sdk-go/grid-client/state"
2020
"github.com/threefoldtech/tfgrid-sdk-go/grid-client/workloads"
2121
zosTypes "github.com/threefoldtech/tfgrid-sdk-go/grid-client/zos"
22-
"github.com/threefoldtech/zos/pkg/gridtypes"
23-
"github.com/threefoldtech/zos/pkg/gridtypes/zos"
22+
"github.com/threefoldtech/zosbase/pkg/gridtypes"
23+
"github.com/threefoldtech/zosbase/pkg/gridtypes/zos"
2424
)
2525

2626
var (

grid-client/deployer/deployment_utils.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ import (
55

66
"github.com/pkg/errors"
77
zosTypes "github.com/threefoldtech/tfgrid-sdk-go/grid-client/zos"
8-
"github.com/threefoldtech/zos/pkg/gridtypes/zos"
8+
"github.com/threefoldtech/zosbase/pkg/gridtypes/zos"
99
)
1010

1111
// CountDeploymentPublicIPs counts the public IPs of a deployment
1212
func CountDeploymentPublicIPs(dl zosTypes.Deployment) (uint32, error) {
1313
var res uint32
1414
for _, wl := range dl.Workloads {
1515
if wl.Type == zosTypes.PublicIPType {
16-
data, err := wl.Workload3().WorkloadData()
16+
data, err := wl.Workload().WorkloadData()
1717
if err != nil {
1818
return res, errors.Wrapf(err, "could not parse workload data for workload %s", wl.Name)
1919
}

grid-client/deployer/gateway_fqdn_deployer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ func (d *GatewayFQDNDeployer) Sync(ctx context.Context, gw *workloads.GatewayFQD
217217
gw.Network = gwWorkload.Network
218218

219219
if wl != nil && wl.Result.State.IsOkay() {
220-
gwWorkload, err := workloads.NewGatewayFQDNProxyFromZosWorkload(*wl.Workload.Workload3())
220+
gwWorkload, err := workloads.NewGatewayFQDNProxyFromZosWorkload(*wl.Workload.Workload())
221221
gw.Backends = gwWorkload.Backends
222222
gw.Name = gwWorkload.Name
223223
gw.FQDN = gwWorkload.FQDN

0 commit comments

Comments
 (0)