Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix dependencies #510

Merged
merged 2 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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),
}
}
Loading