Skip to content

Commit da9e0a9

Browse files
authored
fix dependencies (#510)
* fix dependencies * gen mocks
1 parent adcefc9 commit da9e0a9

7 files changed

Lines changed: 1686 additions & 1022 deletions

File tree

cmd/plural/bootstrap.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ func (p *Plural) handleMoveCluster(c *cli.Context) error {
216216
return fmt.Errorf("You're not within an installation repo")
217217
}
218218

219-
client, err := apiclient.New("")
219+
client, err := apiclient.New(context.Background(), "")
220220
if err != nil {
221221
return err
222222
}
@@ -238,7 +238,7 @@ func (p *Plural) handleMoveCluster(c *cli.Context) error {
238238
Namespace: "bootstrap",
239239
DryRun: false,
240240
}
241-
if err := client.Move(options); err != nil {
241+
if err := client.Move(context.Background(), options); err != nil {
242242
return err
243243
}
244244

go.mod

Lines changed: 187 additions & 205 deletions
Large diffs are not rendered by default.

go.sum

Lines changed: 1482 additions & 803 deletions
Large diffs are not rendered by default.

pkg/test/mocks/Client.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/test/mocks/ConsoleClient.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/test/mocks/Kube.go

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/utils/backup/capi.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package backup
22

33
import (
4+
"context"
45
"fmt"
56
"os"
67
"path/filepath"
@@ -12,6 +13,7 @@ import (
1213

1314
type CAPIBackup struct {
1415
dirPath string
16+
ctx context.Context
1517
}
1618

1719
func (this CAPIBackup) createDir() {
@@ -28,7 +30,7 @@ func (this CAPIBackup) Exists() bool {
2830
}
2931

3032
func (this CAPIBackup) Save(options apiclient.MoveOptions) error {
31-
client, err := apiclient.New("")
33+
client, err := apiclient.New(this.ctx, "")
3234
if err != nil {
3335
return err
3436
}
@@ -41,11 +43,11 @@ func (this CAPIBackup) Save(options apiclient.MoveOptions) error {
4143
options.ToDirectory = this.dirPath
4244
options.Namespace = "bootstrap"
4345

44-
return client.Move(options)
46+
return client.Move(this.ctx, options)
4547
}
4648

4749
func (this CAPIBackup) Restore(options apiclient.MoveOptions) error {
48-
client, err := apiclient.New("")
50+
client, err := apiclient.New(this.ctx, "")
4951
if err != nil {
5052
return err
5153
}
@@ -61,7 +63,7 @@ func (this CAPIBackup) Restore(options apiclient.MoveOptions) error {
6163
options.FromDirectory = this.dirPath
6264
options.Namespace = "bootstrap"
6365

64-
return client.Move(options)
66+
return client.Move(this.ctx, options)
6567
}
6668

6769
func (this CAPIBackup) Remove() error {
@@ -76,6 +78,7 @@ func NewCAPIBackup(cluster string) Backup[apiclient.MoveOptions] {
7678
path, _ := config.PluralDir()
7779

7880
return CAPIBackup{
81+
ctx: context.Background(),
7982
dirPath: filepath.Join(path, backupsDir, cluster),
8083
}
8184
}

0 commit comments

Comments
 (0)