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

Support rename cluster #671

Merged
merged 4 commits into from
Aug 14, 2020
Merged

Support rename cluster #671

merged 4 commits into from
Aug 14, 2020

Conversation

lucklove
Copy link
Member

What problem does this PR solve?

Make it possible to rename cluster.

What is changed and how it works?

Rename the cluster storage folder and reload prometheus and grafana.
eg: tiup cluster rename old new equals to:

mv ~/.tiup/storage/cluster/clusters/old ~/.tiup/storage/cluster/clusters/new
tiup cluster reload new -R grafana,prometheus

Check List

Tests

  • Integration test

Side effects

Grafana stores some data related to cluster name to its grafana.db. The rename action will NOT delete them. So there may be some useless panel need to be deleted manually.

Release notes:

Support rename cluster by the command `tiup cluster rename <old-name> <new-name>`
> Grafana stores some data related to cluster name to its grafana.db. The rename action will NOT delete them. So there may be some useless panel need to be deleted manually.

This command will refresh config and restart grafana and prometheus

Signed-off-by: lucklove <[email protected]>
Signed-off-by: lucklove <[email protected]>
@lucklove lucklove added this to the v1.1.0 milestone Aug 11, 2020
@lucklove lucklove changed the title Rename Support rename cluster Aug 11, 2020
@codecov-commenter
Copy link

codecov-commenter commented Aug 11, 2020

Codecov Report

Merging #671 into master will increase coverage by 0.06%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #671      +/-   ##
==========================================
+ Coverage   57.53%   57.59%   +0.06%     
==========================================
  Files         249      250       +1     
  Lines       17891    17920      +29     
==========================================
+ Hits        10293    10321      +28     
- Misses       6248     6249       +1     
  Partials     1350     1350              
Flag Coverage Δ
#coverage 57.59% <ø> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...c/github.com/pingcap/tiup/pkg/cluster/api/dmapi.go 61.31% <0.00%> (-1.46%) ⬇️
...src/github.com/pingcap/tiup/pkg/cluster/manager.go 69.05% <0.00%> (-0.48%) ⬇️
.../pingcap/tiup/components/cluster/command/rename.go 71.42% <0.00%> (ø)
...om/pingcap/tiup/components/cluster/command/root.go 45.88% <0.00%> (+0.32%) ⬆️
go/src/github.com/pingcap/tiup/pkg/utils/ioutil.go 49.18% <0.00%> (+1.63%) ⬆️
...c/github.com/pingcap/tiup/pkg/cluster/api/pdapi.go 61.28% <0.00%> (+3.96%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4ffac68...ab581e3. Read the comment docs.

@lucklove lucklove added the type/new-feature Categorizes pr as related to a new feature. label Aug 11, 2020
Signed-off-by: lucklove <[email protected]>
@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Aug 14, 2020
@lonng
Copy link
Contributor

lonng commented Aug 14, 2020

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Aug 14, 2020
@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot ti-srebot merged commit e79fa39 into pingcap:master Aug 14, 2020
@lonng lonng deleted the rename branch August 14, 2020 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/can-merge Indicates a PR has been approved by a committer. status/LGT1 Indicates that a PR has LGTM 1. type/new-feature Categorizes pr as related to a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants