mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-09-20 06:54:32 +00:00
@@ -212,7 +212,7 @@ func (o *CreateOptions) Run(c *cobra.Command, f client.Factory) error {
|
||||
for _, location := range locations.Items {
|
||||
if location.Spec.Default {
|
||||
location.Spec.Default = false
|
||||
if err := kbClient.Update(context.Background(), &location, &kbclient.UpdateOptions{}); err != nil {
|
||||
if err := kbClient.Update(context.Background(), &location, &kbclient.UpdateOptions{}); err != nil { //nolint
|
||||
return errors.WithStack(err)
|
||||
}
|
||||
break
|
||||
|
||||
@@ -116,7 +116,7 @@ func Run(f client.Factory, o *cli.DeleteOptions) error {
|
||||
|
||||
// Create a backup-location deletion request for each
|
||||
for _, location := range locations.Items {
|
||||
if err := kbClient.Delete(context.Background(), &location, &kbclient.DeleteOptions{}); err != nil {
|
||||
if err := kbClient.Delete(context.Background(), &location, &kbclient.DeleteOptions{}); err != nil { //nolint
|
||||
errs = append(errs, errors.WithStack(err))
|
||||
continue
|
||||
}
|
||||
@@ -163,7 +163,7 @@ func findAssociatedBackupRepos(client kbclient.Client, bslName, ns string) (vele
|
||||
func deleteBackups(client kbclient.Client, backups velerov1api.BackupList) []error {
|
||||
var errs []error
|
||||
for _, backup := range backups.Items {
|
||||
if err := client.Delete(context.Background(), &backup, &kbclient.DeleteOptions{}); err != nil {
|
||||
if err := client.Delete(context.Background(), &backup, &kbclient.DeleteOptions{}); err != nil { //nolint
|
||||
errs = append(errs, errors.WithStack(fmt.Errorf("delete backup %q associated with deleted BSL: %w", backup.Name, err)))
|
||||
continue
|
||||
}
|
||||
@@ -175,7 +175,7 @@ func deleteBackups(client kbclient.Client, backups velerov1api.BackupList) []err
|
||||
func deleteBackupRepos(client kbclient.Client, repos velerov1api.BackupRepositoryList) []error {
|
||||
var errs []error
|
||||
for _, repo := range repos.Items {
|
||||
if err := client.Delete(context.Background(), &repo, &kbclient.DeleteOptions{}); err != nil {
|
||||
if err := client.Delete(context.Background(), &repo, &kbclient.DeleteOptions{}); err != nil { //nolint
|
||||
errs = append(errs, errors.WithStack(fmt.Errorf("delete backup repository %q associated with deleted BSL: %w", repo.Name, err)))
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ func (o *SetOptions) Run(c *cobra.Command, f client.Factory) error {
|
||||
break
|
||||
}
|
||||
location.Spec.Default = false
|
||||
if err := kbClient.Update(context.Background(), &location, &kbclient.UpdateOptions{}); err != nil {
|
||||
if err := kbClient.Update(context.Background(), &location, &kbclient.UpdateOptions{}); err != nil { //nolint
|
||||
return errors.WithStack(err)
|
||||
}
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user