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

chore: Address linter issues #1014

Merged
merged 1 commit into from
Oct 10, 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
2 changes: 1 addition & 1 deletion operator/backupcontroller/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func (b *BackupExecutor) startBackup(ctx context.Context) error {

backupItems, err := b.listAndFilterPVCs(ctx, cfg.Config.BackupAnnotation)
if err != nil {
b.Generic.SetConditionFalseWithMessage(ctx, k8upv1.ConditionReady, k8upv1.ReasonRetrievalFailed, err.Error())
b.Generic.SetConditionFalseWithMessage(ctx, k8upv1.ConditionReady, k8upv1.ReasonRetrievalFailed, "%s", err.Error())
return err
}

Expand Down
4 changes: 2 additions & 2 deletions operator/backupcontroller/prebackup.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ func (b *BackupExecutor) allDeploymentsAreReady(ctx context.Context, deployments
ready, err := isPreBackupDeploymentReady(deployment)
if err != nil {
log.Info("backup failed: deadline exceeded on pre backup deployment")
b.SetConditionFalseWithMessage(ctx, k8upv1.ConditionPreBackupPodReady, k8upv1.ReasonFailed, err.Error())
b.SetConditionTrueWithMessage(ctx, k8upv1.ConditionReady, k8upv1.ReasonFailed, err.Error())
b.SetConditionFalseWithMessage(ctx, k8upv1.ConditionPreBackupPodReady, k8upv1.ReasonFailed, "%s", err.Error())
b.SetConditionTrueWithMessage(ctx, k8upv1.ConditionReady, k8upv1.ReasonFailed, "%s", err.Error())
b.deletePreBackupDeployment(ctx, deployment)
return false, err
}
Expand Down
4 changes: 2 additions & 2 deletions operator/backupcontroller/prebackup_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ func (b *BackupExecutor) fetchOrCreatePreBackupDeployment(ctx context.Context, d
if fetchErr != nil {
if !errors.IsNotFound(fetchErr) {
err := fmt.Errorf("error getting pre backup pod '%v': %w", name.String(), fetchErr)
b.SetConditionFalseWithMessage(ctx, k8upv1.ConditionPreBackupPodReady, k8upv1.ReasonRetrievalFailed, err.Error())
b.SetConditionFalseWithMessage(ctx, k8upv1.ConditionPreBackupPodReady, k8upv1.ReasonRetrievalFailed, "%s", err.Error())
return err
}

createErr := b.Client.Create(ctx, deployment)
if createErr != nil {
err := fmt.Errorf("error creating pre backup pod '%v': %w", name.String(), createErr)
b.SetConditionFalseWithMessage(ctx, k8upv1.ConditionPreBackupPodReady, k8upv1.ReasonCreationFailed, err.Error())
b.SetConditionFalseWithMessage(ctx, k8upv1.ConditionPreBackupPodReady, k8upv1.ReasonCreationFailed, "%s", err.Error())
return err
}
log.Info("started pre backup pod", "preBackup", name.String())
Expand Down
2 changes: 1 addition & 1 deletion restic/s3/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func (c *Client) deleteBucketByName(ctx context.Context, name string) error {

// Print errors received from RemoveObjects API
for e := range errorCh {
return fmt.Errorf("Failed to remove " + e.ObjectName + ", error: " + e.Err.Error())
return fmt.Errorf("Failed to remove %v ,error: %v", e.ObjectName, e.Err.Error())
}

return c.minioClient.RemoveBucket(ctx, name)
Expand Down
Loading