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

grid-client/deployer/gateway_fqdn_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/workloads"
2020
zosTypes "github.com/threefoldtech/tfgrid-sdk-go/grid-client/zos"
2121
proxyTypes "github.com/threefoldtech/tfgrid-sdk-go/grid-proxy/pkg/types"
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
func constructTestFQDNDeployer(t *testing.T, mock bool) (

grid-client/deployer/gateway_name_deployer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ func (d *GatewayNameDeployer) Sync(ctx context.Context, gw *workloads.GatewayNam
252252

253253
// if the node acknowledges it, we are golden
254254
if wl != nil && wl.Result.State.IsOkay() {
255-
gwWorkload, err := workloads.NewGatewayNameProxyFromZosWorkload(*wl.Workload.Workload3())
255+
gwWorkload, err := workloads.NewGatewayNameProxyFromZosWorkload(*wl.Workload.Workload())
256256
gw.Backends = gwWorkload.Backends
257257
gw.Name = gwWorkload.Name
258258
gw.FQDN = gwWorkload.FQDN

grid-client/deployer/gateway_name_deployer_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ import (
1717
"github.com/threefoldtech/tfgrid-sdk-go/grid-client/state"
1818
"github.com/threefoldtech/tfgrid-sdk-go/grid-client/workloads"
1919
zosTypes "github.com/threefoldtech/tfgrid-sdk-go/grid-client/zos"
20-
"github.com/threefoldtech/zos/pkg/gridtypes"
21-
"github.com/threefoldtech/zos/pkg/gridtypes/zos"
20+
"github.com/threefoldtech/zosbase/pkg/gridtypes"
21+
"github.com/threefoldtech/zosbase/pkg/gridtypes/zos"
2222
)
2323

2424
var nameContractID uint64 = 200

grid-client/deployer/k8s_deployer.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import (
1212
client "github.com/threefoldtech/tfgrid-sdk-go/grid-client/node"
1313
"github.com/threefoldtech/tfgrid-sdk-go/grid-client/workloads"
1414
zosTypes "github.com/threefoldtech/tfgrid-sdk-go/grid-client/zos"
15-
"github.com/threefoldtech/zos/pkg/gridtypes"
16-
"github.com/threefoldtech/zos/pkg/gridtypes/zos"
15+
"github.com/threefoldtech/zosbase/pkg/gridtypes"
16+
"github.com/threefoldtech/zosbase/pkg/gridtypes/zos"
1717
)
1818

1919
// K8sDeployer for deploying k8s
@@ -261,7 +261,7 @@ func (d *K8sDeployer) UpdateFromRemote(ctx context.Context, k8sCluster *workload
261261
for _, dl := range currentDeployments {
262262
for _, w := range dl.Workloads {
263263
if w.Type == zosTypes.ZMachineType {
264-
d, err := w.Workload3().WorkloadData()
264+
d, err := w.Workload().WorkloadData()
265265
if err != nil {
266266
zerolog.Error().Err(err).Msg("failed to get workload data")
267267
}
@@ -303,7 +303,7 @@ func (d *K8sDeployer) UpdateFromRemote(ctx context.Context, k8sCluster *workload
303303
for _, w := range dl.Workloads {
304304
if w.Type == zosTypes.ZMachineType {
305305
workloadNodeID[w.Name] = node
306-
workloadObj[w.Name] = *w.Workload3()
306+
workloadObj[w.Name] = *w.Workload()
307307

308308
} else if w.Type == zosTypes.PublicIPType {
309309
ipResult := zos.PublicIPResult{}
@@ -313,7 +313,7 @@ func (d *K8sDeployer) UpdateFromRemote(ctx context.Context, k8sCluster *workload
313313
publicIPs[w.Name] = ipResult.IP.String()
314314
publicIP6s[w.Name] = ipResult.IPv6.String()
315315
} else if w.Type == zosTypes.ZMountType {
316-
wl, err := w.Workload3().WorkloadData()
316+
wl, err := w.Workload().WorkloadData()
317317
if err != nil {
318318
return d.tfPluginClient.sentry.error(errors.Wrap(err, "failed to load disk data"))
319319
}

grid-client/deployer/k8s_deployer_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"github.com/threefoldtech/tfgrid-sdk-go/grid-client/subi"
1919
"github.com/threefoldtech/tfgrid-sdk-go/grid-client/workloads"
2020
zosTypes "github.com/threefoldtech/tfgrid-sdk-go/grid-client/zos"
21-
"github.com/threefoldtech/zos/pkg/gridtypes"
21+
"github.com/threefoldtech/zosbase/pkg/gridtypes"
2222
)
2323

2424
func constructTestK8s(t *testing.T, mock bool) (

grid-client/deployer/node_filter.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import (
1515
"github.com/rs/zerolog/log"
1616
client "github.com/threefoldtech/tfgrid-sdk-go/grid-client/node"
1717
"github.com/threefoldtech/tfgrid-sdk-go/grid-proxy/pkg/types"
18-
"github.com/threefoldtech/zos/pkg/gridtypes"
19-
"github.com/threefoldtech/zos/pkg/gridtypes/zos"
18+
"github.com/threefoldtech/zosbase/pkg/gridtypes"
19+
"github.com/threefoldtech/zosbase/pkg/gridtypes/zos"
2020
)
2121

2222
const requestedPagesPerIteration = 5

grid-client/deployer/node_filter_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"github.com/stretchr/testify/assert"
99
client "github.com/threefoldtech/tfgrid-sdk-go/grid-client/node"
1010
"github.com/threefoldtech/tfgrid-sdk-go/grid-proxy/pkg/types"
11-
"github.com/threefoldtech/zos/pkg/gridtypes/zos"
11+
"github.com/threefoldtech/zosbase/pkg/gridtypes/zos"
1212
)
1313

1414
func TestHasEnoughStorage(t *testing.T) {

grid-client/go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ require (
1515
github.com/rs/zerolog v1.33.0
1616
github.com/sethvargo/go-retry v0.3.0
1717
github.com/stretchr/testify v1.10.0
18-
github.com/threefoldtech/tfchain/clients/tfchain-client-go v0.0.0-20241007205731-5e76664a3cc4
18+
github.com/threefoldtech/tfchain/clients/tfchain-client-go v0.0.0-20241127100051-77e684bcb1b2
1919
github.com/threefoldtech/tfgrid-sdk-go/grid-proxy v0.15.18
20-
github.com/threefoldtech/tfgrid-sdk-go/rmb-sdk-go v0.15.18
21-
github.com/threefoldtech/zos v0.5.6-0.20240902110349-172a0a29a6ee
22-
github.com/threefoldtech/zos4 v0.5.6-0.20241008102757-02d898c580c4
20+
github.com/threefoldtech/tfgrid-sdk-go/rmb-sdk-go v0.16.1-0.20241229121208-76ac3fea5e67
2321
github.com/vedhavyas/go-subkey v1.0.3
2422
golang.org/x/crypto v0.31.0
2523
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa
2624
golang.org/x/sync v0.10.0
2725
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20200609130330-bd2cb7843e1b
2826
)
2927

28+
require github.com/threefoldtech/zosbase v0.1.4
29+
3030
require (
3131
github.com/ChainSafe/go-schnorrkel v1.1.0 // indirect
3232
github.com/cenkalti/backoff/v3 v3.2.2 // indirect

grid-client/go.sum

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

grid-client/integration_tests/batch_gateway_name_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
"github.com/threefoldtech/tfgrid-sdk-go/grid-client/deployer"
1616
"github.com/threefoldtech/tfgrid-sdk-go/grid-client/workloads"
1717

18-
"github.com/threefoldtech/zos/pkg/gridtypes/zos"
18+
"github.com/threefoldtech/zosbase/pkg/gridtypes/zos"
1919
)
2020

2121
func TestBatchGatewayNameDeployment(t *testing.T) {

grid-client/integration_tests/gateway_name_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"github.com/threefoldtech/tfgrid-sdk-go/grid-client/deployer"
1515
"github.com/threefoldtech/tfgrid-sdk-go/grid-client/workloads"
1616

17-
"github.com/threefoldtech/zos/pkg/gridtypes/zos"
17+
"github.com/threefoldtech/zosbase/pkg/gridtypes/zos"
1818
)
1919

2020
func TestGatewayNameDeployment(t *testing.T) {

grid-client/integration_tests/gatway_fqdn_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"github.com/threefoldtech/tfgrid-sdk-go/grid-client/deployer"
1515
"github.com/threefoldtech/tfgrid-sdk-go/grid-client/workloads"
1616

17-
"github.com/threefoldtech/zos/pkg/gridtypes/zos"
17+
"github.com/threefoldtech/zosbase/pkg/gridtypes/zos"
1818
)
1919

2020
func TestGatewayFQDNDeployment(t *testing.T) {

grid-client/integration_tests/qsfs_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"github.com/stretchr/testify/require"
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
const (

grid-client/integration_tests/zdb_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/stretchr/testify/require"
1111
"github.com/threefoldtech/tfgrid-sdk-go/grid-client/deployer"
1212
"github.com/threefoldtech/tfgrid-sdk-go/grid-client/workloads"
13-
"github.com/threefoldtech/zos/pkg/gridtypes/zos"
13+
"github.com/threefoldtech/zosbase/pkg/gridtypes/zos"
1414
)
1515

1616
func TestZDBDeployment(t *testing.T) {

grid-client/node/node.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ import (
8383
"github.com/threefoldtech/tfgrid-sdk-go/grid-client/subi"
8484
zosTypes "github.com/threefoldtech/tfgrid-sdk-go/grid-client/zos"
8585
"github.com/threefoldtech/tfgrid-sdk-go/rmb-sdk-go"
86-
"github.com/threefoldtech/zos/pkg/capacity/dmi"
87-
"github.com/threefoldtech/zos/pkg/gridtypes"
88-
"github.com/threefoldtech/zos/pkg/gridtypes/zos"
86+
"github.com/threefoldtech/zosbase/pkg/capacity/dmi"
87+
"github.com/threefoldtech/zosbase/pkg/gridtypes"
88+
"github.com/threefoldtech/zosbase/pkg/gridtypes/zos"
8989
)
9090

9191
// ErrNoAccessibleInterfaceFound no accessible interface found

grid-client/state/state.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import (
1414
"github.com/threefoldtech/tfgrid-sdk-go/grid-client/subi"
1515
"github.com/threefoldtech/tfgrid-sdk-go/grid-client/workloads"
1616
zosTypes "github.com/threefoldtech/tfgrid-sdk-go/grid-client/zos"
17-
"github.com/threefoldtech/zos/pkg/gridtypes"
18-
"github.com/threefoldtech/zos/pkg/gridtypes/zos"
17+
"github.com/threefoldtech/zosbase/pkg/gridtypes"
18+
"github.com/threefoldtech/zosbase/pkg/gridtypes/zos"
1919
"golang.org/x/exp/maps"
2020
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
2121
)
@@ -91,7 +91,7 @@ func (st *State) LoadGatewayFQDNFromGrid(ctx context.Context, nodeID uint32, nam
9191
if err != nil {
9292
return workloads.GatewayFQDNProxy{}, errors.Wrapf(err, "could not generate deployment metadata for %s", name)
9393
}
94-
gateway, err := workloads.NewGatewayFQDNProxyFromZosWorkload(*wl.Workload3())
94+
gateway, err := workloads.NewGatewayFQDNProxyFromZosWorkload(*wl.Workload())
9595
if err != nil {
9696
return workloads.GatewayFQDNProxy{}, err
9797
}
@@ -127,7 +127,7 @@ func (st *State) LoadGatewayNameFromGrid(ctx context.Context, nodeID uint32, nam
127127
if err != nil {
128128
return workloads.GatewayNameProxy{}, errors.Wrapf(err, "could not generate deployment metadata for %s", deploymentName)
129129
}
130-
gateway, err := workloads.NewGatewayNameProxyFromZosWorkload(*wl.Workload3())
130+
gateway, err := workloads.NewGatewayNameProxyFromZosWorkload(*wl.Workload())
131131
if err != nil {
132132
return workloads.GatewayNameProxy{}, err
133133
}
@@ -194,12 +194,12 @@ func (st *State) LoadK8sFromGrid(ctx context.Context, nodeIDs []uint32, deployme
194194
return workloads.K8sCluster{}, errors.Wrapf(err, "could not compute node %s, resources", workload.Name)
195195
}
196196

197-
node, err := workloads.NewK8sNodeFromWorkload(*workload.Workload3(), nodeID, workloadDiskSize[workload.Name], workloadComputedIP[workload.Name], workloadComputedIP6[workload.Name])
197+
node, err := workloads.NewK8sNodeFromWorkload(*workload.Workload(), nodeID, workloadDiskSize[workload.Name], workloadComputedIP[workload.Name], workloadComputedIP6[workload.Name])
198198
if err != nil {
199199
return workloads.K8sCluster{}, errors.Wrapf(err, "could not generate node data for %s", workload.Name)
200200
}
201201

202-
isMaster, err := isMasterNode(*workload.Workload3())
202+
isMaster, err := isMasterNode(*workload.Workload())
203203
if err != nil {
204204
return workloads.K8sCluster{}, err
205205
}
@@ -282,7 +282,7 @@ func (st *State) computeK8sDeploymentResources(dl zosTypes.Deployment) (
282282

283283
case zos.ZMountType.String():
284284

285-
d, err := w.Workload3().WorkloadData()
285+
d, err := w.Workload().WorkloadData()
286286
if err != nil {
287287
return workloadDiskSize, workloadComputedIP, workloadComputedIP6, errors.Wrap(err, "failed to load disk data")
288288
}

grid-client/state/state_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import (
1414
client "github.com/threefoldtech/tfgrid-sdk-go/grid-client/node"
1515
"github.com/threefoldtech/tfgrid-sdk-go/grid-client/workloads"
1616
zosTypes "github.com/threefoldtech/tfgrid-sdk-go/grid-client/zos"
17-
"github.com/threefoldtech/zos/pkg/gridtypes"
18-
"github.com/threefoldtech/zos/pkg/gridtypes/zos"
17+
"github.com/threefoldtech/zosbase/pkg/gridtypes"
18+
"github.com/threefoldtech/zosbase/pkg/gridtypes/zos"
1919
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
2020
)
2121

grid-client/workloads/disk.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package workloads
44
import (
55
"github.com/pkg/errors"
66
zosTypes "github.com/threefoldtech/tfgrid-sdk-go/grid-client/zos"
7-
"github.com/threefoldtech/zos/pkg/gridtypes/zos"
7+
"github.com/threefoldtech/zosbase/pkg/gridtypes/zos"
88
)
99

1010
// Disk struct
@@ -18,12 +18,9 @@ type Disk struct {
1818
func NewDiskFromWorkload(wl *zosTypes.Workload) (Disk, error) {
1919
var dataI interface{}
2020

21-
dataI, err := wl.Workload3().WorkloadData()
21+
dataI, err := wl.Workload().WorkloadData()
2222
if err != nil {
23-
dataI, err = wl.Workload4().WorkloadData()
24-
if err != nil {
25-
return Disk{}, errors.Wrap(err, "failed to get workload data")
26-
}
23+
return Disk{}, errors.Wrap(err, "failed to get workload data")
2724
}
2825

2926
data, ok := dataI.(*zos.ZMount)

0 commit comments

Comments
 (0)