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

http-service: add StopBackup&StopRestore api for http-service #5374

Merged
merged 5 commits into from
Nov 16, 2023

Conversation

HuSharp
Copy link
Contributor

@HuSharp HuSharp commented Nov 6, 2023

What problem does this PR solve?

example for backup:
add backup, status is Scheduled
image

curl http://127.0.0.1:9080/v1beta/clusters/backup-test/backups/demo1-full-backup-s3:stop

return success

after backup, status is Stopped
image

when curl stop again, will return Backup demo1-full-backup-s3 is already Stopped
image

What is changed and how does it work?

Code changes

  • Has Go code change
  • Has CI related scripts change

Tests

  • Unit test
  • E2E test
  • Manual test
  • No code

Release Notes

Please refer to Release Notes Language Style Guide before writing the release note.


Copy link
Contributor

ti-chi-bot bot commented Nov 6, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign azurezyq for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot requested a review from howardlau1999 November 6, 2023 09:30
@sre-bot
Copy link
Contributor

sre-bot commented Nov 6, 2023

CLA assistant check
All committers have signed the CLA.

@ti-chi-bot ti-chi-bot bot added the size/XXL label Nov 6, 2023
@codecov-commenter
Copy link

codecov-commenter commented Nov 6, 2023

Codecov Report

Merging #5374 (074867b) into master (996c48f) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5374      +/-   ##
==========================================
+ Coverage   61.56%   61.57%   +0.01%     
==========================================
  Files         228      228              
  Lines       28866    28866              
==========================================
+ Hits        17771    17775       +4     
+ Misses       9349     9347       -2     
+ Partials     1746     1744       -2     
Flag Coverage Δ
unittest 61.57% <100.00%> (+0.01%) ⬆️

Signed-off-by: husharp <[email protected]>
Comment on lines 519 to 526
// update backup status
_, err = opCli.PingcapV1alpha1().Backups(req.ClusterId).Update(ctx, backup, metav1.UpdateOptions{})
if err != nil {
logger.Error("Backup not found", zap.Error(err))
message := fmt.Sprintf("Backup %s not found", req.BackupId)
setResponseStatusCodes(ctx, http.StatusBadRequest)
return &api.StopBackupResp{Success: false, Message: &message}, nil
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove these lines? and also for // update restore status

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

@csuzhangxc csuzhangxc merged commit d83372b into pingcap:master Nov 16, 2023
4 checks passed
@HuSharp HuSharp deleted the stop_br_api branch November 16, 2023 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants