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

Fix self update #816

Merged
merged 8 commits into from
Sep 27, 2020
Merged

Fix self update #816

merged 8 commits into from
Sep 27, 2020

Conversation

lucklove
Copy link
Member

Signed-off-by: lucklove gnu.crazier@gmail.com

What problem does this PR solve?

The code in the master branch will get the tiup binary lost after execution tiup update --self:
屏幕快照 2020-09-25 下午5 11 42

This is because we treat tiup as a normal component and install it to ~/.tiup/components/tiup/{version}/ in SelfUpdate and once it's installed SelfUpdate will return nil and the old tiup binary will be remove from ~/.tup/bin.

In a word, it should be installed to "/.tiup/bin" instead of "/.tiup/components/tiup/{version}/"

What is changed and how it works?

Read the TargetDir field of ComponentSpec, if it's not empty, install component to where it's specified.

Check List

Tests

  • Integration test

Related changes

  • Need to cherry-pick to the release branch

Release notes:

NONE

Signed-off-by: lucklove <gnu.crazier@gmail.com>
@lucklove lucklove self-assigned this Sep 25, 2020
@lucklove lucklove added status/PTAL type/bug-fix Categorizes PR as a bug-fix labels Sep 25, 2020
@lucklove lucklove added this to the v1.2.0 milestone Sep 25, 2020
@codecov-commenter
Copy link

codecov-commenter commented Sep 25, 2020

Codecov Report

Merging #816 into master will decrease coverage by 0.20%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #816      +/-   ##
==========================================
- Coverage   52.73%   52.52%   -0.21%     
==========================================
  Files         262      262              
  Lines       18965    18971       +6     
==========================================
- Hits        10001     9965      -36     
- Misses       7404     7447      +43     
+ Partials     1560     1559       -1     
Flag Coverage Δ
#cluster 44.42% <0.00%> (-0.30%) ⬇️
#dm 25.15% <0.00%> (-0.08%) ⬇️
#integrate 47.53% <0.00%> (-0.23%) ⬇️
#playground 22.17% <0.00%> (-0.03%) ⬇️
#tiup 10.83% <0.00%> (-0.01%) ⬇️
#unittest 18.81% <0.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
cmd/update.go 50.00% <0.00%> (ø)
pkg/repository/mirror.go 47.20% <0.00%> (-1.57%) ⬇️
pkg/repository/v1_repository.go 65.05% <0.00%> (-0.34%) ⬇️
pkg/cluster/clusterutil/parse_topology.go 30.00% <0.00%> (-30.00%) ⬇️
pkg/cluster/task/update_meta.go 56.52% <0.00%> (-10.87%) ⬇️
pkg/cluster/operation/scale_in.go 41.66% <0.00%> (-10.42%) ⬇️
pkg/cliutil/cliutil.go 60.71% <0.00%> (-7.15%) ⬇️
pkg/cluster/spec/tispark.go 64.13% <0.00%> (-3.27%) ⬇️
pkg/cluster/api/dmapi.go 56.52% <0.00%> (-1.74%) ⬇️
pkg/cluster/operation/action.go 50.81% <0.00%> (-0.70%) ⬇️
... and 4 more

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 f947d60...ecddddc. Read the comment docs.

Copy link
Contributor

@lonng lonng left a comment

Choose a reason for hiding this comment

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

lgtm

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 26, 2020
@lonng
Copy link
Contributor

lonng commented Sep 26, 2020

/merge

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

Your auto merge job has been accepted, waiting for:

  • 817

@lonng lonng removed the status/PTAL label Sep 26, 2020
@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@lucklove merge failed.

@lucklove lucklove merged commit bd751e4 into pingcap:master Sep 27, 2020
@lucklove lucklove deleted the fix-self-update branch September 27, 2020 07:12
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/bug-fix Categorizes PR as a bug-fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants