Skip to content

Commit

Permalink
fix dependencies (#510)
Browse files Browse the repository at this point in the history
* fix dependencies

* gen mocks
  • Loading branch information
zreigz committed May 17, 2024
1 parent adcefc9 commit da9e0a9
Show file tree
Hide file tree
Showing 7 changed files with 1,686 additions and 1,022 deletions.
4 changes: 2 additions & 2 deletions cmd/plural/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ func (p *Plural) handleMoveCluster(c *cli.Context) error {
return fmt.Errorf("You're not within an installation repo")
}

client, err := apiclient.New("")
client, err := apiclient.New(context.Background(), "")
if err != nil {
return err
}
Expand All @@ -238,7 +238,7 @@ func (p *Plural) handleMoveCluster(c *cli.Context) error {
Namespace: "bootstrap",
DryRun: false,
}
if err := client.Move(options); err != nil {
if err := client.Move(context.Background(), options); err != nil {
return err
}

Expand Down
392 changes: 187 additions & 205 deletions go.mod

Large diffs are not rendered by default.

2,285 changes: 1,482 additions & 803 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/test/mocks/Client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/test/mocks/ConsoleClient.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions pkg/test/mocks/Kube.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions pkg/utils/backup/capi.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package backup

import (
"context"
"fmt"
"os"
"path/filepath"
Expand All @@ -12,6 +13,7 @@ import (

type CAPIBackup struct {
dirPath string
ctx context.Context
}

func (this CAPIBackup) createDir() {
Expand All @@ -28,7 +30,7 @@ func (this CAPIBackup) Exists() bool {
}

func (this CAPIBackup) Save(options apiclient.MoveOptions) error {
client, err := apiclient.New("")
client, err := apiclient.New(this.ctx, "")
if err != nil {
return err
}
Expand All @@ -41,11 +43,11 @@ func (this CAPIBackup) Save(options apiclient.MoveOptions) error {
options.ToDirectory = this.dirPath
options.Namespace = "bootstrap"

return client.Move(options)
return client.Move(this.ctx, options)
}

func (this CAPIBackup) Restore(options apiclient.MoveOptions) error {
client, err := apiclient.New("")
client, err := apiclient.New(this.ctx, "")
if err != nil {
return err
}
Expand All @@ -61,7 +63,7 @@ func (this CAPIBackup) Restore(options apiclient.MoveOptions) error {
options.FromDirectory = this.dirPath
options.Namespace = "bootstrap"

return client.Move(options)
return client.Move(this.ctx, options)
}

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

return CAPIBackup{
ctx: context.Background(),
dirPath: filepath.Join(path, backupsDir, cluster),
}
}

0 comments on commit da9e0a9

Please sign in to comment.