curve icon indicating copy to clipboard operation
curve copied to clipboard

[feat] tools-v2: add bs status volume snapshot command

Open saicaca opened this issue 1 year ago • 25 comments

What problem does this PR solve?

Issue Number: #2583

Problem Summary: Add bs status volume snapshot command

What is changed and how it works?

What's Changed: Implement the bs status volume snapshot command ,which is equivalent to the snapshot-status command in snaptool.py.

How it Works: It acquires snapshot status data through HTTP requests, mirroring the behavior in the Python version.

Side effects(Breaking backward compatibility? Performance regression?):

Check List

  • [x] Relevant documentation/comments is changed or added
  • [x] I acknowledge that all my contributions will be made under the project's license

saicaca avatar Sep 12 '23 17:09 saicaca

This pr is encapsulated, and you can add your calls on this basis.

I have rewritten this using the new snapshot utils.

saicaca avatar Sep 24 '23 15:09 saicaca

Please resolve the conflict and rebase your commit into one.

Cyber-SiKu avatar Oct 10 '23 07:10 Cyber-SiKu

Please resolve the conflict and rebase your commit into one.

Conflicts have been addressed and I've squashed the commits. Please have a look.

saicaca avatar Oct 10 '23 14:10 saicaca

cicheck

Cyber-SiKu avatar Oct 11 '23 02:10 Cyber-SiKu

cicheck

Cyber-SiKu avatar Oct 11 '23 02:10 Cyber-SiKu

@saicaca image

caoxianfei1 avatar Oct 12 '23 10:10 caoxianfei1

@caoxianfei1 I think this is because NewSnapshotQuerySubUri in tools-v2/internal/utils/snapshot.go incorrectly uses %s instead of %v for params of any type. This causes non-string parameters to be converted into strings like %!s(int=100). The % in the string results in the appearance of (MISSING) in the final URL because of this. The same issue should also occur in other commands where NewSnapshotQuerySubUri is used.

I noticed that #2793 will address this issue so maybe we don't have to fix it in this PR?

saicaca avatar Oct 12 '23 14:10 saicaca

@caoxianfei1 I think this is because NewSnapshotQuerySubUri in tools-v2/internal/utils/snapshot.go incorrectly uses %s instead of %v for params of any type. This causes non-string parameters to be converted into strings like %!s(int=100). The % in the string results in the appearance of (MISSING) in the final URL because of this. The same issue should also occur in other commands where NewSnapshotQuerySubUri is used.

I noticed that #2793 will address this issue so maybe we don't have to fix it in this PR?

I think we need to modify this issue to ensure that every pull request is correct and not rely on a code that has not yet been merged.

caoxianfei1 avatar Oct 13 '23 01:10 caoxianfei1

@saicaca it works after modify the function. And it's better that you fix it.

caoxianfei1 avatar Oct 13 '23 01:10 caoxianfei1

@saicaca it works after modify the function. And it's better that you fix it.

I will do it this noon.

saicaca avatar Oct 13 '23 03:10 saicaca

@caoxianfei1 NewSnapshotQuerySubUri is fixed in the latest commit.

saicaca avatar Oct 13 '23 07:10 saicaca

cicheck

saicaca avatar Oct 13 '23 07:10 saicaca

cicheck

saicaca avatar Oct 13 '23 07:10 saicaca

cicheck

Cyber-SiKu avatar Oct 23 '23 06:10 Cyber-SiKu

cicheck

saicaca avatar Oct 25 '23 18:10 saicaca

need to rebase and fix the conflict.

caoxianfei1 avatar Oct 27 '23 06:10 caoxianfei1

cicheck

saicaca avatar Oct 27 '23 08:10 saicaca

need to rebase and fix the conflict.

@caoxianfei1 I think it's ready to merge.

saicaca avatar Oct 27 '23 09:10 saicaca

pls fix conflicts

Cyber-SiKu avatar Nov 02 '23 02:11 Cyber-SiKu

pls fix conflicts

Conflicts fixed.

saicaca avatar Nov 03 '23 15:11 saicaca

cicheck

saicaca avatar Nov 03 '23 15:11 saicaca

cicheck

Cyber-SiKu avatar Nov 06 '23 03:11 Cyber-SiKu

cicheck

caoxianfei1 avatar Dec 25 '23 10:12 caoxianfei1

Are you free to move on, fix the conflict and complete it.

montaguelhz avatar Jan 05 '24 09:01 montaguelhz

Are you free to move on, fix the conflict and complete it.

Yes, I have fixed the conflict.

saicaca avatar Jan 06 '24 07:01 saicaca